Re: Hooks Docu - list of hooks

From: geohas <lists(at)hasibether(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hooks Docu - list of hooks
Date: 2014-06-24 11:42:49
Message-ID: 53A96439.2020403@hasibether.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 24/06/14 12:59, Abhijit Menon-Sen wrote:
> At 2014-06-24 12:49:17 +0200, lists(at)hasibether(dot)at wrote:
>>
>> Is there a list of possible hooks, or maybe a little docu or overview?
>
> The best I found was "git grep _hook_type" and then read the code to
> understand when and why the hook was called.
>
>> Especially hooks to catch Insert, Update and Delete Stmts and
>> SubQuerys.
>>
>> It would help a lot to finish / write a log into Tables Module.
>
> Look at how pgaudit does it: https://github.com/2ndQuadrant/pgaudit
I already tried pgaudit ;), one of the best examples, it helped me much.
>
>
> The code has comments about how the various available hooks are used.
> (I was planning to implement a bgwriter that wrote log messages to a
> table, which sounds a bit like what you want to do.)
The module i'm thinking of, working on, is a bit inspired from pgaudit
and petere's pg_trashcan.
It should copy every created table in a "shadow"-schema with extra
columns for record on / record off and Userid (this is already working ;)).
In case of a drop statement it should rename the table in the shadow
schema XXX-droped-Date.

Now i am trying to catch the planned Stmts, ...
It should work without triggers - because the shadow schema should only
be visible for user postgres.

regards
geohas

>
>
> -- Abhijit
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTqWQ4AAoJEJFGMlQe7wR/8CEIAJihWVGc//dDHGF9lDtMo3Ds
v1Xhd5U9n1tLL/Cx0/cqnslKctdfSCY2I/ptjNSDFO8U/YdUjNdPf4nYvxn0gjKR
n8VuC61BDr6qHFQvlJE7GLv2hs2GCxFM5dEgnV7foJjT18C/VgnSRFulJzxU87EZ
8uKG53+CM9ERDa5P9py9jyvrJJvIAXk9AAfevU9g+jimwK9OntwkC7ZfyVWEDwfr
x7LDyrzhge/EIco01pzJSimuVd0BPvTQ8V7XUTpy25xS+D8968wE8eRBaMWXH0b2
KR5lju+sz+SyVQKildcyExOEQWN3PgVmST5USAy9cAzPIuic+yR+qsa5H2VRTFI=
=ZYct
-----END PGP SIGNATURE-----

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sebastian Reitenbach 2014-06-24 11:45:41 Re: PostgreSQL for VAX on NetBSD/OpenBSD
Previous Message Sebastian Reitenbach 2014-06-24 11:37:13 Re: PostgreSQL for VAX on NetBSD/OpenBSD