Subject: inhibit of the transaction sistem

From: [email-masked] (Banco de Dados Ambiental)
Date: Fri, 26 Jul 91 05:26:14 -0700

How can I inhibit the transaction system in a LIBPQ application, or have
    a great number of updates as a single transaction?

        thanks for any help.

---

From: [email-masked] (Mike Olson)
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
					[email-masked]