pg_my_temp_schema()

一个返回当前会话的临时 schema 的 OID 的函数

pg_my_temp_schema() 是一个系统函数,它返回当前会话的临时 schema 的 OID(如果存在)。

pg_my_temp_schema() 函数在 PostgreSQL 8.2 中被添加。

用法

pg_my_temp_schema () → oid

如果当前会话中不存在临时 schema,则返回 0

变更历史

示例

pg_my_temp_schema() 的基本用法示例

postgres=# SELECT pg_my_temp_schema(); -- no temporary schema exist yet in this session
 pg_my_temp_schema 
-------------------
                 0
(1 row)

postgres=# CREATE TEMPORARY TABLE foo (id INT);
CREATE TABLE

postgres=# SELECT pg_my_temp_schema();
 pg_my_temp_schema 
-------------------
             24608
(1 row)

分类

模式(命名空间), 系统函数

另请参阅

pg_is_other_temp_schema()

反馈

请在此处 提交您对“pg_my_temp_schema()”的任何评论、建议或更正