Since version 9.1, PostgreSQL supports the creation of UNLOGGED tables which do not use the WAL and are truncated during any DB recovery. See documentation: create unlogged table
Where does PostgreSQL store the information, whether a relation is UNLOGGED? I am looking for a query to list all relations that are UNLOGGED.
Thanks in advance
Unlogged tables is a PostgreSQL feature that can be used effectively to optimize bulk inserts. PostgreSQL uses Write-Ahead Logging (WAL). It provides atomicity and durability, by default. Atomicity, consistency, isolation, and durability make up the ACID properties.
Use the \dt or \dt+ command in psql to show tables in a specific database. Use the SELECT statement to query table information from the pg_catalog.
It is the relpersistence
column of the pg_class catalog:
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';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With