Received: from clayton-cottingham.imc ([216.18.11.61]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0PL0iq23418 for ; Thu, 25 Jan 2001 16:00:44 -0500 (EST) (envelope-from drfrog@smartt.com) Received: from smartt.com (IDENT:drfrog@localhost.localdomain [127.0.0.1]) by clayton-cottingham.imc (8.11.0/8.11.0) with ESMTP id f0PL25p11039; Thu, 25 Jan 2001 13:02:05 -0800 Message-ID: <3A70944D.4541D0F3@smartt.com> Date: Thu, 25 Jan 2001 13:02:05 -0800 From: clayton cottingham X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.17-21mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: "Mike D'Agosta" CC: pgsql-sql@postgresql.org Subject: Re: Is there anything like DESCRIBE? References: <94n93j$2j6j$1@news.tht.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/369 X-Sequence-Number: 1042 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 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