pg_identify_object()

返回用于标识指定对象的数据的函数

pg_identify_object() 是一个系统函数,它返回用于唯一标识指定对象的机器可读数据。

pg_identify_object()PostgreSQL 9.3 中添加。

用法

pg_identify_object ( classid oid, objid oid, objsubid integer )
        → record ( type text, schema text, name text, identity text )

变更历史

示例

pg_identify_object() 的基本用法示例

postgres=# CREATE FUNCTION bar (int) RETURNS int LANGUAGE SQL AS 'SELECT 1';
CREATE FUNCTION

postgres=# SELECT * FROM pg_get_object_address('function', '{bar}', '{int}');
 classid | objid | objsubid 
---------+-------+----------
    1255 | 16511 |        0
(1 row)

postgres=# SELECT * FROM pg_identify_object ( 1255,  16511, 0);
   type   | schema | name |      identity       
----------+--------+------+---------------------
 function | public |      | public.bar(integer)
(1 row)

通过 pg_get_object_address() 生成标识

postgres=# SELECT (pg_identify_object(addr.classid, addr.objid, addr.objsubid)).*
             FROM pg_get_object_address('table', '{foo}','{}') addr;
 type  | schema | name |  identity  
-------+--------+------+------------
 table | public | foo  | public.foo
(1 row)

postgres=# SELECT (pg_identify_object(addr.classid, addr.objid, addr.objsubid)).*
             FROM pg_get_object_address('table column', '{foo,id}','{}') addr;
     type     | schema | name |   identity    
--------------+--------+------+---------------
 table column | public | foo  | public.foo.id
(1 row)

分类

系统目录, 系统函数

另请参阅

pg_identify_object_as_address(), pg_get_object_address()

反馈

请在此处提交关于“pg_identify_object()”的任何评论、建议或更正。 这里