Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Show tables like" in postgresql

Tags:

psql

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%" ?

like image 307
peipei Avatar asked Aug 18 '14 17:08

peipei


1 Answers

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.

like image 187
peipei Avatar answered Oct 19 '22 10:10

peipei