Re: sql_drop Event Trigger

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sql_drop Event Trigger
Date: 2013-02-06 14:39:27
Message-ID: CA+TgmoYLO=GLJhtDXL6FSzsD9BQD44P3vw67kGyTKjeRc7S3Jw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 6, 2013 at 9:36 AM, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> variable, it seems like there are a number of ways this can go wrong.
>
> Yeah, I think the current behavior might be surprising.
>
>> I have not tested the actual behavior of the latest patch, but I think
>> we want to define things so that the
>> pg_event_trigger_dropped_objects() function returns, specifically, the
>> list of objects dropped by the command which caused the event trigger
>> to fire. In other words, in the above example, the first, recursive
>> invocation of B should see the object removed by A's DROP-IF-EXISTS,
>> and the second invocation should see the object removed by the
>> toplevel command.
>
> I disagree with that. I don't see why the enclosing event trigger
> shouldn't be aware of all the objects dropped by the command that just
> ran to completion, *including* the effects of any event trigger fired
> recursively or not.

Well, that could result in some DROP events being reported more than
once, which I assume would be undesirable for someone hoping to use
this for replication.

(Eventually, we'll have to face the same problem for CREATE events, too.)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-02-06 14:40:37 Re: palloc unification
Previous Message Alvaro Herrera 2013-02-06 14:38:35 Re: palloc unification