Thread: CLOSE command tag

CLOSE command tag

From
Neil Conway
Date:
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



Re: CLOSE command tag

From
Tom Lane
Date:
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



Re: CLOSE command tag

From
Peter Eisentraut
Date:
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



Re: CLOSE command tag

From
Neil Conway
Date:
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



Re: CLOSE command tag

From
Peter Eisentraut
Date:
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