Re: How can I select a comment on a column in a query?

From: George Weaver <gweaver(at)shaw(dot)ca>
To: A u r k a <aurka(at)centrum(dot)cz>, pgsql-novice(at)postgresql(dot)org
Subject: Re: How can I select a comment on a column in a query?
Date: 2004-01-19 15:41:46
Message-ID: 006301c3dea2$bf157ab0$6400a8c0@Dell4500
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Roman,

Comments are stored in the system catalog table pg_description. To select a
column comment ("description" in pg_description) you need the specify the
objoid for the table ("relfilenode" from pg_class for the table in question)
and the column number ("objsubid").

test=# select description from pg_description where objoid = 306461 and
objsubid = 0;

description
-----------------------------------
Weight Units~Unit~unitdescription
(1 row)

HTH,
George

----- Original Message -----
From: "A u r k a" <aurka(at)centrum(dot)cz>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Thursday, January 15, 2004 9:04 AM
Subject: [NOVICE] How can I select a comment on a column in a query?

> Hello,
>
> I have been going through the manuals for couple of hours looking for a
> way to select a comment on a column in a query. Can it be done (and used
> with php)?
>
> Thanks for any advice
>
> Roman Dergam
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-01-19 15:54:03 Re: How can I select a comment on a column in a query?
Previous Message glenn 2004-01-19 14:02:11 Re: Meta data about object in postgres