Re: Autonomous transaction

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Autonomous transaction
Date: 2004-09-13 16:59:57
Message-ID: 87isaixfxu.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Daniel Daoust <daoustd_ca(at)yahoo(dot)ca> writes:

> Hi, knowing that "autonomous transaction" (Oracle
> concept of) are not yet implemented in PostgreSQL, has
> anyone found a work-around. I need to preserve
> database states from a potential rollback and then log
> them inside database tables.

Postgres goes to great lengths to ensure this is impossible :)

> What about:
>
> 1) using memory structures to hold the info, then
> commit to the database just before exit (after the
> rollback occurred).

Well this option in your application layer is how I would do it as it's the
simplest. However:

> 3) send messages to a daemon/database job that will
> write to the tables using another
> connection/transaction ???

This option is doable entirely in the database if that's your goal. You can do
this using dblink which is the contrib directory.

It would probably be quite simple to implement, though the most complex in
another sense. With twice as many connections it could be hard to determine
where slowdowns are starting for example. And Better make sure your error
logging connections don't trigger any errors...

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Phil Endecott 2004-09-13 17:21:29 Re: Index inheritance
Previous Message David Wheeler 2004-09-13 16:44:57 ANNOUNCE: Bricolage 1.8.2 Released