Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sb79S-00E2Km-W3 for pgsql-docs@arkaria.postgresql.org; Mon, 05 Aug 2024 23:30:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sb79R-00FlqW-2R for pgsql-docs@arkaria.postgresql.org; Mon, 05 Aug 2024 23:30:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sb79Q-00FlqI-Pt for pgsql-docs@lists.postgresql.org; Mon, 05 Aug 2024 23:30:04 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sb79N-003N63-Pb for pgsql-docs@lists.postgresql.org; Mon, 05 Aug 2024 23:30:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 475NTxfZ1230607; Mon, 5 Aug 2024 19:29:59 -0400 From: Tom Lane 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" In-reply-to: <172286815264.915373.10691480560464060561@wrigleys.postgresql.org> References: <172286815264.915373.10691480560464060561@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Mon, 05 Aug 2024 14:29:12 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1230605.1722900599.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 05 Aug 2024 19:29:59 -0400 Message-ID: <1230606.1722900599@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Doc comments form 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: 2001:4f8:3:ba:&zwsp;2e0:81ff:fe22:d1f1/128 2001:4f8:3:ba:&zwsp;2e0:81ff:fe22:d1f1/128 2001:4f8:3:ba:&zwsp;2e0:81ff:fe22:d1f1/128 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