pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Thom Brown <thom@linux.com>
Cc: Dimitri Fontaine <dimitri@2ndquadrant.fr>
Subject: Re: Command Triggers, patch v11
Date: Mon, 19 Mar 2012 14:10:03 -0400
Message-ID: <13258.1332180603@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZKTfj3EMKow42mwt3zbfPN-V-bOJsExJ3avnezEceQkg@mail.gmail.com>
References: <m24nufq466.fsf@2ndQuadrant.fr>
	<201203162237.38813.andres@anarazel.de>
	<21818.1331934775@sss.pgh.pa.us>
	<201203162317.43818.andres@anarazel.de>
	<7094.1331996567@sss.pgh.pa.us>
	<9503.1332006327@sss.pgh.pa.us>
	<24814.1332021870@sss.pgh.pa.us>
	<1332107267.6915.2.camel@vanquo.pezone.net>
	<24506.1332119786@sss.pgh.pa.us>
	<1332176001.8435.1.camel@vanquo.pezone.net>
	<CA+TgmoZKTfj3EMKow42mwt3zbfPN-V-bOJsExJ3avnezEceQkg@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Mar 19, 2012 at 12:53 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
>> Doesn't seem worth it to me.  At least, "SELECT nnnn" makes some sense:
>> nnnn rows were selected.  "CREATE TABLE nnnn" means what?  nnnn tables
>> were created?
>> 
>> What might make sense is to delegate this additional information to
>> separate fields in a future protocol revision.

> I think that we would not have bothered to add the row count to the
> command tag output for SELECT unless it were useful.  It seems to be
> *more* useful for CTAS than for SELECT; after all, SELECT also returns
> the actual rows.

I think we're all in agreement that we need to keep the rowcount
functionality.  What seems to me to be in some doubt is whether to
continue to present the tag "SELECT nnnn" or to change it to something
like "CREATE TABLE nnnn".  For the moment I've got the patch doing the
former.  It would not be terribly hard to change it, but I'm not going
to break backward compatibility unless there's a pretty clear consensus
to do so.


BTW, I just came across another marginal-loss-of-functionality issue:
in previous versions you could PREPARE a SELECT INTO, but now you get

regression=# prepare foo as select * into bar from int8_tbl;
ERROR:  utility statements cannot be prepared

Is anybody excited about that?  If it is something we have to keep,
it seems like pretty nearly a deal-breaker for this patch, because
storing a CreateTableAsStmt containing an already-prepared plan would
complicate matters unreasonably.  You can still get approximately
the same result with

	prepare foo as select * from int8_tbl;
	create table bar as execute foo;

which if anything is more useful since you didn't nail down the target
table name in the PREPARE, but nonetheless it's different.

			regards, tom lane



view thread (115+ messages)  latest in thread

Message-ID: <13258.1332180603@sss.pgh.pa.us>
Permalink:  ../13258.1332180603@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13258.1332180603@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, peter_e@gmx.net, andres@anarazel.de, thom@linux.com, dimitri@2ndquadrant.fr
  Subject: Re: Command Triggers, patch v11
  In-Reply-To: <13258.1332180603@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox