Search Postgresql Archives

Re: Nested transactions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 11, 2009 at 07:41:54PM -0700, Bill Todd wrote:
> Does PostgreSQL support nested transactions as shown below?
>
> BEGIN;
>  ...do some stuff...
>  BEGIN;
>    ...more stuff...
>  COMMIT;
> COMMIT;

It depends what you want to have happen when the outer transaction
rolls back.  If you want all the sub-commits to roll back, use
SAVEPOINTs.  If you don't, you'll have to write something in an
untrusted PL that uses a separate database connection.

Cheers,
David.
-- 
David Fetter <david@xxxxxxxxxx> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@xxxxxxxxx

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux