Select all table column names for a specified tablename (per the system catalogs) - Mailing list pgsql-admin

From kevin kempter
Subject Select all table column names for a specified tablename (per the system catalogs)
Date
Msg-id E9AEE096-D4FD-4A3E-9FD5-FF134747B040@kevinkempterllc.com
Whole thread Raw
Responses Re: Select all table column names for a specified tablename (per the system catalogs)  (Joshua Drake <jd@commandprompt.com>)
List pgsql-admin
Hi List;

I want to pull the list of column names from the system catalogs for a
specified table. I only want column names, I want to exclude any index
names, or other non-column name rows.  I got this far (see below)
however this query produces additional rows with attname's like
tableoid, cmax, xmax ctid, etc.

select attname from pg_attribute where attrelid = (select oid from
pg_class where relname = 'my_tablename');

Any thoughts ?

Thanks in advance...



pgsql-admin by date:

Previous
From: "Tena Sakai"
Date:
Subject: Re: question on pg_ctl
Next
From: Joshua Drake
Date:
Subject: Re: Select all table column names for a specified tablename (per the system catalogs)