Is there a PostgresQL equivalent to the DESCRIBE keyword???

Started by Peter E. Chenover 24 years ago4 messagesgeneral
Jump to latest
#1Peter E. Chen
pchen3@jhmi.edu

Hey All,

I'm trying to display the schema to various tables. In most other
databases, you can use the DESCRIBE keyword or the SHOW keyword (I believe
this is a SQL99 keyword). Is there an equivalent in PostgresQL?

Also, does PostgresQL have an equivalent to the following:

SHOW CREATE TABLE table_name

Thanks for any help.

Peter

#2Philip Hallstrom
philip@adhesivemedia.com
In reply to: Peter E. Chen (#1)
Re: Is there a PostgresQL equivalent to the DESCRIBE keyword???

while in psql type:

\d tablename

(don't add a semicolon)

On Fri, 14 Dec 2001, Peter E. Chen wrote:

Show quoted text

Hey All,

I'm trying to display the schema to various tables. In most other
databases, you can use the DESCRIBE keyword or the SHOW keyword (I believe
this is a SQL99 keyword). Is there an equivalent in PostgresQL?

Also, does PostgresQL have an equivalent to the following:

SHOW CREATE TABLE table_name

Thanks for any help.

Peter

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

#3Andrew Gould
andrewgould@yahoo.com
In reply to: Peter E. Chen (#1)
Re: Is there a PostgresQL equivalent to the DESCRIBE keyword???

In psql, enter \d [table name].

Best of luck,

Andrew Gould

--- "Peter E. Chen" <pchen3@jhmi.edu> wrote:

Hey All,

I'm trying to display the schema to various tables.
In most other
databases, you can use the DESCRIBE keyword or the
SHOW keyword (I believe
this is a SQL99 keyword). Is there an equivalent in
PostgresQL?

Also, does PostgresQL have an equivalent to the
following:

SHOW CREATE TABLE table_name

Thanks for any help.

Peter

---------------------------(end of
broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

#4Andrew G. Hammond
drew@xyzzy.dhs.org
In reply to: Andrew Gould (#3)
Re: Is there a PostgresQL equivalent to the DESCRIBE

If you want to see the SQL that psql uses to do this, \set ECHO_HIDDEN
or start psql with the -E option.

On Fri, 2001-12-14 at 19:09, Andrew Gould wrote:

In psql, enter \d [table name].

Best of luck,

Andrew Gould

--- "Peter E. Chen" <pchen3@jhmi.edu> wrote:

Hey All,

I'm trying to display the schema to various tables.
In most other
databases, you can use the DESCRIBE keyword or the
SHOW keyword (I believe
this is a SQL99 keyword). Is there an equivalent in
PostgresQL?

Also, does PostgresQL have an equivalent to the
following:

SHOW CREATE TABLE table_name

Thanks for any help.

Peter

---------------------------(end of
broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Andrew G. Hammond mailto:drew@xyzzy.dhs.org
http://xyzzy.dhs.org/~drew/
56 2A 54 EF 19 C0 3B 43 72 69 5B E3 69 5B A1 1F
613-389-5481
5CD3 62B0 254B DEB1 86E0 8959 093E F70A B457 84B1
"To blow recursion you must first blow recur" -- me