Re: Field list from table - Mailing list pgsql-sql

From Christopher Browne
Subject Re: Field list from table
Date
Msg-id m365duyolz.fsf@wolfe.cbbrowne.com
Whole thread Raw
List pgsql-sql
"Jan Pips" <jan_pips@op.pl> wrote:
> How can I, using SELECT, get the full list of fields from a given table?

portfolio=# select column_name, data_type from information_schema.columns where table_catalog = 'portfolio' and
table_schema= 'public' and table_name = 'stocktxns';column_name |        data_type         
 
-------------+--------------------------symbol      | character varyingdate        | timestamp with time zoneprice
| numericquantity    | numeric
 
(4 rows)

information_schema.columns has additional columns to provide
information about numeric precision, string widths, and such...
-- 
"cbbrowne","@","ntlug.org"
http://www.ntlug.org/~cbbrowne/postgresql.html
Rules  of the  Evil Overlord  #4.  "Shooting is  not too  good for  my
enemies." <http://www.eviloverlord.com/>


pgsql-sql by date:

Previous
From: "Kumar"
Date:
Subject: Return more than a record
Next
From: Frank Bax
Date:
Subject: Re: Last day of month