non-string or non-string

Started by PG Bug reporting formalmost 6 years ago4 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/functions-string.html
Description:

The second line in "Table 9.8. SQL String Functions and Operators" uses
"non-string or non-string" as part of the example. I assume one of these
should be "string".

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: PG Bug reporting form (#1)
Re: non-string or non-string

On 2020-May-17, PG Doc comments form wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/functions-string.html
Description:

The second line in "Table 9.8. SQL String Functions and Operators" uses
"non-string or non-string" as part of the example. I assume one of these
should be "string".

No, it's not the example but the operator description, and what it says
is
"string || non-string or non-string || string"

so it's trying to illustrate that there are two options:

string || non-string
non-string || string

but maybe it's not super-clear about that. This is much clearer in the
docs for Postgres 13, which has been heavily reformatted:
https://www.postgresql.org/docs/devel/functions-string.html

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: non-string or non-string

PG Doc comments form <noreply@postgresql.org> writes:

The second line in "Table 9.8. SQL String Functions and Operators" uses
"non-string or non-string" as part of the example. I assume one of these
should be "string".

It might look that way depending on how wide your browser window is...
but the way it's supposed to be read is

string || non-string
or
non-string || string

The devel version of the docs forces the two cases to be on separate
lines, which hopefully will stem the confusion.

regards, tom lane

#4Bertrand Janin
b@janin.com
In reply to: Alvaro Herrera (#2)
Re: non-string or non-string

No, it's not the example but the operator description, and what it says
is
"string || non-string or non-string || string"

so it's trying to illustrate that there are two options:

string || non-string
non-string || string

I see, that makes a lot more sense.

but maybe it's not super-clear about that. This is much clearer in the
docs for Postgres 13, which has been heavily reformatted:
https://www.postgresql.org/docs/devel/functions-string.html

Oh wow, that's quite the change. I'm going to use the updated docs moving
forward, it confused me at first, after years of visually parsing the previous
format, but it's clearer once you understand the structure.

Thanks,
Bertrand