Thread: Describe structure.

Describe structure.

From
"anuj"
Date:
Hi,
My table name is tblpg.
I want to see the table structure.
Like oracle have Describe <table name>.
What PG have ? or any command.
Thank in advance.
Anuj

pg=> \d
Database    = pg
 +------------------+----------------------------------+----------+
 |  Owner           |             Relation             |   Type   |
 +------------------+----------------------------------+----------+
 | postgres         | tblpg                            | table    |
 +------------------+----------------------------------+----------+

pg=> describe tblpg;
ERROR:  parser: parse error at or near "describe"

RE: Describe structure.

From
DE VOLDER Fabrice
Date:
\d tblpg

-----Message d'origine-----
De: anuj [mailto:Anuj@in-control.de]
Date: mardi 25 juillet 2000 11:03
À: pgsql-general@hub.org
Objet: [GENERAL] Describe structure.


Hi,
My table name is tblpg.
I want to see the table structure.
Like oracle have Describe <table name>.
What PG have ? or any command.
Thank in advance.
Anuj

pg=> \d
Database    = pg
 +------------------+----------------------------------+----------+
 |  Owner           |             Relation             |   Type   |
 +------------------+----------------------------------+----------+
 | postgres         | tblpg                            | table    |
 +------------------+----------------------------------+----------+

pg=> describe tblpg;
ERROR:  parser: parse error at or near "describe"

Re: Describe structure.

From
"Poul L. Christiansen"
Date:
pg=>\d tblpg will describe the structure.

pg=>\? will give a list of commands, including how to use \d

anuj wrote:

> Hi,
> My table name is tblpg.
> I want to see the table structure.
> Like oracle have Describe <table name>.
> What PG have ? or any command.
> Thank in advance.
> Anuj
>
> pg=> \d
> Database    = pg
>  +------------------+----------------------------------+----------+
>  |  Owner           |             Relation             |   Type   |
>  +------------------+----------------------------------+----------+
>  | postgres         | tblpg                            | table    |
>  +------------------+----------------------------------+----------+
>
> pg=> describe tblpg;
> ERROR:  parser: parse error at or near "describe"


Re: Describe structure.

From
Date:
On Tue, 25 Jul 2000, anuj wrote:

> My table name is tblpg.
> I want to see the table structure.
> Like oracle have Describe <table name>.
> What PG have ? or any command.
> Thank in advance.
> Anuj
>
> pg=> \d
> Database    = pg
>  +------------------+----------------------------------+----------+
>  |  Owner           |             Relation             |   Type   |
>  +------------------+----------------------------------+----------+
>  | postgres         | tblpg                            | table    |
>  +------------------+----------------------------------+----------+

It's all in the online help.  The command you want is \d <table>.

Brett W. McCoy
                                         http://www.chapelperilous.net/~bmccoy/
-------------------------------------------------------------------------------
Yow!  Is my fallout shelter termite proof?


RE: Describe structure.

From
Wilkinson Charlie E
Date:

While we're on the topic, can someone tell me where '\d *' went, and what to use instead?
That particular command seems to have disappeared in PG7.

Thanks for any light-shedding...

-cw-

> -----Original Message-----
> From: Poul L. Christiansen [mailto:plc@faroenet.fo]
> Sent: Tuesday, July 25, 2000 4:43 AM
> To: anuj
> Cc: pgsql-general@hub.org
> Subject: Re: [GENERAL] Describe structure.
>
>
> pg=>\d tblpg will describe the structure.
>
> pg=>\? will give a list of commands, including how to use \d
>
> anuj wrote:
>
> > Hi,
> > My table name is tblpg.
> > I want to see the table structure.
> > Like oracle have Describe <table name>.
> > What PG have ? or any command.
> > Thank in advance.
> > Anuj
> >
> > pg=> \d
> > Database    = pg
> >  +------------------+----------------------------------+----------+
> >  |  Owner           |             Relation             |   Type   |
> >  +------------------+----------------------------------+----------+
> >  | postgres         | tblpg                            | table    |
> >  +------------------+----------------------------------+----------+
> >
> > pg=> describe tblpg;
> > ERROR:  parser: parse error at or near "describe"
>

RE: Describe structure.

From
Peter Eisentraut
Date:
Wilkinson Charlie E writes:

> While we're on the topic, can someone tell me where '\d *' went, and what to
> use instead?
> That particular command seems to have disappeared in PG7.

Hmm, that must have been me. What did it do? Describe all tables at once?


--
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Re: Describe structure.

From
"Ross J. Reedstrom"
Date:
On Tue, Jul 25, 2000 at 10:39:53PM +0200, Peter Eisentraut wrote:
> Wilkinson Charlie E writes:
>
> > While we're on the topic, can someone tell me where '\d *' went, and what to
> > use instead?
> > That particular command seems to have disappeared in PG7.
>
> Hmm, that must have been me. What did it do? Describe all tables at once?
>

I just tried it on a 6.5.0 install I've still got lying around: it first
dumps a \d output (i.e. all the tables, sequences, and indicies), then
describes all the tables, as you guessed.

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

RE: Describe structure.

From
Wilkinson Charlie E
Date:

> -----Original Message-----
> From: Peter Eisentraut [mailto:peter_e@gmx.net]
>
> Wilkinson Charlie E writes:
>
> > While we're on the topic, can someone tell me where '\d *'
> went, and what to
> > use instead?
> > That particular command seems to have disappeared in PG7.
>
> Hmm, that must have been me. What did it do? Describe all
> tables at once?

Hi Peter,
Yup, that's the one.  Comes in handy for those of us who are
too lazy to describe them individually. :)

Basically what I need to do is print out a schema for all
tables in the database.  \d * used to work quite well for
me.  Is there any other option besides doing \d <table> for
each table (or creating a script to do it)?

-cw-

--
Charlie Wilkinson - TRIS Development Systems Administrator
IS:SD:CT:CC:TD
Phone: 202-283-3241
MSMail:   Charlie E Wilkinson
SMTP:  cwilkins@tris.irs.gov
Home:  cwilkins@boinklabs.com
This message constructed from 90% post-consumer electrons.