How can I select a comment on a column?

From: Serguei Pronkine <pronkine(at)krikri(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: How can I select a comment on a column?
Date: 2007-03-26 14:37:59
Message-ID: 4607DAC7.7050503@krikri.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi community,
I'd like to retrieve comments on tables an columns by table name and
column name. The posting by Tom Lane <tgl ( at ) sss ( dot ) pgh ( dot )
pa ( dot ) us>
http://archives.postgresql.org/pgsql-novice/2004-01/msg00180.php?adv=1
says how to select comment on a column.

regression=# create table mytab (mycol int);
CREATE TABLE
regression=# comment on column mytab.mycol is 'my comment';
COMMENT
regression=# select col_description('mytab'::regclass, 1);
col_description
-----------------
my comment
(1 row)

How can I now retrieve column number from column name?

Thanks in advance,
Serguei Pronkine

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yang 2007-03-26 15:27:03 PG over NFS
Previous Message Saqib Awan 2007-03-26 14:20:58 Re: Limiting user connnections on 7.4