Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvHoZ-004LN7-MY for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Oct 2023 13:51:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qvHoX-007zug-O4 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Oct 2023 13:51:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvHoX-007zuX-EX for pgsql-hackers@lists.postgresql.org; Tue, 24 Oct 2023 13:51:22 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvHoU-002Suq-8e for pgsql-hackers@lists.postgresql.org; Tue, 24 Oct 2023 13:51:21 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1482:3660:b7d0:f584:a987:bc23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 4SFD450Nh9z3Fvp; Tue, 24 Oct 2023 15:51:17 +0200 (CEST) Date: Tue, 24 Oct 2023 15:51:16 +0200 From: Christoph Berg To: Tommy Pavlicek Cc: Tom Lane , Dagfinn Ilmari =?iso-8859-1?Q?Manns=E5ker?= , pgsql-hackers@lists.postgresql.org, Tomas Vondra , jian.universality@gmail.com Subject: Re: [PATCH] Extend ALTER OPERATOR to support adding commutator, negator, hashes, and merges Message-ID: References: <4077062.1687452468@sss.pgh.pa.us> <87r0q3qvxd.fsf@wibble.ilmari.org> <4082750.1687455374@sss.pgh.pa.us> <15382.1687519306@sss.pgh.pa.us> <1092363.1695932314@sss.pgh.pa.us> <447166.1696969927@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Re: Tommy Pavlicek > I've added another patch (0002-require_unused_neg_com-v1.patch) that > prevents using a commutator or negator that's already part of a pair. Hmm. I agree with the general idea of adding sanity checks, but this might be overzealous: 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). https://github.com/postgrespro/pgsphere/blob/master/pgs_moc_compat.sql.in 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? Christoph