Re: Select all table column names for a specified tablename (per the system catalogs)

Поиск
Список
Период
Сортировка
От Joshua Drake
Тема Re: Select all table column names for a specified tablename (per the system catalogs)
Дата
Msg-id 20080922152950.294284b4@jd-laptop
обсуждение исходный текст
Ответ на Select all table column names for a specified tablename (per the system catalogs)  (kevin kempter <kevin@kevinkempterllc.com>)
Ответы Re: Select all table column names for a specified tablename (per the system catalogs)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
On Mon, 22 Sep 2008 16:06:06 -0600
kevin kempter <kevin@kevinkempterllc.com> wrote:

> 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');


SELECT column_name FROM information_schema.columns WHERE table_name =
'table';

Joshua D. Drake

>
> Any thoughts ?
>
> Thanks in advance...
>
>
>


--
The PostgreSQL Company since 1997: http://www.commandprompt.com/
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate



В списке pgsql-admin по дате отправления:

Предыдущее
От: kevin kempter
Дата:
Сообщение: Select all table column names for a specified tablename (per the system catalogs)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: displaying enum