2

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?

2
  • Your question doesn't make terribly much sense. I'm not even sure what you mean. Commented Feb 27, 2014 at 12:30
  • Maybe this could help: stackoverflow.com/questions/4462908/… Commented Feb 27, 2014 at 12:30

1 Answer 1

5

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%';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.