↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / Uuid Functions

uuid_extract_version

Read the PG 18 manual

Extracts the version from a UUID of one of the variants described by RFC 9562.

Reading PG 18current·documented in 4 of 27 versions, 17 to 20

Signatures & examples

uuid_extract_version ( uuid ) → smallint
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.
uuid_extract_version('41db1265-8bc1-4ab3-992f-​885799a4af1d'::uuid) → 4
uuid_extract_version('019535d9-3df7-79fb-b466-​fa907fa17f9e'::uuid) → 7
Version history 2
  1. 17 → 18 changed
  2. 16 → 17 added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source