It would be wonderful to be able to create comments
on users and groups.  In particular, I need a place
to store the user's name.  Yes, I could make a user
table, but that seems overkill as all of the other
aspects of a user are already in the metadata.

Best,

Clark
-- 
Clark C. Evans                     Prometheus Research, LLC
Chief Technology Officer           Turning Data Into Knowledge
cce@prometheusresearch.com         www.prometheusresearch.com
(main) 203.777.2550                (cell) 203.444.0557

Mon, 8 Mar 2004 14:13:01 -0500
"Clark C. Evans" <cce@clarkevans.com>
COMMENT ON [GROUP/USER]
"Clark C. Evans" <cce@clarkevans.com> writes:
> It would be wonderful to be able to create comments
> on users and groups.  In particular, I need a place
> to store the user's name.  Yes, I could make a user
> table, but that seems overkill as all of the other
> aspects of a user are already in the metadata.

This seems like a good idea, but I'd recommend leaving it as a TODO
until after we finish the planned revisions for SQL role support.
(Peter E. has made noises about working on that, but I dunno what
his timeframe for it is.)  In particular, it's not clear that there
will still be a hard and fast separation between "users" and "groups"
after that happens, so it seems premature to wire such an assumption
into the syntax.

Another small problem that would have to be faced is that users and
groups don't have OIDs.  We could physically get away with a type-cheat
of storing their integer IDs into pg_description instead, but I'm worried
that would create issues of its own.

			regards, tom lane

Mon, 08 Mar 2004 14:25:06 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: COMMENT ON [GROUP/USER] 
Tom Lane wrote:
> "Clark C. Evans" <cce@clarkevans.com> writes:
> > It would be wonderful to be able to create comments
> > on users and groups.  In particular, I need a place
> > to store the user's name.  Yes, I could make a user
> > table, but that seems overkill as all of the other
> > aspects of a user are already in the metadata.
> 
> This seems like a good idea, but I'd recommend leaving it as a TODO
> until after we finish the planned revisions for SQL role support.
> (Peter E. has made noises about working on that, but I dunno what
> his timeframe for it is.)  In particular, it's not clear that there
> will still be a hard and fast separation between "users" and "groups"
> after that happens, so it seems premature to wire such an assumption
> into the syntax.
> 
> Another small problem that would have to be faced is that users and
> groups don't have OIDs.  We could physically get away with a type-cheat
> of storing their integer IDs into pg_description instead, but I'm worried
> that would create issues of its own.

Another problem is that pg_description is per-database, while
pg_user/group are global for all databases.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Mon, 8 Mar 2004 14:36:01 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: COMMENT ON [GROUP/USER]
Bruce Momjian wrote:

>Another problem is that pg_description is per-database, while
>pg_user/group are global for all databases.
>
>  
>
databases are also per cluster, but we have comments on those.

Could we keep the user/group comments in those tables instead of in 
pg_description?

cheers

andrew

Mon, 08 Mar 2004 14:46:21 -0500
Andrew Dunstan <andrew@dunslane.net>
Re: COMMENT ON [GROUP/USER]
It's rumoured that Andrew Dunstan once said:
> Bruce Momjian wrote:
>
>>Another problem is that pg_description is per-database, while
>>pg_user/group are global for all databases.
>>
>>
>>
> databases are also per cluster, but we have comments on those.
>
> Could we keep the user/group comments in those tables instead of in
> pg_description?

Ahh, just like they used to live in pg_language.lancompiler for languages :-)

Regards, Dave




Mon, 8 Mar 2004 19:55:14 -0000 (GMT)
"Dave Page" <dpage@vale-housing.co.uk>
Re: COMMENT ON [GROUP/USER]
Andrew Dunstan wrote:
> Bruce Momjian wrote:
> 
>> Another problem is that pg_description is per-database, while
>> pg_user/group are global for all databases.
>>
>>  
>>
> databases are also per cluster, but we have comments on those.
> 
> Could we keep the user/group comments in those tables instead of in 
> pg_description?

The comments are stored only in the database's pg_description where 
the COMMENT ON took place. This caused dump/reload problems. I 
believe Rod Taylor added the new warning:

[estore@lexus] select count(*) from pg_description;
  count
-------
   1541
(1 row)

[estore@lexus] COMMENT ON DATABASE test IS 'Hello';
WARNING:  database comments may only be applied to the current database
COMMENT

[estore@lexus] select count(*) from pg_description;
  count
-------
   1541
(1 row)

[estore@lexus] COMMENT ON DATABASE estore IS 'A good comment';
COMMENT

[estore@lexus] select count(*) from pg_description;
  count
-------
   1542
(1 row)

[test@lexus] select count(*) from pg_description;
  count
-------
   1541
(1 row)


Mike Mascari


Mon, 08 Mar 2004 15:20:17 -0500
Mike Mascari <mascarm@mascari.com>
Re: COMMENT ON [GROUP/USER]

This doesn't look good.  If we throw a WARNING, why do we not insert
anything into pg_description.  Seems we should throw an error, or do the
insert with a warning.

---------------------------------------------------------------------------

