PostgreSQL current_schemas() 函数
PostgreSQL current_schemas() 函数按照优先级顺序返回当前有效搜索路径上的所有的架构名称。
current_schemas() 语法
这里是 PostgreSQL current_schemas() 函数的语法:
sql
current_schemas(include_implicit boolean) -> name[]参数
include_implicit是否包含隐式的系统模式。布尔类型。
如果
include_implicit是FALSE,则返回当前搜索路径中定义的所有存在且可搜索的模式。如果
include_implicit是TRUE,则返回的列表包括隐式搜索的系统模式,例如pg_catalog.
返回值
PostgreSQL current_schemas() 函数返回一个数组,它包含当前有效搜索路径上的所有的架构名称,按照优先级顺序。
current_schemas() 示例
要获取有效路径上的所有的模式(不含隐式模式),请使用下面带有 current_schemas() 函数的 SELECT 语句:
sql
SELECT current_schemas(false);bash
current_schemas
-----------------
{public}要获取有效路径上的所有的模式(包含隐式模式),请使用以下语句:
sql
SELECT current_schemas(true);bash
current_schemas
---------------------
{pg_catalog,public}这里, pg_catalog 是一个隐式的系统模式。
