On Friday 02 January 2009 03:53:58 Gerhard Heift wrote:
> On Thu, Jan 01, 2009 at 02:41:08PM +0100, Gerhard Heift wrote:
> > Hello,
> >
> > I want to log with triggers or in functions, and these logs should be
> > independet of the transaction. Beside i want to have the information
> > which action was commited and which not.
> >
> > So my idea was to log into the same database with dblink, return the
> > primary keys and add them into a commit table.
> >
> > But my problem is, that I do not now how to write the rule properly.
> >
We created a similar project to this which is in the pgsoltools repo;
http://labs.omniti.com/trac/pgsoltools/browser/trunk/autonomous_logging_tool
This was originally created to mimic logging done in long-running Oracle
PL/SQL functions using autonomous commits, but should work within any trigger
functions on the postgres side as well (or at least givec you a good starting
point to adapt it). HTH
--
Robert Treat
Conjecture: http://www.xzilla.net
Consulting: http://www.omniti.com