Re: small patch - Mailing list pgsql-docs

From Tom Lane
Subject Re: small patch
Date
Msg-id 175281.1633638256@sss.pgh.pa.us
Whole thread Raw
In response to Re: small patch  (rir <rirans@comcast.net>)
List pgsql-docs
rir <rirans@comcast.net> writes:
> On Thu, Oct 07, 2021 at 07:58:47AM +0200, Laurenz Albe wrote:
>> Can you think of a way to modify the syntax diagram so that it
>> expresses that and still remains comprehensible?

> For myself,
>    'FETCH [ <direction> [ FROM | IN ] ] <cursor_name>'
> clearly indicates that 'direction' is optional.

Right, but if we don't say that <direction> can be
empty, then this diagram disallows

    FETCH FROM cursor_name

which in fact is legal.  I think however that we could make it read

    FETCH [ <direction> ] [ FROM | IN ] <cursor_name>'

and have a correct description without requiring <direction>
to be allowed to be empty.

BTW, as it stands, the diagram is ambiguous
because there are two ways to parse

    FETCH cursor_name

... is <direction> present but empty, or omitted altogether?

            regards, tom lane



pgsql-docs by date:

Previous
From: rir
Date:
Subject: Re: small patch
Next
From: Anitha P
Date:
Subject: Fwd: PostgreSQL 12 Authentication type questions