Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 8EF7A9FC1F6 for ; Fri, 22 Jun 2007 14:00:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 03514-01-5 for ; Fri, 22 Jun 2007 14:00:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id B289C9FB975 for ; Fri, 22 Jun 2007 14:00:05 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 514B674116; Fri, 22 Jun 2007 18:00:02 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id EA50E274154; Fri, 22 Jun 2007 18:00:01 +0100 (BST) Message-ID: <467C0011.8000805@archonet.com> Date: Fri, 22 Jun 2007 18:00:01 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Bart Degryse Cc: pgsql-sql@postgresql.org Subject: Re: Transactions and Exceptions References: <467BE1BB.A3DD.0030.0@indicator.be><467BCDA1.9070606@archonet.co m> <467BF045.A3DD.0030.0@indicator.be> In-Reply-To: <467BF045.A3DD.0030.0@indicator.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/177 X-Sequence-Number: 28667 Bart Degryse wrote: >> 2. Using dblink / dbi-link to reconnect to the database, which means >> your logging will take place in its own transaction. > This I like more. Though I don't use either dblink nor dbi-link, I do use this kind of > 'double' connections already for other purposes in which transactions were never an > issue. So it never crossed my mind that I could use them for this too. > For the time being that's the way I'll walk. Thanks a lot! > > Reading your suggestions I assume PostgreSQL lacks something like Oracle's > PRAGMA AUTONOMOUS_TRANSACTION It might well be a useful feature (particularly for logging-style interactions as you have). I'm not sure it's particularly simple to do (other than by having a whole new backend as dblink will give you). > Shouldn't it be added, are there any plans in that direction? Returning a status code > is not always an option and using some dbi variant certainly isn't because of the > need for perlu. So then you're stuck?! Well, dblink is pure C iirc. I think the advantage with dbi-link is that you can connect to any type of database DBI can. -- Richard Huxton Archonet Ltd