Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I list only tables and/or views, no indexes?

Using psql on terminal and looking for all tables and views, but "\d mySchema. and tab" shows all objects, not only the important ones.

like image 294
Peter Krauss Avatar asked Nov 07 '22 05:11

Peter Krauss


1 Answers

On psql v12.3 the \? command say:

  \dt[S+] [PATTERN]      list tables
  \dv[S+] [PATTERN]      list views

So, using "\dt mySchema. tab" you obtaim all TABLE names and with "\dt mySchema. tab" you obtaim all VIEW names.

like image 196
Peter Krauss Avatar answered Nov 13 '22 00:11

Peter Krauss