是否可以在Postgres中查询对象(对象是表,视图等)状态?在Oracle中,等效查询将是:
SELECT owner,
object_name,
status
FROM all_objects
WHERE object_type = 'VIEW'
(在状态栏中返回VALID / INVALID)
请告诉我。我已经用谷歌搜索了这个,但是找不到多少。
迈克尔
答案 0 :(得分:0)
https://stackoverflow.com/a/39120069/5315974
Postgres不会让你破坏视图(RULE),例如:
t=# create table so183 (i int);
CREATE TABLE
t=# create view v183 as select i from so183;
CREATE VIEW
t=# alter table so183 alter COLUMN i type text using i::text;
ERROR: cannot alter type of a column used by a view or rule
DETAIL: rule _RETURN on view v183 depends on column "i"