pg_relation_filepath()

一个用于获取关系文件路径的函数

pg_relation_filepath() 是一个系统函数,用于获取关系(relation)相对于数据目录的文件路径。

pg_relation_filepath() 函数在 PostgreSQL 9.0 中被添加。

用法

pg_relation_filepath ( relation regclass ) → text

如果提供的关系不存在,则会引发一个 ERROR。这也可能意味着该关系在当前搜索路径中不可见。

变更历史

示例

pg_relation_filepath() 的基本用法示例

postgres=# SELECT pg_relation_filepath('foo');
 pg_relation_filepath 
----------------------
 base/13832/16499
(1 row)

尝试查询不存在的关系的文件路径

postgres=# SELECT pg_relation_filepath('bar');
ERROR:  relation "bar" does not exist
LINE 1: SELECT pg_relation_filepath('bar');

更多示例请参见 filenode

分类

数据目录, 系统函数

另请参阅

pg_relation_filenode(), pg_filenode_relation()

反馈

在此处 提交关于 "pg_relation_filepath()" 的任何评论、建议或更正。