Re: Switching from MySQL -- Missing DESCRIBE table, SHOW - Mailing list pgsql-novice

From Oliver Elphick
Subject Re: Switching from MySQL -- Missing DESCRIBE table, SHOW
Date
Msg-id 1129504202.6816.20.camel@linda.lfix.co.uk
Whole thread Raw
In response to Switching from MySQL -- Missing DESCRIBE table, SHOW TABLES  (Gan Uesli Starling <alias@starling.us>)
List pgsql-novice
On Sun, 2005-10-16 at 17:17 -0400, Gan Uesli Starling wrote:
> But alas, two of the most useful commands appear to be missing:
>
> SHOW TABLES
> DESCRIBE table
...
> I can't believe there is no way for PostgreSQL to tell me what the
> current DB's table structure is via simple SQL queries executed remotely.

You can use the INFORMATION_SCHEMA (which is standard SQL), but in psql
the simplest way is:

  \d+           Show all tables, with descriptions
  \d+ table     Show the definition of the named table (or view), with
                  column descriptions

  \?            Describe briefly all the \ commands in psql

The capabilities of psql are fully described in the manual and in psql's
man page.

--
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
   Do you want to know God?   http://www.lfix.co.uk/knowing_god.html


pgsql-novice by date:

Previous
From: Gan Uesli Starling
Date:
Subject: Switching from MySQL -- Missing DESCRIBE table, SHOW TABLES
Next
From: Gan Uesli Starling
Date:
Subject: Re: Switching from MySQL -- Missing DESCRIBE table, SHOW