Re: Command Triggers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org, Greg Smith <greg(at)2ndquadrant(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: Command Triggers
Date: 2012-01-18 19:31:49
Message-ID: 27084.1326915109@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:
> We can easily enough copy the parse tree and do another round of parse
> analysis on it only when some command triggers are going to get called.
> Is the cost of doing so acceptable?

It's not the costs I'm worried about so much as the side effects ---
locks and so forth. Also, things like assignment of specific names
for indexes and sequences seem rather problematic. In the worst case
the trigger could run seeing "foo_bar_idx1" as the name of an index
to be created, and then when the action actually happens, the name
turns out to be "foo_bar_idx2" because someone else took the first name
meanwhile.

As I said, I think this suggests that you're trying to do the triggers
in the wrong place.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2012-01-18 19:38:12 Re: Setting -Werror in CFLAGS
Previous Message Peter Eisentraut 2012-01-18 19:30:47 Re: Setting -Werror in CFLAGS