Re: Switching from MySQL -- Missing DESCRIBE table, SHOW

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Gan Uesli Starling <alias(at)starling(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Switching from MySQL -- Missing DESCRIBE table, SHOW
Date: 2005-10-16 23:10:02
Message-ID: 1129504202.6816.20.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)lfix(dot)co(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Gan Uesli Starling 2005-10-16 23:31:52 Re: Switching from MySQL -- Missing DESCRIBE table, SHOW
Previous Message Gan Uesli Starling 2005-10-16 21:17:23 Switching from MySQL -- Missing DESCRIBE table, SHOW TABLES