Re: Command Triggers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Command Triggers
Date
Msg-id 23507.1323016484@sss.pgh.pa.us
Whole thread Raw
In response to Re: Command Triggers  (Andres Freund <andres@anarazel.de>)
Responses Re: Command Triggers  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I have two questions now:

> First, does anybody think it would be worth getting rid of the duplication 
> from OpenIntoRel (formerly from execMain.c) in regard to DefineRelation()?

That's probably reasonable to do, since as you say it would remove the
opportunity for bugs-of-omission in the CTAS table creation step.
OTOH, if you find yourself having to make any significant changes to
DefineRelation, then maybe not.

> Secondly, I am currently wondering whether it would be a good idea to use the 
> ModifyTable infrastructure for doing the insertion instead an own DestReceiver 
> infrastructure thats only used for CTAS.

I think this is probably a bad idea; it will complicate matters and buy
little.  There's not a lot of stuff needed for the actual data insertion
step, since we know the table can't have any defaults, constraints,
triggers, etc as yet.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [DOCS] Moving tablespaces
Next
From: Tom Lane
Date:
Subject: Re: [DOCS] Moving tablespaces