Re: pgsql functions and transactions?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Betsy Barker <betsy(dot)barker(at)supportservicesinc(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: pgsql functions and transactions?
Date: 2004-08-27 04:46:01
Message-ID: 200408262146.01453.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Betsy,

> I read the posts on pgsql functions and transactions from the Novice list,
> and I think they are saying "PGSQL functions do not support transactions".
> Is this correct? Or is the idea that functions are automatically in a
> transaction?

That's right. Soon (8.0 or 8.1) functions will support *sub-transactions*,
or savepoints, but that still won't do a checkpoint and synch, which is what
you need.

In my experience, there is a limit to the amount of processing you can
reasonably do in a single function in Postgres because of the need to stop
and synch (and possibly VACUUM). I often have "series" of functions (in
one case, about 18) which are executed in succession by a Perl script.

We've been discussing PROCEDURES on -hackers which are non-transactional (and
thus can contain several transactions). But nobody is coding this yet.

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Noel Faux 2004-08-27 08:31:15 Re: Foreign keys
Previous Message Tom Lane 2004-08-27 03:09:12 Re: pgsql functions and transactions?