pg_ls_replslotdir()

一个提供有关复制槽目录中文件信息的函数

pg_ls_replslotdir() 是一个系统函数,它提供有关特定复制槽目录中文件的信息。

pg_ls_replslotdir()PostgreSQL 15 中添加。

用法

pg_ls_replslotdir ( slot_name text ) 
        → setof record ( name text, size bigint, modification timestamp with time zone )

pg_ls_replslotdir() 返回由 slot_name 参数指定的复制槽目录中所有普通文件的列表。

请注意,行不会按任何特定顺序返回,因此添加明确的排序标准可能很有用。

变更历史

示例

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

分类

数据目录, 文件访问和操作, 复制, 复制槽, 系统函数

另请参阅

pg_replication_slots

反馈

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