Describe structure.

Started by anujover 25 years ago7 messagesgeneral
Jump to latest
#1anuj
Anuj@in-control.de

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"

#2DE VOLDER Fabrice
fabrice.devolder@cegetel.fr
In reply to: anuj (#1)
RE: Describe structure.

\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"

#3Brett W. McCoy
bmccoy@chapelperilous.net
In reply to: anuj (#1)
Re: Describe structure.

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?

#4Wilkinson Charlie E
Charlie.E.Wilkinson@irs.gov
In reply to: Brett W. McCoy (#3)
RE: Describe structure.

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-

Show quoted text

-----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"

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Wilkinson Charlie E (#4)
RE: Describe structure.

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

#6Ross J. Reedstrom
reedstrm@rice.edu
In reply to: Peter Eisentraut (#5)
Re: Describe structure.

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

#7Wilkinson Charlie E
Charlie.E.Wilkinson@irs.gov
In reply to: Ross J. Reedstrom (#6)
RE: Describe structure.

-----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.