RE: Is there anything like DESCRIBE? - Mailing list pgsql-sql

From Michael Davis
Subject RE: Is there anything like DESCRIBE?
Date
Msg-id 01C086D6.B80EB9B0.mdavis@sevainc.com
Whole thread Raw
In response to Is there anything like DESCRIBE?  ("Mike D'Agosta" <mdagosta@earthtribe.net>)
List pgsql-sql
This works for me:

SELECT DISTINCT c.relname as table_name, a.attname as column_name, t.typname, pa.adsrc as default  FROM (pg_attribute a
       join pg_class c on a.attrelid = c.oid        join pg_type t on a.atttypid = t.oid)        left join pg_attrdef
paon c.oid = pa.adrelid AND a.attnum = pa.adnum  where exists (select * from pg_tables where tablename = c.relname and
substr(tablename,1,2)<> 'pg')   order by c.relname, a.attname;
 


-----Original Message-----
From:    Mike D'Agosta [SMTP:mdagosta@earthtribe.net]
Sent:    Wednesday, January 24, 2001 12:01 PM
To:    pgsql-sql@postgresql.org
Subject:    Is there anything like DESCRIBE?

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





pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Don't want blank data
Next
From: clayton cottingham
Date:
Subject: Re: Is there anything like DESCRIBE?