Re: todo: comment field for pg users and groups

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: todo: comment field for pg users and groups
Date: 2004-09-22 13:04:24
Message-ID: 20040922130424.GB13732@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 22, 2004 at 01:15:42PM +0200, Fabien COELHO wrote:

> As I'm managing accounts for students... I noticed that there does not
> seem to be a proper way to keep a comment about a postgresql user account,
> such as the full name of the student or its email, that I could see with
> \du or some system query. My solution is to keep the "mapping" somewhere
> else, but having that in the database directly, just like the gecos field
> in a unix password file, would help managing the stuff.
>
> Thus I would suggest to add one new text field in pg_group and pg_shadow
> for this purpose, that could be initialized with something like:
>
> CREATE USER calvin COMMENT 'Calvin <calvin(at)comics(dot)org>';
>
> Alternatively, it could be managed with "COMMENT ON ..."? Well, users or
> groups are not really database objects... so it does not really fit.

One problem is that pg_comment, where comments are held, is not a shared
relation. So if comments are stored there, they would not show up in
other databases if you change, drop or add them. The same applies to
databases and tablespaces, and that's why there's a warning emitted when
you add a comment to a database.

There have been noises of adding a new catalog for keeping comments for
shared objects (which would itself be shared, of course). I'm not sure
what the rationale is for not putting them in the pg_shadow catalog.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"There was no reply" (Kernel Traffic)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2004-09-22 13:06:03 Re: elog in 7.4
Previous Message Laszlo Hornyak 2004-09-22 13:02:22 Re: elog in 7.4