Re: [HACKERS] FETCH without FROM/IN - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] FETCH without FROM/IN
Date
Msg-id 11241.947725982@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] FETCH without FROM/IN  (Michael Meskes <meskes@postgreSQL.org>)
Responses Re: [HACKERS] FETCH without FROM/IN
List pgsql-hackers
Michael Meskes <meskes@postgreSQL.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?

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

I think, though, that you could make our syntax work likeFETCH [ opt_direction fetch_how_many FROM/IN ] portal_name
without conflicts.  That'd be good since it'd be more like SQL92.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: RE: [HACKERS] TODO list updated
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] TODO list updated