Re: Operator Comments - Mailing list pgsql-hackers

From Dave Page
Subject Re: Operator Comments
Date
Msg-id D85C66DA59BA044EB96AB9683819CF61015325@dogbert.vale-housing.co.uk
Whole thread Raw
In response to Operator Comments  ("Dave Page" <dpage@vale-housing.co.uk>)
Responses Re: Operator Comments  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers

> -----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.


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Roadmap for a Win32 port
Next
From: Bruce Momjian
Date:
Subject: Re: Operator Comments