Re: Recording exceptions within function (autonomous transactions?) - Mailing list pgsql-general

From Tom Lane
Subject Re: Recording exceptions within function (autonomous transactions?)
Date
Msg-id 5990.1444140872@sss.pgh.pa.us
Whole thread Raw
In response to Re: Recording exceptions within function (autonomous transactions?)  (Scott Mead <scottm@openscg.com>)
List pgsql-general
Scott Mead <scottm@openscg.com> writes:
>> On Oct 6, 2015, at 05:38, Steve Pritchard <steve.pritchard@bto.org> 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
youwrite to the foreign table, it will be using a 'loopback' connection, and that transaction will be able to commit
becauseit 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


pgsql-general by date:

Previous
From: John McKown
Date:
Subject: Processing data from table using awk.
Next
From: Melvin Davidson
Date:
Subject: Re: Processing data from table using awk.