item descriptions in psql

Lists: pgsql-general
From: "J(dot) Roeleveld" <j(dot)roeleveld(at)softhome(dot)net>
To: <pgsql-general(at)postgreSQL(dot)org>
Cc: <j(dot)roeleveld(at)softhome(dot)net>
Subject: item descriptions in psql
Date: 1999-12-21 15:06:14
Message-ID: 004301bf4bc4$fd375b80$8402a8c0@sentec.demon.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

I just found a reference to descriptions to functions/tables/...etc.
and am now wondering how to add them myself?

Joost Roeleveld

ps. as an example of what I'm referring to:

mydb=> \dd currval
description
----------------------
sequence current value
(1 row)

mydb=> \dd mytable --- I want to enter a description for this......
description
--------------
no description
(1 row)


From: Mike Mascari <mascarm(at)mascari(dot)com>
To: "J(dot) Roeleveld" <j(dot)roeleveld(at)softhome(dot)net>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] item descriptions in psql
Date: 1999-12-21 16:20:37
Message-ID: 385FA8D5.39FB7CE0@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

"J. Roeleveld" wrote:
>
> Hi,
>
> I just found a reference to descriptions to functions/tables/...etc.
> and am now wondering how to add them myself?
>
> Joost Roeleveld
>
> ps. as an example of what I'm referring to:
>
> mydb=> \dd currval
> description
> ----------------------
> sequence current value
> (1 row)
>
> mydb=> \dd mytable --- I want to enter a description for this......
> description
> --------------
> no description
> (1 row)
>

In the next release, PostgreSQL will have the equivalent of
Oracle's COMMENT ON statement to allow for user comments of
various database schema objects. Until then, you have to
manually insert rows into pg_description with the oid of the
target object and the relevant comments:

emptoris=> select oid from pg_class where relname =
'webusers';
oid
------
155868
(1 row)

emptoris=> insert into pg_description values (155868,
'Webuser Information');
INSERT 182688 1

emptoris=> \dd webusers;
description
-------------------
Webuser Information
(1 row)

Hope that helps,

Mike Mascari