Thread: Get name of columns in a table

Get name of columns in a table

From
María Elena Hernández
Date:
 Hi everybody!
 
Is it possible to get thecoluns names of an a table in the database with a sql
query??
 

Thanks, a lot.....

Re: Get name of columns in a table

From
Joel Burton
Date:
On Fri, 27 Jul 2001, [iso-8859-1] Mar�a Elena Hern�ndez wrote:

>  Is it possible to get thecoluns names of an a table in the database with a sql
> query??

"psql -E" will show the SQL commands that psql internally uses to display
tables, database, etc. Once in psql, use "\d table_name" to see fields in
a table and the SQL behind that.

--
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington


Re: Get name of columns in a table

From
Richard Huxton
Date:
María Elena Hernández wrote:
> 
To get a list of columns, run "psql -E" and do a standard "\df foo"
where foo is your table name. This will show you exactly how PG does it.
I've found this very useful with all the backslash commands.

HTH

- Richard Huxton