"Show tables like" in postgresql

peipei picture peipei · Aug 18, 2014 · Viewed 8.4k times · Source

Is there any way to list all tables that contain certain keywords in psql?

In other words, is there a similar command as in mysql:

show tables like "%test%" ?

Answer

peipei picture peipei · Aug 18, 2014

Just found the answer..

\dt *test* will pull tables: 123_test_234, test_234, 123_test etc.

\dt *test will pull tables: 123_test etc.

\dt test* will pull tables: test_234 etc.

Not sure if there is a similar question. If there is, maybe I should delete this.