[英]How to check table UNLOGGED with postgresql?
CREATE UNLOGGED TABLE IF NOT EXISTS <tablename>
如何首先檢查是否創建了所需的表UNLOGGED
,如果沒有相應地更改表?
postgres 9.4
您可以檢查表pg_class
列relpersistence
;
postgres=# select relpersistence, relname from pg_class where relname like 'foo%'; ┌────────────────┬─────────┐ │ relpersistence │ relname │ ╞════════════════╪═════════╡ │ p │ foo │ │ p │ foo1 │ │ u │ foo2 │ └────────────────┴─────────┘ (3 rows)
foo2
是未記錄的表。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.