Re: Is there anything like DESCRIBE?

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
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 22:51:30
Message-ID: 200101252251.f0PMpUF28860@linda.lfix.co.uk
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?

If you run psql with the -E option, it will show you the query it
uses when you type `\d+`. Use that query in your procedural code.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"My little children, let us not love in word, neither
in tongue; but in deed and in truth."
I John 3:18

Browse pgsql-sql by date

  From Date Subject
Next Message Oliver Elphick 2001-01-25 22:54:44 Re: Don't want blank data
Previous Message clayton cottingham 2001-01-25 21:02:05 Re: Is there anything like DESCRIBE?