简体   繁体   English

列出Postgresql数据库中的所有UNLOGGED表

[英]List all UNLOGGED tables in Postgresql database

Since version 9.1, PostgreSQL supports the creation of UNLOGGED tables which do not use the WAL and are truncated during any DB recovery. 从版本9.1开始,PostgreSQL支持创建不使用WAL的UNLOGGED表,并在任何数据库恢复期间被截断。 See documentation: create unlogged table 请参阅文档: create unlogged table

Where does PostgreSQL store the information, whether a relation is UNLOGGED? PostgreSQL在哪里存储信息,关系是否是UNLOGGED? I am looking for a query to list all relations that are UNLOGGED. 我正在寻找一个查询列出所有UNLOGGED的关系。

Thanks in advance 提前致谢

It is the relpersistence column of the pg_class catalog: 它是pg_class目录的relpersistence列:

http://www.postgresql.org/docs/9.1/static/catalog-pg-class.html http://www.postgresql.org/docs/9.1/static/catalog-pg-class.html

https://www.postgresql.org/docs/current/catalog-pg-class.html

select relname, relowner from pg_class where relpersistence='u';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM