Re: Logging access to data in database table - Mailing list pgsql-general

From Ivan Radovanovic
Subject Re: Logging access to data in database table
Date
Msg-id 4F2058C1.20305@gmail.com
Whole thread Raw
In response to Re: Logging access to data in database table  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-general
On 01/25/12 18:38, Greg Sabino Mullane napisa:
>
> You would need to break out of the transaction somehow within that
> function and make a new call to the database, for example using dblink
> or plperlu. I've done the latter before and it wasn't too painful.
> The general idea is:
>
> - ---
> $dbh = DBI->connect(...)
> $sth = $dbh->prepare('INSERT into log_table...');
> $sth->execute(@values);
> $dbh->commit();
>
> Fetch the data as normal, and return to the user.
> - ---
>
> Of course, you would want to cache the $dbh and $sth bits.
>
> - --
> Greg Sabino Mullane greg@turnstep.com
> End Point Corporation http://www.endpoint.com/
> PGP Key: 0x14964AC8 201201251237
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
>

Thanks for taking your time to reply, we will still consider whether to
use contrib/dblink or plperl, but this idea definitely wasn't something
any of us had in mind :-)

Thanks again,
Ivan

pgsql-general by date:

Previous
From: Misa Simic
Date:
Subject: Re: Logging access to data in database table
Next
From: Ivan Radovanovic
Date:
Subject: Re: Logging access to data in database table