Re: Field list from table

From: "Denis" <sqllist(at)coralindia(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Field list from table
Date: 2004-03-01 05:30:49
Message-ID: 01fb01c3ff4e$5bd62a40$0f32a8c0@denisnew
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


To get the list.. use

SELECT a.attname as "Columns"
FROM pg_attribute a, pg_class c
WHERE c.relname = '<YOUR_TABLE_NAME>'
AND a.attnum > 0 AND a.attrelid = c.oid
ORDER BY a.attnum

Thanx

Denis

----- Original Message -----
From: "Jan Pips" <jan_pips(at)op(dot)pl>
To: <pgsql-sql(at)postgresql(dot)org>
Sent: Thursday, February 26, 2004 3:21 PM
Subject: [SQL] Field list from table

> How can I, using SELECT, get the full list of fields from a given table?
>
> Pips
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Terence Kearns 2004-03-01 15:19:53 Re: returning a recordset from PLpg/SQL
Previous Message V i s h a l Kashyap @ [Sai Hertz And Control Systems] 2004-03-01 04:17:50 Re: PLSQL Question regarding multiple inserts