Mike Mascari wrote:
> Andrew Dunstan wrote:
> > Bruce Momjian wrote:
> > 
> >> Another problem is that pg_description is per-database, while
> >> pg_user/group are global for all databases.
> >>
> >>  
> >>
> > databases are also per cluster, but we have comments on those.
> > 
> > Could we keep the user/group comments in those tables instead of in 
> > pg_description?
> 
> The comments are stored only in the database's pg_description where 
> the COMMENT ON took place. This caused dump/reload problems. I 
> believe Rod Taylor added the new warning:
> 
> [estore@lexus] select count(*) from pg_description;
>   count
> -------
>    1541
> (1 row)
> 
> [estore@lexus] COMMENT ON DATABASE test IS 'Hello';
> WARNING:  database comments may only be applied to the current database
> COMMENT
> 
> [estore@lexus] select count(*) from pg_description;
>   count
> -------
>    1541
> (1 row)
> 
> [estore@lexus] COMMENT ON DATABASE estore IS 'A good comment';
> COMMENT
> 
> [estore@lexus] select count(*) from pg_description;
>   count
> -------
>    1542
> (1 row)
> 
> [test@lexus] select count(*) from pg_description;
>   count
> -------
>    1541
> (1 row)
> 
> 
> Mike Mascari
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Mon, 8 Mar 2004 15:46:27 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: COMMENT ON [GROUP/USER]
On Mon, 2004-03-08 at 14:46, Andrew Dunstan wrote:
> Bruce Momjian wrote:
> 
> >Another problem is that pg_description is per-database, while
> >pg_user/group are global for all databases.
> >
> >  
> >
> databases are also per cluster, but we have comments on those.
> 
> Could we keep the user/group comments in those tables instead of in 
> pg_description?

Comments longer than ~7k would need a toast table. At the moment, toast
tables don't work on a global basis.



Mon, 08 Mar 2004 15:56:06 -0500
Rod Taylor <pg@rbt.ca>
Re: COMMENT ON [GROUP/USER]
Bruce Momjian wrote:

> This doesn't look good.  If we throw a WARNING, why do we not insert
> anything into pg_description.  Seems we should throw an error, or do the
> insert with a warning.

It essentially makes the behavior deprecated and allows dumps to be 
restored properly (without the extra-database comments.) Here's a 
thread on the topic:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=bf1obi%24u7k%241%40FreeBSD.csie.NCTU.edu.tw&rnum=7&prev=/groups%3Fq%3D%2522COMMENT%2BON%2BDATABASE%2522%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den

I don't know if Rod has plans to change attempts to COMMENT ON 
non-local databases to an ERROR in 7.5 or not. It was my fault from 
the beginning - but once I'd implemented COMMENT ON for tables and 
columns I just couldn't stop... :-)

Mike Mascari

> Mike Mascari wrote:
..
>>The comments are stored only in the database's pg_description where 
>>the COMMENT ON took place. This caused dump/reload problems. I 
>>believe Rod Taylor added the new warning:
>>
>>[estore@lexus] select count(*) from pg_description;
>>  count
>>-------
>>   1541
>>(1 row)
>>
>>[estore@lexus] COMMENT ON DATABASE test IS 'Hello';
>>WARNING:  database comments may only be applied to the current database
>>COMMENT
>>
>>[estore@lexus] select count(*) from pg_description;
>>  count
>>-------
>>   1541
>>(1 row)


Mon, 08 Mar 2004 16:10:59 -0500
Mike Mascari <mascarm@mascari.com>
Re: COMMENT ON [GROUP/USER]
Rod Taylor wrote:

>On Mon, 2004-03-08 at 14:46, Andrew Dunstan wrote:
>  
>
>>Bruce Momjian wrote:
>>
>>    
>>
>>>Another problem is that pg_description is per-database, while
>>>pg_user/group are global for all databases.
>>>
>>> 
>>>
>>>      
>>>
>>databases are also per cluster, but we have comments on those.
>>
>>Could we keep the user/group comments in those tables instead of in 
>>pg_description?
>>    
>>
>
>Comments longer than ~7k would need a toast table. At the moment, toast
>tables don't work on a global basis.
>
>  
>

Well, presumably we don't want to keep their life story ;-)

I was just thinking out loud I guess - I see there are wrinkles I hadn't 
considered.

cheers

andrew

Mon, 08 Mar 2004 16:18:31 -0500
Andrew Dunstan <andrew@dunslane.net>
Re: COMMENT ON [GROUP/USER]
Rod Taylor <pg@rbt.ca> writes:
> Comments longer than ~7k would need a toast table. At the moment, toast
> tables don't work on a global basis.

Sure they do ... in fact, all the shared catalogs have one.

I think the idea of putting comments directly into pg_shadow and friends
is too icky to consider, though.  If we really wanted to support this
stuff then we'd make *one* shared table that is just like
pg_description, but is used for shared objects.

			regards, tom lane

Mon, 08 Mar 2004 16:24:30 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: COMMENT ON [GROUP/USER] 
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> This doesn't look good.  If we throw a WARNING, why do we not insert
> anything into pg_description.  Seems we should throw an error, or do the
> insert with a warning.

Throwing an error breaks existing pg_dump files.  Doing the insertion is
simply wrong: it will allow the former breakage to be perpetuated
forward by dump/reload.  Thus the current behavior is an unfortunate but
necessary compromise ... at least until we have better support for
comments on databases.

			regards, tom lane

Mon, 08 Mar 2004 16:34:37 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: COMMENT ON [GROUP/USER] 
On Mon, Mar 08, 2004 at 04:24:30PM -0500, Tom Lane wrote:

> I think the idea of putting comments directly into pg_shadow and friends
> is too icky to consider, though.  If we really wanted to support this
> stuff then we'd make *one* shared table that is just like
> pg_description, but is used for shared objects.

Hey, a pg_sdescription could be followed by a pg_sdepend to hold
dependency information for global objects (users ATM) ...

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Las mujeres son como hondas:  mientras m�s resistencia tienen,
 m�s lejos puedes llegar con ellas"  (Jonas Nightingale, Leap of Faith)

Thu, 11 Mar 2004 18:25:25 -0300
Alvaro Herrera Munoz <alvherre@dcc.uchile.cl>
Re: COMMENT ON [GROUP/USER]