1

I have a postgresql database with a lot of schemas, tables and views. Recently, some 3 tables was replaced with one.

Now i have over 1000 views which may use these old tables. Checking them manually is little boring and easy to miss something. Is there any way to search for particular table, or better: schema in all existing views in database?

WombaT
  • 790
  • 1
  • 13
  • 27

1 Answers1

4

You can do this through information_schema.views, which is documented here. Something like this:

select v.*
from information_schema.views v
where v.view_definition like '%tablename%';
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786