Re: execute command tag including affected rows count

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Kris Jurka <books(at)ejurka(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: execute command tag including affected rows count
Date: 2004-03-21 23:05:54
Message-ID: 7917.1079910354@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> writes:
> On 21-Mar-04, at 11:39 AM, Kris Jurka wrote:
>> Would it be possible to have the command completion tag for EXECUTE
>> return
>> the affected row count?

> Yes, this has been suggested before -- for example:

> http://www.mail-archive.com/pgsql-hackers(at)postgresql(dot)org/msg26787.html

> I agree it would be a good idea, although I can't recall what the
> conclusion of the previous discussions was -- did anyone raise any
> critical objections to this?

The previous discussion concluded that EXECUTE should return the command
tag of the executed command --- eg, "UPDATE n" not "EXECUTE n". Without
this, you cannot for example sensibly cope with both the INSERT and
UPDATE tag formats.

Not sure what it takes internally to the backend to make this happen
... but IIRC there already is provision for utility commands to override
their default tag, so I hope that it would be a pretty localized change.

However, does this really solve Kris' problem? JDBC generally likes to
think that it works with old Postgres versions; will a fix that only
works in >= 7.5 be good enough for them?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-21 23:12:41 Re: pg_autovacuum next steps
Previous Message Tom Lane 2004-03-21 22:53:06 Re: [HACKERS] listening addresses