Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA05187; Fri, 26 Jul 91 10:10:22 -0700
Message-Id: <9107261710.AA05187@postgres.Berkeley.EDU>
From: mao@postgres.Berkeley.EDU (Mike Olson)
Subject: Re: inhibit of the transaction sistem
To: postgres@postgres.berkeley.edu
In-Reply-To: Your message of "Fri, 26 Jul 91 05:26:14 PST."
             <9107261223.AA02113@dpi.inpe.br> 
Date: Fri, 26 Jul 91 10:09:10 PDT

you can't turn off the transaction system.  if you really need to do a large
number of updates in a single transaction, you can write a C function of
the foorm

	int
	myfunc()
	{
	    int i;
	    char *mybuf;

	    mybuf = (char *) palloc(128);

	    for (i = 0; i < 100; i++) {
		sprintf(mybuf, "append myrel (i = %d)", i);
		pg_eval(mybuf);
	    }

	    return (i);
	}

and then have this routine dynamically loaded by the backend (you declare
it as a C function, giving the path to the .o, in the normal way).

at that point,

	Go
	* retrieve (x = myfunc())\g

will do 100 appends inside a single transaction, and return 100.

					mike olson
					postgres research group
					uc berkeley
					mao@postgres.berkeley.edu
