Re: [PATCH] fix DROP OPERATOR to reset links to itself on commutator and negator - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] fix DROP OPERATOR to reset links to itself on commutator and negator
Date
Msg-id 10336.1458754912@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] fix DROP OPERATOR to reset links to itself on commutator and negator  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [PATCH] fix DROP OPERATOR to reset links to itself on commutator and negator
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Mar 23, 2016 at 12:27 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I'm also a bit dubious of the assumption in RemoveOperatorById that an
>> operator can't be its own negator.  Yeah, that should not be the case,
>> but if it is the case the deletion will fail outright.

> So what?  We've never guaranteed that things are going to work if you
> start by corrupting the catalogs, and I wouldn't pick this as a place
> to start.

I would not be worried except that it breaks a case that used to work,
as your test below demonstrates.

>> We could resolve both of these issues by changing the semantics of
>> OprUpdate so that it unconditionally does a CommandCounterIncrement
>> after each update that it performs.  IMO that would be a lot simpler
>> and more bulletproof; it'd allow removal of a lot of these
>> overly-tightly-reasoned cases.

> I tried this, but it did not seem to work.

Odd.  If you post the revised patch, I'll try to chase down what's wrong.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PostgreSQL 9.6 behavior change with set returning (funct).*
Next
From: Vladimir Sitnikov
Date:
Subject: Re: NOT EXIST for PREPARE