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


22 Apr 2003 01:18:45 -0400
Neil Conway <neilc@samurai.com>
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


Tue, 22 Apr 2003 01:46:30 -0400
Tom Lane <tgl@sss.pgh.pa.us>
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


Tue, 22 Apr 2003 15:11:16 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
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


22 Apr 2003 21:30:24 -0400
Neil Conway <neilc@samurai.com>
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


Wed, 23 Apr 2003 19:56:52 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: CLOSE command tag