Re: event triggers in 9.3.4

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: "Vasudevan, Ramya" <ramya(dot)vasudevan(at)classmates(dot)com>, hubert depesz lubaczewski <depesz(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: event triggers in 9.3.4
Date: 2014-07-25 18:07:03
Message-ID: CAFj8pRCodz6oSABhCmiJF7YkROqpmqWELppGD=BaU9EC_Fb9ew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

I found a interesting extension
http://code.malloclabs.com/pg_schema_triggers

Regards

Pavel

2014-07-25 20:01 GMT+02:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Vasudevan, Ramya wrote:
> > >> You could compare list of tables before (_start) and after (_end) the
> ddl. Doing it in plpgsql will be tricky, but if you'd use some other
> language - like plperl - it's relatively simple:
> http://www.depesz.com/2013/12/18/waiting-for-9-4-plperl-add-event-trigger-support/
> > Thank You Depesz. This will work for ‘CREATE’ and ‘DROP’ DDLs.
> >
> > But, what about the scenario where I want to just have event triggers
> for operations like these? - 'ALTER TABLE','ALTER TRIGGER', 'ALTER FUNCTION'
> > CREATE EVENT TRIGGER log_ddl_info_start
> > ON
> > ddl_command_start
> > when
> > tag in
> > ('ALTER TABLE','ALTER TRIGGER','CREATE FUNCTION','ALTER FUNCTION')
> > EXECUTE PROCEDURE
> > log_ddl_execution();
> >
> > In this case, is there a way to capture the object that was altered?
>
> Not yet, but there's a patch in progress to help with this. If you're
> interested in the feature, please give the patch a try and see if the
> user interface it provides solves your use case. We want to ensure that
> the new feature we're creating is useful.
>
> You can find the patch here:
>
> http://www.postgresql.org/message-id/20140613203156.GR18688@eldon.alvh.no-ip.org
> (there are lots of small patches to ease review, so please grab them all
> and apply one by one) and a sample event trigger function (there are no
> docs yet) here:
>
> http://www.postgresql.org/message-id/20140115051111.GB29105@eldon.alvh.no-ip.org
>
> Thanks,
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G Johnston 2014-07-25 18:14:43 Re: Index usage with slow query
Previous Message Francisco Olarte 2014-07-25 18:04:06 Re: copy/dump database to text/csv files