Database Comments

Lists: pgsql-general
From: Mark Rae <mrae(at)purplebat(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Database Comments
Date: 2005-10-07 15:45:05
Message-ID: 20051007154504.GB31788@purplebat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

Using COMMENT ON DATABASE only allows you to create a comment
for your current database which is then only visible from that database.
However, if I manually insert appropriate values into pg_description
in other databases I can make comments appear for another database.

e.g. If some users have access to databases A,B&C, I can insert
values so that the users can see descriptions for each database
from any of them.

Is it safe to do this, or can it have unexpected side effects?

Also is there any intention to have a 'COMMENT ON [ROLE|USER|GROUP]'
facility. It would be quite useful to be able to do something like

COMMENT ON USER jbloggs IS 'Joe Bloggs <j(dot)bloggs(at)foo(dot)bar>'

-Mark


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Rae <mrae(at)purplebat(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Database Comments
Date: 2005-10-07 16:18:33
Message-ID: 5254.1128701913@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Mark Rae <mrae(at)purplebat(dot)com> writes:
> Using COMMENT ON DATABASE only allows you to create a comment
> for your current database which is then only visible from that database.
> ...
> Also is there any intention to have a 'COMMENT ON [ROLE|USER|GROUP]'
> facility.

There's been some discussion of creating a shared catalog for comments
on shared objects, which would let us fix the current bogus behavior
of COMMENT ON DATABASE and add comments on users/etc that weren't
equally bogus. Nobody's stepped up to make it happen though.

regards, tom lane