From: | clayton cottingham <drfrog(at)smartt(dot)com> |
---|---|
To: | "Mike D'Agosta" <mdagosta(at)earthtribe(dot)net> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Is there anything like DESCRIBE? |
Date: | 2001-01-25 21:02:05 |
Message-ID: | 3A70944D.4541D0F3@smartt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Mike D'Agosta wrote:
>
> Hi,
>
> I have a number of empty tables and I want to get the column names and
> data types with an SQL statement. I want to do this procedurally, not
> interactively (so I can't use \d <tablename> in psql). Postgres doesn't
> support DESCRIBE... is there any other way to do this?
>
> Thanks!
> Mike
like this
drfrog=# \d messages
Table "messages"
Attribute | Type | Modifier
-------------------+---------+----------
id | integer | not null
msgid | text |
boxid | integer |
accountid | integer |
date | text |
sentto | text |
sentfrom | text |
subject | text |
contenttype | text |
contentxferencode | text |
mimeversion | text |
precedence | text |
approvedby | text |
inreplyto | text |
replyto | text |
listsub | text |
listunsub | text |
status | text |
xorigip | text |
cc | text |
bcc | text |
sender | text |
returnpath | text |
priority | text |
xmailer | text |
xuidl | text |
xsender | text |
localdate | text |
newmsg | text |
replyf | integer |
friendly | text |
rreceiptto | text |
score | integer |
ref | text |
serverstat | integer |
Index: messages_pkey
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Elphick | 2001-01-25 22:51:30 | Re: Is there anything like DESCRIBE? |
Previous Message | Najm Hashmi | 2001-01-25 20:59:23 | Re: How to change the ownership of the table? |