From 8d28abd4f69064317b8733c74de3284c3fbc85ad Mon Sep 17 00:00:00 2001 From: pgaddict Date: Mon, 1 Jan 2024 13:14:12 +0800 Subject: [PATCH v2 2/2] minor refactor based on v1-0001 doc: place function pg_basetype under "System Catalog Information Function" section. Other miscellaneous changes, make pg_basetype functions looks like similar to pg_typeof. --- doc/src/sgml/func.sgml | 50 ++++++++++++++++----------------- src/backend/utils/adt/misc.c | 2 +- src/include/catalog/pg_proc.dat | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 7b14c87c..8f66de3b 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -24698,31 +24698,6 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute'); - - - - pg_basetype - - pg_basetype ( type oid ) - regtype - - - Returns the OID of the base type of a domain or if the argument is a basetype it returns the same type. - If there's a chain of domain dependencies, it will recurse until finding the base type. - - - For example: - -CREATE DOMAIN mytext as text; - -SELECT pg_basetype('mytext'::regtype); - pg_typeof ------------ - text - - - - @@ -25021,6 +24996,31 @@ SELECT pg_type_is_visible('myschema.widget'::regtype); + + + + pg_basetype + + pg_basetype ( "any" ) + regtype + + + Returns the OID of the base type of a domain or if the argument is a basetype it returns the same type. + If there's a chain of domain dependencies, it will recurse until finding the base type. + + + For example: + +CREATE DOMAIN mytext as text; + +SELECT pg_basetype('mytext'::regtype); + pg_basetype +----------- + text + + + + diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c index c0c3c9e9..692621c2 100644 --- a/src/backend/utils/adt/misc.c +++ b/src/backend/utils/adt/misc.c @@ -43,9 +43,9 @@ #include "tcop/tcopprot.h" #include "utils/builtins.h" #include "utils/fmgroids.h" -#include "utils/syscache.h" #include "utils/lsyscache.h" #include "utils/ruleutils.h" +#include "utils/syscache.h" #include "utils/timestamp.h" diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index f84f106b..db037455 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -3879,7 +3879,7 @@ prorettype => 'regtype', proargtypes => 'any', prosrc => 'pg_typeof' }, { oid => '6312', descr => 'get the base type of a domain', proname => 'pg_basetype', proisstrict => 'f', provolatile => 's', - prorettype => 'regtype', proargtypes => 'oid', prosrc => 'pg_basetype' }, + prorettype => 'regtype', proargtypes => 'any', prosrc => 'pg_basetype' }, { oid => '3162', descr => 'collation of the argument; implementation of the COLLATION FOR expression', proname => 'pg_collation_for', proisstrict => 'f', provolatile => 's', -- 2.34.1