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