CLOSE command tag

Started by Neil Conwayover 22 years ago5 messages
#1Neil Conway
neilc@samurai.com

Is there a reason for this behavior?

nconway=# begin;
BEGIN
nconway=# declare foo cursor for select 1;
DECLARE CURSOR
nconway=# close foo;
CLOSE CURSOR
nconway=# close cursor foo;
ERROR: parser: parse error at or near "foo" at character 14

(i.e. the CLOSE command tag is "CLOSE CURSOR", which doesn't even appear
to be a command)

Cheers,

Neil

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#1)
Re: CLOSE command tag

Neil Conway <neilc@samurai.com> writes:

(i.e. the CLOSE command tag is "CLOSE CURSOR", which doesn't even appear
to be a command)

Seems bogus to me too --- it should just say CLOSE. I suppose someone
made it that way by analogy with DECLARE CURSOR, but I don't think the
command tag should include keywords that don't actually appear in the
statement ...

regards, tom lane

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Neil Conway (#1)
Re: CLOSE command tag

Neil Conway writes:

(i.e. the CLOSE command tag is "CLOSE CURSOR", which doesn't even appear
to be a command)

The command tags are aligned with the SQL standard (see under <get
diagnostics statement>), which doesn't appear to make much sense in this
case, but it doesn't hurt anyone.

--
Peter Eisentraut peter_e@gmx.net

#4Neil Conway
neilc@samurai.com
In reply to: Peter Eisentraut (#3)
Re: CLOSE command tag

On Tue, 2003-04-22 at 09:11, Peter Eisentraut wrote:

The command tags are aligned with the SQL standard (see under <get
diagnostics statement>), which doesn't appear to make much sense in this
case, but it doesn't hurt anyone.

Fair enough.

If we're going to SQL-compliant here, there are a couple other command
tags that should be corrected: COMMIT -> COMMIT WORK, ROLLBACK ->
ROLLBACK WORK, UPDATE -> UPDATE WHERE, DELETE -> DELETE WHERE, etc.

Cheers,

Neil

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Neil Conway (#4)
Re: CLOSE command tag

Neil Conway writes:

If we're going to SQL-compliant here, there are a couple other command
tags that should be corrected: COMMIT -> COMMIT WORK, ROLLBACK ->
ROLLBACK WORK, UPDATE -> UPDATE WHERE, DELETE -> DELETE WHERE, etc.

We decided not to do these particular ones, mostly for compatibility
reasons. See past discussions.

--
Peter Eisentraut peter_e@gmx.net