Updated on 2025-05-29 GMT+08:00

Schema Visibility Query Functions

Each function performs the visibility check on one type of database objects. For functions and operators, an object in the search path is visible if there is no object of the same name and parameter data type earlier in the path. For operator classes, both name and associated index access methods are considered.

All these functions require OIDs to identify the objects to be checked. If you want to test an object by name, it is convenient to use the OID alias type (regclass, regtype, regprocedure, regoperator, regconfig, or regdictionary).

For example, a table is said to be visible if the schema where the table is located is in the search path and no table of the same name appears earlier in the search path. This is equivalent to the statement that the table can be referenced by name without explicit schema qualification. To list the names of all visible tables, run the following command:

1
gaussdb=# SELECT relname FROM pg_class WHERE pg_table_is_visible(oid);

pg_collation_is_visible(collation_oid)

Description: Specifies whether the collation is visible in the search path.

Return type: Boolean

pg_conversion_is_visible(conversion_oid)

Description: Specifies whether the conversion is visible in the search path.

Return type: Boolean

pg_function_is_visible(function_oid)

Description: Specifies whether the function is visible in the search path.

Return type: Boolean

pg_opclass_is_visible(opclass_oid)

Description: Specifies whether the operator class is visible in the search path.

Return type: Boolean

pg_operator_is_visible(operator_oid)

Description: Specifies whether the operator is visible in the search path.

Return type: Boolean

pg_opfamily_is_visible(opclass_oid)

Description: Specifies whether the operator family is visible in the search path.

Return type: Boolean

pg_table_is_visible(table_oid)

Description: Specifies whether the table is visible in the search path.

Return type: Boolean

pg_ts_config_is_visible(config_oid)

Description: Specifies whether the text search configuration is visible in the search path.

Return type: Boolean

pg_ts_dict_is_visible(dict_oid)

Description: Specifies whether the text search dictionary is visible in the search path.

Return type: Boolean

pg_ts_parser_is_visible(parser_oid)

Description: Specifies whether the text search parser is visible in the search path.

Return type: Boolean

pg_ts_template_is_visible(template_oid)

Description: Specifies whether the text search template is visible in the search path.

Return type: Boolean

pg_type_is_visible(type_oid)

Description: Specifies whether the type (or domain) is visible in the search path.

Return type: Boolean