| From: | Christian Ohler <ohler(at)shift(dot)com> |
|---|---|
| To: | Rob Sargent <robjsargent(at)gmail(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Detecting if current transaction is modifying the database |
| Date: | 2016-08-05 20:15:39 |
| Message-ID: | CAOsiKE+vEgSmzEc3ncsfKEc5Y99EYAp+wJ69sS7CNLyKNeshfw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Fri, Aug 5, 2016 at 12:55 PM, Rob Sargent <robjsargent(at)gmail(dot)com> wrote:
>
> What sort of interface are you looking for. Where/When would you grab the information? Do what with it? Log triggers are the typical pattern here (with packages just for that sort of thing).
I'm looking for a statement (or sequence of statements) that, when run
within a transaction, tells the client if any writes are happening in
that transaction – basically an interface similar to my proposed
solution. I have some database wrapper code on the client that passes
along arbitrary statements to Postgres, and I'd like for that wrapper
code to be able to determine whether the current transaction is a
write (for various purposes including logging). It would be nice not
to make the client-side wrapper code dependent on instrumentation of
the database schema itself.
What can you tell me about my proposed solution? Does it do what I
describe I want from it? Are there limitations I should be aware of?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2016-08-05 20:24:40 | Re: Detecting if current transaction is modifying the database |
| Previous Message | Rob Sargent | 2016-08-05 19:55:21 | Re: Detecting if current transaction is modifying the database |