X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D8EA8D1DD5D for ; Thu, 26 Feb 2004 14:19:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 41420-04 for ; Thu, 26 Feb 2004 10:19:29 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 68BBAD1DA2E for ; Thu, 26 Feb 2004 10:19:25 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i1QEJO1Y018712 for ; Thu, 26 Feb 2004 14:19:24 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i1QDoRf4012839 for pgsql-sql@postgresql.org; Thu, 26 Feb 2004 13:50:27 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Field list from table Date: Thu, 26 Feb 2004 08:08:56 -0500 Organization: cbbrowne Computing Inc Lines: 19 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux) Cancel-Lock: sha1:hdR+OxGsU3KG2iaFkvoTLqcCkV8= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/363 X-Sequence-Number: 17053 "Jan Pips" 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."