

> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us] 
> Sent: 05 June 2002 21:00
> To: Mike Mascari
> Cc: Rod Taylor; Dave Page; pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] Operator Comments
> 
> 
> Mike Mascari wrote:
> > Here's the history, FWIW:
> > 
> > I implemented COMMENT ON for just TABLES and COLUMNS, like Oracle.
> > 
> > Bruce requested it for all objects
> > 
> > I extended for all objects - including databases (my bad) ;-)
> > 
> > Peter E. was rewriting psql and wanted the COMMENT on operators to 
> > reflect a COMMENT on the underlying function
> > 
> > I submitted a patch to do that - I just do what I'm told ;-)
> 
> Actually, the use of function comments for operators goes 
> back to when I added comments to system tables in 
> include/catalog.  I wanted to avoid duplication of comments 
> so I placed them only on the functions and let the operators 
> display the function comments.  Were there cases where we 
> don't want the function comments for certain operators?  I 
> never anticipated that.
> 
> Anyway, I looked at the new psql code and it works fine, 
> tries pg_operator description first, then pg_proc if missing.

The problem that I found was that if you update the comment on an
operator (a trivial task in pgAdmin which is what I was coding at the
time) it updates the comment on the underlying function - not so good as
the new comment may no longer make sense when read from the perspective
of the function. Of course, if the function can be used by different
operators or even for other uses, then this situation is more likely to
occur.

Defaulting to the functions comment sounds OK, but I think an update
should be stored against the operators oid, not the functions.

Regards, Dave.

Wed, 5 Jun 2002 21:28:46 +0100
"Dave Page" <dpage@vale-housing.co.uk>
Re: Operator Comments
Dave Page wrote:
> The problem that I found was that if you update the comment on an
> operator (a trivial task in pgAdmin which is what I was coding at the
> time) it updates the comment on the underlying function - not so good as
> the new comment may no longer make sense when read from the perspective
> of the function. Of course, if the function can be used by different
> operators or even for other uses, then this situation is more likely to
> occur.
> 
> Defaulting to the functions comment sounds OK, but I think an update
> should be stored against the operators oid, not the functions.

Yes, agreed.  Operator-specific comments are better, if that is what is
specirfied by the user.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Wed, 5 Jun 2002 16:45:08 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Operator Comments