public inbox for [email protected]  
help / color / mirror / Atom feed
Incorrect Syntax in Function Syntax diagram
5+ messages / 3 participants
[nested] [flat]

* Incorrect Syntax in Function Syntax diagram
@ 2021-06-23 10:18 PG Doc comments form <[email protected]>
  2021-06-23 15:16 ` Re: Incorrect Syntax in Function Syntax diagram David G. Johnston <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: PG Doc comments form @ 2021-06-23 10:18 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/sql-createfunction.html
Description:

| IMMUTABLE | STABLE | VOLATILE | [ NOT ] LEAKPROOF

[ NOT ] LEAKPROOF  is accepting separately ,
So why you written [ NOT ] LEAKPROOF with | IMMUTABLE | STABLE | VOLATILE | 


Please separate the [ NOT ] LEAKPROOF from the OR list


Note: Your documentation must be correct


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Incorrect Syntax in Function Syntax diagram
  2021-06-23 10:18 Incorrect Syntax in Function Syntax diagram PG Doc comments form <[email protected]>
@ 2021-06-23 15:16 ` David G. Johnston <[email protected]>
  2021-06-23 15:29   ` Re: Incorrect Syntax in Function Syntax diagram Tom Lane <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2021-06-23 15:16 UTC (permalink / raw)
  To: [email protected]; Pg Docs <[email protected]>

On Wed, Jun 23, 2021 at 6:31 AM PG Doc comments form <[email protected]>
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/13/sql-createfunction.html
> Description:
>
> | IMMUTABLE | STABLE | VOLATILE | [ NOT ] LEAKPROOF
>
> [ NOT ] LEAKPROOF  is accepting separately ,
> So why you written [ NOT ] LEAKPROOF with | IMMUTABLE | STABLE | VOLATILE
> |
>
>
The commit message doesn't say - but I can see how from a technical
perspective that the claim that something is immutable is considered
similar to a claim that something has no side effects, thus there is a
connection.  As noted below, the fact that the first three are mutually
exclusive while leakproof is not is convincing enough a reason to list
leakproof separately.

Please separate the [ NOT ] LEAKPROOF from the OR list
>

I would agree, and would add that I wonder whether the syntax for the three
mutually exclusive options should be shown as such instead of having to
read that in the description notes.  Does writing < | { IMMUTABLE | STABLE
| VOLATILE } > work?

Note: Your documentation must be correct
>

Is that so? It is a good thing then that it is presently correct and that
this is just a readability suggestion.  The presence of them all on the
same line does not by itself imply any kind of relationship in the actual
grammar.

David J.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Incorrect Syntax in Function Syntax diagram
  2021-06-23 10:18 Incorrect Syntax in Function Syntax diagram PG Doc comments form <[email protected]>
  2021-06-23 15:16 ` Re: Incorrect Syntax in Function Syntax diagram David G. Johnston <[email protected]>
@ 2021-06-23 15:29   ` Tom Lane <[email protected]>
  2021-06-23 15:41     ` Re: Incorrect Syntax in Function Syntax diagram David G. Johnston <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2021-06-23 15:29 UTC (permalink / raw)
  To: David G. Johnston <[email protected]>; +Cc: [email protected]; Pg Docs <[email protected]>

"David G. Johnston" <[email protected]> writes:
> On Wed, Jun 23, 2021 at 6:31 AM PG Doc comments form <[email protected]>
> wrote:
> Please separate the [ NOT ] LEAKPROOF from the OR list

> I would agree, and would add that I wonder whether the syntax for the three
> mutually exclusive options should be shown as such instead of having to
> read that in the description notes.  Does writing < | { IMMUTABLE | STABLE
> | VOLATILE } > work?

Yeah.  The way it's written fails to show, except via formatting,
that IMMUTABLE/STABLE/VOLATILE are mutually exclusive; and then
somebody came along and destroyed the formatting.  I agree both
with adding braces and with putting LEAKPROOF on its own line.
The latter is/should be only cosmetic; but the rest of the list
has one line per independent option, and LEAKPROOF is surely
independent of the volatility options.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Incorrect Syntax in Function Syntax diagram
  2021-06-23 10:18 Incorrect Syntax in Function Syntax diagram PG Doc comments form <[email protected]>
  2021-06-23 15:16 ` Re: Incorrect Syntax in Function Syntax diagram David G. Johnston <[email protected]>
  2021-06-23 15:29   ` Re: Incorrect Syntax in Function Syntax diagram Tom Lane <[email protected]>
@ 2021-06-23 15:41     ` David G. Johnston <[email protected]>
  2021-06-23 16:07       ` Re: Incorrect Syntax in Function Syntax diagram Tom Lane <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2021-06-23 15:41 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: [email protected]; Pg Docs <[email protected]>

On Wed, Jun 23, 2021 at 8:29 AM Tom Lane <[email protected]> wrote:

> Yeah.  The way it's written fails to show, except via formatting,
> that IMMUTABLE/STABLE/VOLATILE are mutually exclusive;
>

It seems the STRICT -ness line needs brackets too then.

Also, back to volatility, volatile is the default option though due to
alphabetical order it is shown last with no indication it is the default.
Do we have an existing convention in the syntax section to indicate
defaults, either with emphasis, placement, or even an annotation like "*"?

David J.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Incorrect Syntax in Function Syntax diagram
  2021-06-23 10:18 Incorrect Syntax in Function Syntax diagram PG Doc comments form <[email protected]>
  2021-06-23 15:16 ` Re: Incorrect Syntax in Function Syntax diagram David G. Johnston <[email protected]>
  2021-06-23 15:29   ` Re: Incorrect Syntax in Function Syntax diagram Tom Lane <[email protected]>
  2021-06-23 15:41     ` Re: Incorrect Syntax in Function Syntax diagram David G. Johnston <[email protected]>
@ 2021-06-23 16:07       ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2021-06-23 16:07 UTC (permalink / raw)
  To: David G. Johnston <[email protected]>; +Cc: [email protected]; Pg Docs <[email protected]>

"David G. Johnston" <[email protected]> writes:
> Do we have an existing convention in the syntax section to indicate
> defaults, either with emphasis, placement, or even an annotation like "*"?

No.  The syntax diagrams verge on unreadability already, so I'm
unconvinced that trying to overload them with this issue would be
wise.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2021-06-23 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 10:18 Incorrect Syntax in Function Syntax diagram PG Doc comments form <[email protected]>
2021-06-23 15:16 ` David G. Johnston <[email protected]>
2021-06-23 15:29   ` Tom Lane <[email protected]>
2021-06-23 15:41     ` David G. Johnston <[email protected]>
2021-06-23 16:07       ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox