FETCH statement again

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: FETCH statement again
Date: 2000-01-13 14:39:16
Message-ID: 20000113153916.B1071@fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I just got a reply from the original author of the patch I was talking
about:

----- Forwarded message from Rene Hogendoorn <hogend(at)nlr(dot)nl> -----

From: Rene Hogendoorn <hogend(at)nlr(dot)nl>
Date: Thu, 13 Jan 2000 14:23:08 +0100 (MET)
To: Michael Meskes <michael(at)fam-meskes(dot)de>
Subject: Re: ECPG patches

TL> Michael Meskes <meskes(at)postgreSQL(dot)org> writes:
>> <fetch statement> ::= FETCH [ [ <fetch orientation> ] FROM ]
>> <cursor name> INTO <fetch target list>

>> To me this seems to say that FROM is just optional. Okay, if I
>> make it optional in our parser?

TL> Careful --- notice that FROM is only optional if you *also*
TL> omit all the preceding optional clauses. Otherwise there will
TL> be a reduce conflict that you could only resolve by removing
TL> all of FETCH's secondary keywords from the ColId list. I
TL> don't think that would be an acceptable tradeoff.

The reduce conflict is caused by the /* EMPTY */ alternatives of
'opt_direction', 'fetch_how_many' and 'opt_portal_name'. Considering
the sql92 syntax, 'opt_portalname' is wrong; the portalname is not
optional, but required. Requiring a portalname also solves the problem
of 'EXEC SQL FETCH; being a valid statement.
Furthermore, at least INFORMIX supports 'FETCH NEXT t1;'. So, I strongly
suggest to NOT require 'FROM'.
...
Regards
Rene
--

R. A. Hogendoorn E-mail: hogend(at)nlr(dot)nl
Information and Communication Technology Division Tel. +31-527-24-8367
National Aerospace Laboratory, The Netherlands Fax. +31-527-24-8210

----- End forwarded message -----

Michael
--
Michael Meskes | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!
Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!
Email: Michael(at)Fam-Meskes(dot)De | Use PostgreSQL!

Browse pgsql-hackers by date

  From Date Subject
Next Message Don Baccus 2000-01-13 14:55:14 Re: [HACKERS] Re: Informix and OUTER join syntax
Previous Message Peter Mount 2000-01-13 14:34:05 RE: [HACKERS] [HACK]-[INTERFACE] jdbc/postgresql.jar execution er rors