PostgreSQL pg_is_other_temp_schema() 函数使用指南
PostgreSQL pg_is_other_temp_schema() 函数检查指定的 OID 是否是另一个会话的临时模式(Schema)的 OID。
pg_is_other_temp_schema() 语法
这里是 PostgreSQL pg_is_other_temp_schema() 函数的语法:
pg_is_other_temp_schema(oid) -> oid
参数
oid-
待检查的 OID。
返回值
PostgreSQL pg_is_other_temp_schema() 函数检查指定的 OID 是否是另一个会话的临时模式(Schema)的 OID,并返回 TRUE 或者 FALSE。
pg_is_other_temp_schema() 示例
首先,让我们通过以下语句创建一个临时表:
CREATE TEMPORARY TABLE test (id INT);
SELECT pg_my_temp_schema();
pg_my_temp_schema
-------------------
17380在当前会话中,我们使用 pg_is_other_temp_schema() 检查 OID 17380 是否是其他会话的临时模式(Schema)的 OID:
SELECT pg_is_other_temp_schema(17380);
pg_is_other_temp_schema
-------------------------
f这里, pg_is_other_temp_schema() 函数返回了 f (FALSE)。因为 17380 是当前会话的临时模式(Schema)的 OID,而不是其他会话的临时模式(Schema)的 OID。
让我们重新开启一个会话,在执行 pg_is_other_temp_schema() 函数:
SELECT pg_is_other_temp_schema(17380);
pg_is_other_temp_schema
-------------------------
t