Postgresql
如何檢查 PostgreSQL 表是否是臨時的?
如何編寫查詢來檢查 PostgreSQL (10.x) 表是否為臨時表?
我查看了
pg_class
系統表,但找不到任何關於關係是否是臨時的列。SELECT * FROM pg_class WHERE False; relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasoids | relhaspkey | relhasrules | relhastriggers | relhassubclass | relrowsecurity | relforcerowsecurity | relispopulated | relreplident | relispartition | relfrozenxid | relminmxid | relacl | reloptions | relpartbound ---------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+------------+------------+-------------+----------------+----------------+----------------+---------------------+----------------+--------------+----------------+--------------+------------+--------+------------+-------------- (0 rows)
relpersistence:p = 永久表,u = 未記錄表,t = 臨時表