"Jan Pips" <[EMAIL PROTECTED]> 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 varying
 date        | timestamp with time zone
 price       | numeric
 quantity    | 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/>

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to