Search Postgresql Archives

Re: Recording exceptions within function (autonomous transactions?)

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

 



Scott Mead <scottm@xxxxxxxxxxx> writes:
>> On Oct 6, 2015, at 05:38, Steve Pritchard <steve.pritchard@xxxxxxx> wrote:
>> [ how to fake an autonomous transaction? ]

> It's hacky, and, I haven't tried it in a few years.  Setup a foreign table that resides in the same database. When you write to the foreign table, it will be using a 'loopback' connection, and that transaction will be able to commit because it is a separate connection. 
>   To be fair, I haven't actually done this since the days of dblink, I *believe* it should work with fdw though. 

My recollection is that you can do this with dblink, but *not* with FDWs
--- or at least, not with postgres_fdw.  The latter is smart enough to
roll back your remote transaction when the local one rolls back.

			regards, tom lane


-- 
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