Re: Transactions within a function - Mailing list pgsql-general

From Doug McNaught
Subject Re: Transactions within a function
Date
Msg-id m37kxm89oz.fsf@belphigor.mcnaught.org
Whole thread Raw
In response to Transactions within a function  (Daniel Åkerud <zilch@home.se>)
List pgsql-general
Daniel �kerud <zilch@home.se> writes:

> Do the BEGIN and END in a function also indicate that it is done in a
> transaction?  Or can you put another BEGIN TRANSACTION; END
> TRANSACTION; in there?

Please don't post in HTML.

A function is always executed within a transaction--either an explicit
one (where the user issues BEGIN TRANSACTION) or the implicit
transaction created by issuing a single SQL statememt.  Since PG
doesn't allow nested transactions, you can't have a transaction inside
a function.

-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it strangled up my mind,
Now people just get uglier, and I got no sense of time...          --Dylan

pgsql-general by date:

Previous
From: "Brent R. Matzelle"
Date:
Subject: Re: which Python interface
Next
From: Morgan Curley
Date:
Subject: Cross database foreign keys