代码改变世界

PostgreSQL中的pg_relation_filepath()函数

2019-08-12 10:16  abce  阅读(1708)  评论(0编辑  收藏  举报

pg_relation_filepath()类似于pg_relation_filenode(),但它返回关系的整个文件路径名(相对于数据库集群的数据目录PGDATA)。

 

postgres=# select pg_relation_filepath('t1');
 pg_relation_filepath 
----------------------
 base/13211/24654
(1 row)

postgres=# SELECT pg_relation_filepath(oid), relpages FROM pg_class WHERE relname = 't1';
 pg_relation_filepath | relpages 
----------------------+----------
 base/13211/24654     |        0
(1 row)

postgres=#