Re: sql_drop Event Trigger

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sql_drop Event Trigger
Date: 2013-02-06 16:04:24
Message-ID: 6149.1360166664@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr> writes:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
>> I thought there was the idea that the list of objects to drop was to be
>> acquired before actually doing the deletion; so that the trigger
>> function could, for instance, get the name of the table being dropped.

> Tom and Robert have been rightfully insisting on how delicate it has
> been to come up with the right behavior for performMultipleDeletions,
> and that's not something we can easily reorganise.

> So the only way to get at the information seems to be what Robert
> insisted that I do, that is storing the information about the objects
> being dropped for later processing.

I might be forgetting something, but doesn't dependency.c work by first
constructing a list of all the objects it's going to drop, and only then
dropping them? Could we inject a "pre deletion" event trigger call at
the point where the list is completed?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2013-02-06 16:11:13 Re: [PATCH] pg_isready (was: [WIP] pg_ping utility)
Previous Message Pavel Stehule 2013-02-06 15:59:55 Re: PATCH: Split stats file per database WAS: autovacuum stress-testing our system