Re: Logging access to data in database table

Поиск
Список
Период
Сортировка
От Ivan Radovanovic
Тема Re: Logging access to data in database table
Дата
Msg-id 4F2058C1.20305@gmail.com
обсуждение исходный текст
Ответ на Re: Logging access to data in database table  ("Greg Sabino Mullane" <greg@turnstep.com>)
Список 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 по дате отправления:

Предыдущее
От: Misa Simic
Дата:
Сообщение: Re: Logging access to data in database table
Следующее
От: Ivan Radovanovic
Дата:
Сообщение: Re: Logging access to data in database table