查找Postgres表的副本身份

时间:2019-03-19 20:25:25

标签: postgresql logical-replication

是否可以使用pgAdmin或通过查询来查看Postgres表具有哪种副本身份?

1 个答案:

答案 0 :(得分:0)

您可以查询pg_class系统目录:

SELECT CASE relreplident
          WHEN 'd' THEN 'default'
          WHEN 'n' THEN 'nothing'
          WHEN 'f' THEN 'full'
          WHEN 'i' THEN 'index'
       END AS replica_identity
FROM pg_class
WHERE oid = 'mytablename'::regclass;