0

Is it possible to query object (object being table, view, etc.) status in Postgres? In Oracle an equivalent query would be:

SELECT owner,
       object_name,
       status
  FROM all_objects
 WHERE object_type = 'VIEW'

(returns VALID/INVALID in status column)

Please let me know. I've googled for this already, but have not found much.

Michael

Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
bda
  • 372
  • 1
  • 7
  • 22

1 Answers1

0

https://stackoverflow.com/a/39120069/5315974

Postgres does not let you break the view (RULE), eg:

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"
Vao Tsun
  • 47,234
  • 13
  • 100
  • 132