Re: Table description - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Table description
Date
Msg-id dcc563d10708200808v6c8931fctc3a2edb47c2b10b@mail.gmail.com
Whole thread Raw
In response to Table description  ("Livia Santos" <liviasilvasantos@gmail.com>)
List pgsql-general
On 8/20/07, Livia Santos <liviasilvasantos@gmail.com> wrote:
> Hi.
>
> Is there any command that describe a table, such as desc table_name as in
> Oracle?

Yes and no.  The psql client has a series of \ commands that can
describe pretty much anything in the db in a pretty print nature and a
minimum of typing.  The \ commands are NOT implemented in the backend,
but in the psql client so you can't just hit the db with \d from a
libpq connection to get a list of all tables / views / sequences.

However, you can use psql -E to have psql show you al lthe queries
it's throwing at the backend to get that pretty output, and then you
can take what it's doing and either wrap it in a view for future use,
or run it directly.

pgsql-general by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Table description
Next
From: Robert Gravsjö
Date:
Subject: Re: Table description