Re: Command Triggers, patch v11

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thom Brown <thom(at)linux(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Subject: Re: Command Triggers, patch v11
Date: 2012-02-27 23:32:26
Message-ID: 201202280032.27171.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday, February 27, 2012 08:37:24 PM Andres Freund wrote:
> On Monday, February 27, 2012 08:30:31 PM Thom Brown wrote:
> > On 27 February 2012 19:19, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
wrote:
> > > Thom Brown <thom(at)linux(dot)com> writes:
> > >> test=# CREATE TABLE badname AS SELECT 1::int id, 1::int a, ''::text b;
> > >> SELECT 1
> > >>
> > >> This doesn't even get picked up by ANY COMMAND.
> > >
> > > You won't believe it: CTAS is not implemented as a DDL. Andres did
> > > some work about that and sent a patch that received positive reviews by
> > > both Tom and Robert, once that's in I can easily add support for the
> > > command.
>
> I actually don't think anybody actually reviewed the patch so far. Tom and
> I discussed the implementation strategy beforehand a bit though.
>
> > > Thanks Andres :)
>
> Youre welcome. Thanks for your awesome work that actually made it necessary
> ;)
>
> > I don't see it anywhere in the commitfest. Has it been properly
> > submitted?
>
> I actually always viewed it as a part of the Dim's patch which is why I
> didn't submit it as a separate patch. Maybe that was a mistake...
>
> http://archives.postgresql.org/message-
> id/201112112346(dot)07611(dot)andres(at)anarazel(dot)de contains the latest revision.
>
I refreshed the patch so it works again on current HEAD. Basically some
trivial fixes and dfd26f9c5f371437f243249025863ea9911aacaa. The latter doesn't
seem necessary to me after the changes, so I simply ditched it. Am I missing
something?

I noticed no new things I dislike about the patch besides what I voiced last
time round:
> I attached the - from my side - final version of the patch. I dislike two
> things about it:
> * code duplication due to error handling. Before making the error message
> for various illegal SELECT INTOs the patch actually shrank the code size...
> If anybody has a good idea to avoid duplicating that loop around SelectStmt-
ops I would be happy.
> * new executor flags to define whether oids should be returned

It would be great if somebody could take a look.

Andres

Attachment Content-Type Size
0001-Transform-CREATE-TABLE-AS-SELECT-INTO-into-a-utility.patch text/x-patch 76.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Browne 2012-02-27 23:40:02 Re: Trigger execution role (was: Triggers with DO functionality)
Previous Message Tom Lane 2012-02-27 23:30:36 Re: Command Triggers