Thread: How to view the list of tables?

How to view the list of tables?

From
Konstantin Danilov
Date:
Hello, list!
I need to view the list of tables in a database. In MySQL I can do it with the command "SHOW TABLES". What about
PostgreSQL?
Can I also see somehow the datatypes of tables' fields?
Konstantin

Re: How to view the list of tables?

From
Richard Huxton
Date:
Konstantin Danilov wrote:
> Hello, list!
> I need to view the list of tables in a database. In MySQL I can do it with the command "SHOW TABLES". What about
PostgreSQL?
> Can I also see somehow the datatypes of tables' fields?
> Konstantin

"man psql" will show you details of how to operate the psql application,
or when in it try "\?" and "\h" to get help. We also now support the
SQL-standard "information schema".

You'll also find the manuals have this information - available with your
installation and also online at http://www.postgresql.org/docs/

HTH
--
   Richard Huxton
   Archonet Ltd

Re: How to view the list of tables?

From
Shridhar Daithankar
Date:
On Tuesday 15 Feb 2005 3:46 pm, Konstantin Danilov wrote:
> Hello, list!
> I need to view the list of tables in a database. In MySQL I can do it with
> the command "SHOW TABLES". What about PostgreSQL? Can I also see somehow
> the datatypes of tables' fields?

In psql, you can try '\dt' and '\d table name'. Type \? for more commands..

 Shridhar