{"Entry":{"collection":"func","key":"uuid-extract-version","name":"uuid_extract_version","aliases":[],"metadata":{"changed_in":["18"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"16","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"17"},{"descriptions_changed":true,"doc_overhaul":false,"from":"17","group_changed":null,"signatures":{"added":["uuid_extract_version ( uuid ) → smallint"],"removed":["uuid_extract_version (uuid) → smallint"]},"status":"changed","to":"18"}],"content_hash":"1d1b6b256cc9d0376ad02ebb60a450523c3b0b59779420591b4b9261c6136f6c","first_version":"17","group":"uuid","group_label":"Uuid Functions","groups":["uuid"],"imported_at":"2026-09-14T21:49:48.755323+08:00","last_version":"20","name":"uuid_extract_version","name_key":"uuid_extract_version","position":14002,"present_in":["17","18","19","20"],"signature":"uuid_extract_version ( uuid ) → smallint","signature_count":1,"slug":"uuid-extract-version","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Extracts the version from a UUID of one of the variants described by RFC 9562.","summary_zh":""}},"Definition":{"Collection":"func","Key":"uuid-extract-version","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"uuid-extract-version","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"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.","description_html":"Extracts the version from a UUID of one of the variants described by \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc9562\"\u003eRFC 9562\u003c/a\u003e. For other variants, this function returns null. For example, for a UUID generated by \u003ccode class=\"function\"\u003egen_random_uuid()\u003c/code\u003e, this function will return 4.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNC_UUID_EXTRACT_TABLE","file":"functions-uuid.html","slug":"18"},"group":"uuid","group_label":"Uuid Functions","lang":"en","layout":"table-new","pages":["functions-uuid.html"],"prose_only":false,"signatures":[{"description":"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.","description_html":"Extracts the version from a UUID of one of the variants described by \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc9562\"\u003eRFC 9562\u003c/a\u003e. For other variants, this function returns null. For example, for a UUID generated by \u003ccode class=\"function\"\u003egen_random_uuid()\u003c/code\u003e, this function will return 4.","description_zh":"","description_zh_html":"","examples":[{"expr":"uuid_extract_version('41db1265-8bc1-4ab3-992f-​885799a4af1d'::uuid)","result":"4"},{"expr":"uuid_extract_version('019535d9-3df7-79fb-b466-​fa907fa17f9e'::uuid)","result":"7"}],"html":"\u003ccode class=\"function\"\u003euuid_extract_version\u003c/code\u003e ( \u003ccode class=\"type\"\u003euuid\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003esmallint\u003c/code\u003e","returns":"smallint","text":"uuid_extract_version ( uuid ) → smallint","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNC_UUID_EXTRACT_TABLE","file":"functions-uuid.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"uuid-extract-version","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"uuid_extract_version","Summary":"从符合 RFC 9562 所描述某一变体的 UUID 中提取版本号。对于其他变体，该函数返回 null。例如，对于由gen_random_uuid()生成的 UUID，该函数将返回 4。","BodyHTML":"从符合 \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc9562\" rel=\"nofollow\"\u003eRFC 9562\u003c/a\u003e 所描述某一变体的 UUID 中提取版本号。对于其他变体，该函数返回 null。例如，对于由\u003ccode\u003egen_random_uuid()\u003c/code\u003e生成的 UUID，该函数将返回 4。\u003cpre\u003euuid_extract_version ( uuid ) → smallint\u003c/pre\u003e从符合 \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc9562\" rel=\"nofollow\"\u003eRFC 9562\u003c/a\u003e 所描述某一变体的 UUID 中提取版本号。对于其他变体，该函数返回 null。例如，对于由\u003ccode\u003egen_random_uuid()\u003c/code\u003e生成的 UUID，该函数将返回 4。","SourceRevision":"ca936764","ContentHash":"ab439e99a7878fb22173c551f95b601dd81651cb99e9886394c5e1a7cc8af476","Payload":{"description_zh":"从符合 RFC 9562 所描述某一变体的 UUID 中提取版本号。对于其他变体，该函数返回 null。例如，对于由gen_random_uuid()生成的 UUID，该函数将返回 4。","description_zh_html":"从符合 \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc9562\"\u003eRFC 9562\u003c/a\u003e 所描述某一变体的 UUID 中提取版本号。对于其他变体，该函数返回 null。例如，对于由\u003ccode class=\"function\"\u003egen_random_uuid()\u003c/code\u003e生成的 UUID，该函数将返回 4。","signatures":[{"description_zh":"从符合 RFC 9562 所描述某一变体的 UUID 中提取版本号。对于其他变体，该函数返回 null。例如，对于由gen_random_uuid()生成的 UUID，该函数将返回 4。","description_zh_html":"从符合 \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc9562\"\u003eRFC 9562\u003c/a\u003e 所描述某一变体的 UUID 中提取版本号。对于其他变体，该函数返回 null。例如，对于由\u003ccode class=\"function\"\u003egen_random_uuid()\u003c/code\u003e生成的 UUID，该函数将返回 4。","returns":"smallint","text":"uuid_extract_version ( uuid ) → smallint","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"4a9bec020107dbd888f8f3c6e43a5ab03956333c6ee9980cdce31bdb7915f3f6","Text":"uuid_extract_version ( uuid ) → smallint","Returns":"smallint","Payload":{"description":"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.","description_html":"Extracts the version from a UUID of one of the variants described by \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc9562\"\u003eRFC 9562\u003c/a\u003e. For other variants, this function returns null. For example, for a UUID generated by \u003ccode class=\"function\"\u003egen_random_uuid()\u003c/code\u003e, this function will return 4.","description_zh":"","description_zh_html":"","examples":[{"expr":"uuid_extract_version('41db1265-8bc1-4ab3-992f-​885799a4af1d'::uuid)","result":"4"},{"expr":"uuid_extract_version('019535d9-3df7-79fb-b466-​fa907fa17f9e'::uuid)","result":"7"}],"html":"\u003ccode class=\"function\"\u003euuid_extract_version\u003c/code\u003e ( \u003ccode class=\"type\"\u003euuid\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003esmallint\u003c/code\u003e","returns":"smallint","text":"uuid_extract_version ( uuid ) → smallint","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
