Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3EAE3475D6E for ; Wed, 11 Dec 2002 04:56:16 -0500 (EST) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id 1D163475B07 for ; Wed, 11 Dec 2002 04:56:15 -0500 (EST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Wed Dec 11 10:56:09 2002 +0100 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id KAA12715; Wed, 11 Dec 2002 10:56:09 +0100 (MET) Message-ID: <3DF70BB8.A64AF0E5@rodos.fzk.de> Date: Wed, 11 Dec 2002 10:56:09 +0100 From: Christoph Haller X-Mailer: Mozilla 4.06 [en] (X11; I; HP-UX B.10.20 9000/780) MIME-Version: 1.0 To: jman@equityunderwriters.com.hk Cc: pgsql-sql@postgresql.org Subject: Re: Question II Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/121 X-Sequence-Number: 10709 > > I would like to get all field name of a table within a stored procedure > using pgsql. How to do it?? > SELECT a.attname FROM pg_class c, pg_attribute a WHERE c.relname = '' AND a.attnum > 0 AND a.attrelid = c.oid ORDER BY a.attnum ; gives you the field names of . If you start a psql session with the -E option, you can see how \d is sql-generated. If you are asking for support how to write this pgsql function (table name parameter, query, etc.), then refer to the documentation or send another request. Regards, Christoph