0

In my DB I have 642 tables. I have to search specific table from it that name contain EMPSAL in it's name. But like above so many tables are there which contain this KEYWORD in start of name or end of name or in between.

So I want to list tables that have EMPSAL in it's name at any place.

an I am newer to postgresql so I don't know that how to do so.

Is there any method that can help me to do so ?

Any suggestion for this?

1 Answer 1

2

This query:

SELECT table_name FROM information_schema.tables WHERE table_schema='public' AND table_type='BASE TABLE';

Should give you a list of all the tables in your database. Then you can add something like this at the end:

AND TABLE_NAME LIKE '%EMPSAL%';

Don't forget to remove the previous semicolon, or you're going to have a syntax error :)

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.