Re: Event Triggers: adding information

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Event Triggers: adding information
Date: 2013-01-22 13:28:54
Message-ID: m21uddjqi1.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thom Brown <thom(at)linux(dot)com> writes:
> Would it be desirable to have ddl_command_success and
> ddl_command_failed events. These would effectively be subsets to

No, because you can't run any SQL in a failed transaction.

> This, unfortunately, introducing awkwardness with the WHEN clause
> restriction which doesn't accommodate simple equality. And looking at
> the IN part of the syntax, it looks awful: WHEN TAG IN ('DROP
> SEQUENCE' AND 'CREATE TABLE').

The syntax is using a comma, not an "AND", as seen in the tests:

create event trigger regress_event_trigger2 on ddl_command_start
when tag in ('create table', 'CREATE FUNCTION')
execute procedure test_event_trigger();

> So note that I'm coming into this syntax kinda fresh, so just giving
> first impressions of the current implementation.

Thanks for that, I'm all for getting something better at the end!

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-01-22 13:32:51 Re: Prepared statements fail after schema changes with surprising error
Previous Message Dimitri Fontaine 2013-01-22 13:24:26 Re: Prepared statements fail after schema changes with surprising error