Re: Command Triggers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Command Triggers
Date
Msg-id 20982.1326897974@sss.pgh.pa.us
Whole thread Raw
In response to Re: Command Triggers  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: Command Triggers  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
Dimitri Fontaine <dimitri@2ndQuadrant.fr> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> It doesn't, and it shouldn't have to.  If those nodes get to the
>> rewriter then somebody forgot to apply parse analysis.  What's your test
>> case?

> I'm trying to rewrite the command string from the parse tree, and the
> simple example that I use to raise an ERROR is the following:

>   create table foo (id serial, foo integer default 1, primary key(id));

That needs to go through transformCreateStmt().  The comments at the
head of parse_utilcmd.c might be informative.

While I've not looked at your patch, I can't escape the suspicion that
this means you are trying to do the wrong things in the wrong places.
Calling transformCreateStmt() from some random place is not going to
make things better; it is going to break CREATE TABLE, which expects to
do that for itself.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jim Mlodgenski
Date:
Subject: Re: Client Messages
Next
From: Jaime Casanova
Date:
Subject: Re: Measuring relation free space