Обсуждение: Get name of columns in a table

Поиск
Список
Период
Сортировка

Get name of columns in a table

От
María Elena Hernández
Дата:
 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

От
Joel Burton
Дата:
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

От
Richard Huxton
Дата:
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