pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: clayton cottingham <drfrog@smartt.com>
To: Mike D'Agosta <mdagosta@earthtribe.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Is there anything like DESCRIBE?
Date: Thu, 25 Jan 2001 13:02:05 -0800
Message-ID: <3A70944D.4541D0F3@smartt.com> (raw)
References: <94n93j$2j6j$1@news.tht.net>

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



view thread (6+ messages)  latest in thread

Message-ID: <3A70944D.4541D0F3@smartt.com>
Permalink:  ../3A70944D.4541D0F3@smartt.com/
Also on:    postgresql.org/message-id/3A70944D.4541D0F3@smartt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: drfrog@smartt.com, mdagosta@earthtribe.net
  Subject: Re: Is there anything like DESCRIBE?
  In-Reply-To: <3A70944D.4541D0F3@smartt.com>
  References: <94n93j$2j6j$1@news.tht.net> <3A70944D.4541D0F3@smartt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox