pg_ls_replslotdir() 是一个系统函数,它提供有关特定复制槽目录中文件的信息。
pg_ls_replslotdir() 在 PostgreSQL 15 中添加。
用法
pg_ls_replslotdir (slot_nametext)
→ setof record (nametext,sizebigint,modificationtimestamp with time zone)
pg_ls_replslotdir() 返回由 slot_name 参数指定的复制槽目录中所有普通文件的列表。
请注意,行不会按任何特定顺序返回,因此添加明确的排序标准可能很有用。
变更历史
- PostgreSQL 15
- 添加于(提交 1922d7c6)
示例
pg_ls_replslotdir() 的基本用法示例
postgres=# SELECT * FROM pg_ls_replslotdir('node2');
name | size | modification
-------+------+------------------------
state | 200 | 2021-11-24 06:13:08+01
(1 row)
尝试查询不存在的复制槽
postgres=# SELECT * FROM pg_ls_replslotdir('node1');
ERROR: replication slot "node1" does not exist
参考资料
- PostgreSQL 文档: 通用文件访问函数
