Re: [PATCH] Extend ALTER OPERATOR to support adding commutator, negator, hashes, and merges

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: Tommy Pavlicek <tommypav122(at)gmail(dot)com>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, jian(dot)universality(at)gmail(dot)com
Subject: Re: [PATCH] Extend ALTER OPERATOR to support adding commutator, negator, hashes, and merges
Date: 2023-10-24 15:16:54
Message-ID: 560086.1698160614@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christoph Berg <myon(at)debian(dot)org> writes:
> This change is breaking pgsphere which has <@ @> operator pairs, but
> for historical reasons also includes alternative spellings of these
> operators (both called @ with swapped operand types) which now
> explodes because we can't add them with the "proper" commutator and
> negators declared (which point to the canonical <@ @> !<@ !@>
> operators).

Should have guessed that somebody might be depending on the previous
squishy behavior. Still, I can't see how the above situation is a
good idea. Commutators/negators should come in pairs, not have
completely random links. I think it's only accidental that this
setup isn't triggering other strange behavior.

> We might be able to simply delete the @ operators, but doesn't this
> new check break the general possibility to have more than one spelling
> for the same operator?

You can have more than one operator atop the same function.
But why didn't you make the @ operators commutators of each other,
rather than this mess?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message José Neves 2023-10-24 15:21:33 RE: CDC/ETL system on top of logical replication with pgoutput, custom client
Previous Message Tom Lane 2023-10-24 15:07:29 Re: Replace references to malloc() in libpq documentation with generic language