pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bart Degryse <Bart.Degryse@indicator.be>
To: pgsql-sql@postgresql.org
Subject: Re: Transactions and Exceptions
Date: Tue, 26 Jun 2007 09:26:19 +0200
Message-ID: <4680DBBB.A3DD.0030.0@indicator.be> (raw)
In-Reply-To: <467C0011.8000805@archonet.com>
References: <467BE1BB.A3DD.0030.0@indicator.be>
	<467BCDA1.9070606@archonet.co m>
	<467BF045.A3DD.0030.0@indicator.be>
	<467BF045.A3DD.0030.0@indicator.be>
	< 467C0011.8000805@archonet.com>

>>>> Richard Huxton <dev@archonet.com> 2007-06-22 19:00 >>>
>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
You're right of course about dblink. We never installed it though because it 
lacks the ability to connect to non-postgresql databases. dbi-link on the other
hand didn't make it either because of the overhead. It basically duplicates all tables 
in the source database, which is too much if you only need say 8 tables of the 300 
that exist. So we have chosen to make our own 'interface' having just what we need 
and nothing more. Using it to have our logging system in a seperate transaction is
perfectly possible, we just didn't think of it ourselfs. Nevertheless I think an 
equivalent to PRAGMA AUTONOMOUS_TRANSACTION would be nice to have.
Thanks for your help and insight Richard.
 

view thread (5+ messages)

Message-ID: <4680DBBB.A3DD.0030.0@indicator.be>
Permalink:  ../4680DBBB.A3DD.0030.0@indicator.be/
Also on:    postgresql.org/message-id/4680DBBB.A3DD.0030.0@indicator.be

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: Bart.Degryse@indicator.be
  Subject: Re: Transactions and Exceptions
  In-Reply-To: <4680DBBB.A3DD.0030.0@indicator.be>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox