List of all UNLOGGED tables in Postgresql database

Since version 9.1, PostgreSQL supports the creation of UNLOGGED tables that do not use WAL and are truncated during any database restore. See Documentation:create unlogged table

Where does PostgreSQL store information about whether a relation is UNLOGGED? I am looking for a query to list all the relationships that are NOT USED.

Thank you in advance

+4


source to share


2 answers


This is relpersistence

the pg_class catalog column:



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

+9


source


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



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

      

+1


source







All Articles