Re: audit table containing Select statements submitted - Mailing list pgsql-hackers

From Greg Stark
Subject Re: audit table containing Select statements submitted
Date
Msg-id 87ves5qi13.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: audit table containing Select statements submitted  (Thomas Hallgren <thomas@tada.se>)
Responses Re: audit table containing Select statements submitted
List pgsql-hackers
Thomas Hallgren <thomas@tada.se> writes:

> Some users of PL/Java make use of a non-default connection from within a
> Trigger in order to do this. In essence, they load the client JDBC package into
> the backend to let the backend as such become a client. The second connection
> is then maintained for the lifetime of the first. Perhaps not the most
> efficient way of doing it but it works.

And you can do the same thing with any of the PL languages that have database
drivers like Perl or Python. It might be a little less inefficient using one
of them -- and probably a lot less code.

You should be aware of the risk of deadlocks if you touch the same resources.
Because the database is unaware that your main transaction is waiting for this
other session to complete it won't be able to detect any deadlocks that depend
on this hidden dependency.

-- 
greg



pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: audit table containing Select statements submitted
Next
From: "Albe Laurenz"
Date:
Subject: Re: PL/pgSQL 'i = i + 1' Syntax