From 507aa16125c50809dfc926e7ee72938053c01a39 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 25 Sep 2025 11:23:27 -0400 Subject: [PATCH] Doc: clean up documentation for new UUID functions. Fix assorted failures to conform to our normal style for function documentation, such as lack of parentheses and incorrect markup. Author: Marcos Pegoraro Co-authored-by: Tom Lane Discussion: https://postgr.es/m/CAB-JLwbocrFjKfGHoKY43pHTf49Ca2O0j3WVebC8z-eQBMPJyw@mail.gmail.com Backpatch-through: 18 --- doc/src/sgml/func/func-uuid.sgml | 75 ++++++++++++++------------------ 1 file changed, 33 insertions(+), 42 deletions(-) diff --git a/doc/src/sgml/func/func-uuid.sgml b/doc/src/sgml/func/func-uuid.sgml index 65c5ddec6b7..2638e2bf855 100644 --- a/doc/src/sgml/func/func-uuid.sgml +++ b/doc/src/sgml/func/func-uuid.sgml @@ -36,8 +36,7 @@ - - + Function @@ -45,24 +44,22 @@ Example(s) - - + - - - gen_random_uuid + + gen_random_uuid ( ) uuid - uuidv4 + uuidv4 ( ) uuid - Generate a version 4 (random) UUID. + Generates a version 4 (random) UUID gen_random_uuid() @@ -71,26 +68,25 @@ uuidv4() b42410ee-132f-42ee-9e4f-09a6485c95b8 - - + - - - uuidv7 + + uuidv7 ( shift interval ) uuid - Generate a version 7 (time-ordered) UUID. The timestamp is computed using UNIX timestamp - with millisecond precision + sub-millisecond timestamp + random. The optional parameter - shift will shift the computed timestamp by the given interval. + Generates a version 7 (time-ordered) UUID. The timestamp is + computed using UNIX timestamp with millisecond precision + + sub-millisecond timestamp + random. The optional + parameter shift will shift the computed + timestamp by the given interval. uuidv7() 019535d9-3df7-79fb-b466-fa907fa17f9e - - + @@ -113,8 +109,7 @@ - - + Function @@ -122,44 +117,41 @@ Example(s) - - + - - - uuid_extract_timestamp + + uuid_extract_timestamp ( uuid ) timestamp with time zone - Extracts a timestamp with time zone from UUID - version 1 and 7. For other versions, this function returns null. Note that - the extracted timestamp is not necessarily exactly equal to the time the - UUID was generated; this depends on the implementation that generated the - UUID. + Extracts a timestamp with time zone from a UUID of + version 1 or 7. For other versions, this function returns null. + Note that the extracted timestamp is not necessarily exactly equal + to the time the UUID was generated; this depends on the + implementation that generated the UUID. uuid_extract_timestamp('019535d9-3df7-79fb-b466-&zwsp;fa907fa17f9e'::uuid) 2025-02-23 21:46:24.503-05 - - + - - - uuid_extract_version + + uuid_extract_version ( uuid ) smallint - Extracts the version from a UUID of the variant described by - RFC 9562. For - other variants, this function returns null. For example, for a UUID - generated by gen_random_uuid, this function will + Extracts the version from a UUID of one of the variants described by + RFC + 9562. For other variants, this function returns null. + For example, for a UUID generated + by gen_random_uuid(), this function will return 4. @@ -169,8 +161,7 @@ uuid_extract_version('019535d9-3df7-79fb-b466-&zwsp;fa907fa17f9e'::uuid) 7 - - + -- 2.47.3