docs: Table 9.46. UUID Extraction Functions

Started by Erik Rijkersabout 1 year ago4 messageshackers
Jump to latest
#1Erik Rijkers
er@xs4all.nl

On
https://www.postgresql.org/docs/18/functions-uuid.html
there is:

Table 9.46. UUID Extraction Functions

which has these examples:

uuid_extract_version('41db1265-8bc1-4ab3-992f-​885799a4af1d'::uuid) → 4
uuid_extract_version('019535d9-3df7-79fb-b466-​fa907fa17f9e'::uuid) → 7

In my hands, copy/pasting from the website page html intto psql these
don't work:

------
testdb=# select
uuid_extract_version('41db1265-8bc1-4ab3-992f-​885799a4af1d'::uuid);
ERROR: invalid input syntax for type uuid:
"41db1265-8bc1-4ab3-992f-​885799a4af1d"
LINE 1: select uuid_extract_version('41db1265-8bc1-4ab3-992f-​885799...
------

Apparently, that's because of the dash characters used: if I re-type
those with simple keyboard-minus chars, the statement works as expected.

If I copy/paste the result values of the previous table (9.45. UUID
Generation Functions) into the uuid_extract_version() function, then the
examples work so there the dash-characters are apparently ok.

Also, the copy/paste from the PDF text works without problem.

This formatting error, if that's what it is, occurs on docs of both 18
and 19devel.

It's not a huge problem but it would be nice to fix the sgml so that it
generates copy/paste runnable examples here.

Thanks,

Erik Rijkers

#2Daniel Gustafsson
daniel@yesql.se
In reply to: Erik Rijkers (#1)
Re: docs: Table 9.46. UUID Extraction Functions

On 4 Sep 2025, at 11:54, Erik Rijkers <er@xs4all.nl> wrote:

In my hands, copy/pasting from the website page html intto psql these don't work:

------
testdb=# select uuid_extract_version('41db1265-8bc1-4ab3-992f-​885799a4af1d'::uuid);
ERROR: invalid input syntax for type uuid: "41db1265-8bc1-4ab3-992f-​885799a4af1d"
LINE 1: select uuid_extract_version('41db1265-8bc1-4ab3-992f-​885799...
------

Apparently, that's because of the dash characters used: if I re-type those with simple keyboard-minus chars, the statement works as expected.

I believe it is because there is a &zwsp; encoded before the last group, which
was added in a6524105d20b in order to aid line breaking.

If I copy/paste the result values of the previous table (9.45. UUID Generation Functions) into the uuid_extract_version() function, then the examples work so there the dash-characters are apparently ok.

There is no zero-width-space character there since those lines aren't long
enough to cause line breaks.

It's not a huge problem but it would be nice to fix the sgml so that it generates copy/paste runnable examples here.

Agreed, it would be a nice to have, but not a showstopper.

--
Daniel Gustafsson

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Gustafsson (#2)
Re: docs: Table 9.46. UUID Extraction Functions

[ blast-from-the-past dept ]

Daniel Gustafsson <daniel@yesql.se> writes:

On 4 Sep 2025, at 11:54, Erik Rijkers <er@xs4all.nl> wrote:
In my hands, copy/pasting from the website page html intto psql these don't work:

I believe it is because there is a &zwsp; encoded before the last group, which
was added in a6524105d20b in order to aid line breaking.

It's not a huge problem but it would be nice to fix the sgml so that it generates copy/paste runnable examples here.

Agreed, it would be a nice to have, but not a showstopper.

This was complained of again, and we found a reasonable compromise:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=91f75212bbff4151d3dc391927721a2431e56973

regards, tom lane

#4Daniel Gustafsson
daniel@yesql.se
In reply to: Tom Lane (#3)
Re: docs: Table 9.46. UUID Extraction Functions

On 10 Oct 2026, at 03:19, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Daniel Gustafsson <daniel@yesql.se> writes:

Agreed, it would be a nice to have, but not a showstopper.

This was complained of again, and we found a reasonable compromise:

Nice! Thanks for taking care of it.

--
Daniel Gustafsson