Re: sql_drop Event Triggerg

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sql_drop Event Triggerg
Date: 2013-03-08 14:18:16
Message-ID: 20130308141816.GA5352@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas escribió:
> On Tue, Mar 5, 2013 at 12:45 PM, Alvaro Herrera
> <alvherre(at)2ndquadrant(dot)com> wrote:
> > Hmm, maybe I should be considering a pair of macros instead --
> > UTILITY_START_DROP and UTILITY_END_DROP. I'll give this a try. Other
> > ideas are welcome.
>
> That seems like a possibly promising idea. I do wonder how well any
> of this is going to scale.

I did followup with a patch implementing that; did you see it?

> Presumably people are going to want
> similar things for CREATE and (hardest) ALTER. Seems like
> ProcessUtility() could get pretty messy and confusing. But I don't
> have a better idea, either. :-(

Well, the first thing that we need to settle is the user interface.
Normalized command string don't seem to cut it; requiring users to write
SQL parsers is rather unfriendly IMHO. The current idea of having a
function that returns objects affected by the command seems relatively
sensible. For drops, it seems pretty straighforward so far. For CREATE
it's probably somewhat more involved, but seems doable in principle (but
yes, we're going to have to sprinkle ProcessUtility() with a lot of
UTILITY_START/END_CREATE calls).

Not sure about ALTER; maybe we will need a completely different idea to
attack that.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-03-08 14:20:47 Re: Parameterized paths vs index clauses extracted from OR clauses
Previous Message Bruce Momjian 2013-03-08 14:11:55 Re: Materialized views WIP patch