Re: Logging access to data in database table

From: Ivan Radovanovic <radovanovic(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Logging access to data in database table
Date: 2012-01-25 19:32:17
Message-ID: 4F2058C1.20305@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)turnstep(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ivan Radovanovic 2012-01-25 19:37:56 Re: Logging access to data in database table
Previous Message Misa Simic 2012-01-25 19:02:37 Re: Logging access to data in database table