Re: [PATCH] Return command tag 'REPLACE X' for CREATE OR REPLACE statements.

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Return command tag 'REPLACE X' for CREATE OR REPLACE statements.
Date: 2011-01-14 20:45:06
Message-ID: AANLkTiniPmh+_d72Wdby7nRyF5oq9nYJodk+4gzYPcnt@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for reviewing!

On Fri, Jan 14, 2011 at 13:40, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Did you check whether this updated the code for 100% of the object
> types where this could apply?

I walked through all the CREATE statements in the documentation and
these four seem to be the only ones that accept FOR REPLACE.

There's a similar case with CREATE TABLE IF NOT EXISTS, maybe this is
worth covering in an updated patch too?
And if I change that, people might expect the same from DROP X IF EXISTS too?

> Also, I don't really like the way this spreads knowledge of the
> completionTag out all over the backend.  I think it would be better to
> follow the existing model used by the COPY and COMMIT commands,
> whereby the return value indicates what happened and
> standard_ProcessUtility() uses that to set the command tag.

Right. I created this pattern after PerformPortalFetch() which already
took a completionTag argument. But your approach seems more
reasonable.

Regards,
Marti

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-01-14 20:46:15 Re: LOCK for non-tables
Previous Message Robert Haas 2011-01-14 20:43:36 Re: Database file copy