Re: Operator Comments

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Mike Mascari" <mascarm(at)mascari(dot)com>
Cc: "Rod Taylor" <rbt(at)zort(dot)ca>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Operator Comments
Date: 2002-06-05 20:28:46
Message-ID: D85C66DA59BA044EB96AB9683819CF61015325@dogbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: Bruce Momjian [mailto:pgman(at)candle(dot)pha(dot)pa(dot)us]
> Sent: 05 June 2002 21:00
> To: Mike Mascari
> Cc: Rod Taylor; Dave Page; pgsql-hackers(at)postgresql(dot)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.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-06-05 20:45:08 Re: Operator Comments
Previous Message Bruce Momjian 2002-06-05 20:05:02 Re: Roadmap for a Win32 port