From: Tom Lane <tgl@sss.pgh.pa.us>
To: wombatbuddy@gmail.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: There is an invalid value for cidr type in the "Table 8.22. cidr Type Input Examples"
Date: Mon, 05 Aug 2024 19:29:59 -0400
Message-ID: <1230606.1722900599@sss.pgh.pa.us> (raw)
In-Reply-To: <172286815264.915373.10691480560464060561@wrigleys.postgresql.org>
References: <172286815264.915373.10691480560464060561@wrigleys.postgresql.org>
PG Doc comments form <noreply@postgresql.org> writes:
> On the page:
> https://www.postgresql.org/docs/16/datatype-net-types.html#DATATYPE-CIDR
> in the "Table 8.22. cidr Type Input Examples"
> is invalid value for CIDR notation: 2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128
The value is correct as displayed:
=# select '2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128'::cidr;
cidr
--------------------------------------
2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128
(1 row)
However, if you try to copy-and-paste it from the web page,
you do indeed get a syntax error, or at least I do using Safari.
The reason is that there's a zero-width space hiding in there:
<row>
<entry>2001:4f8:3:ba:&zwsp;2e0:81ff:fe22:d1f1/128</entry>
<entry>2001:4f8:3:ba:&zwsp;2e0:81ff:fe22:d1f1/128</entry>
<entry>2001:4f8:3:ba:&zwsp;2e0:81ff:fe22:d1f1/128</entry>
</row>
and apparently copy-and-paste converts that into something
that cidr_in doesn't like. It doesn't like regular space
there either, so that's not so surprising.
I believe the &zwsp; got put in there to provide a line-break
opportunity and thus remove overwidth-line warnings in the
PDF docs build. There are a fair number of other places where
we do the same thing, although perhaps they are less likely
to be something somebody would try to copy-and-paste.
On the whole I'm inclined to do nothing here; these docs have to
satisfy a number of requirements, and "every example should be
copy-and-pasteable" doesn't seem like a good constraint to add.
Another idea perhaps could be to remove enough digits from the
example that it doesn't cause overwidth warnings in the PDF ---
but I'm not sure that's feasible in a 3-column table. Or we
could just drop this one example.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: tgl@sss.pgh.pa.us, wombatbuddy@gmail.com, pgsql-docs@lists.postgresql.org
Subject: Re: There is an invalid value for cidr type in the "Table 8.22. cidr Type Input Examples"
In-Reply-To: <1230606.1722900599@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox