X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 652335E37D0 for ; Fri, 13 Aug 2004 16:07:57 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55483-01 for ; Fri, 13 Aug 2004 19:07:53 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id E8B415E37CB for ; Fri, 13 Aug 2004 16:07:48 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i7DJ5Ibk025977; Fri, 13 Aug 2004 15:05:18 -0400 (EDT) To: "Darren Sunley" Cc: pgsql-admin@postgresql.org Subject: Re: dynamic DB descriptions In-reply-to: References: Comments: In-reply-to "Darren Sunley" message dated "Wed, 11 Aug 2004 17:02:04 -0000" Date: Fri, 13 Aug 2004 15:05:18 -0400 Message-ID: <25976.1092423918@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/112 X-Sequence-Number: 14507 "Darren Sunley" writes: > I was just wondering if anyone new of a way of pulling out the attribute > names of a table on the fly. Basically select attname from pg_attribute where attrelid = (select oid from pg_class where relname = 'foo'); For examples of getting fancier, try running psql with -E option and do "\d foo". Also read the "system catalogs" chapter in the documentation. regards, tom lane