postgrespro / pgsphere

PgSphere provides spherical data types, functions, operators, and indexing for PostgreSQL.
https://pgsphere.org
BSD 3-Clause "New" or "Revised" License
16 stars 15 forks source link

Operator `@` is incompatible with PG17 #85

Closed df7cb closed 8 months ago

df7cb commented 8 months ago

PG17 doesn't like the bigint @ smoc and smoc @ bigint operators:

+psql:pg_sphere.test.sql:9968: ERROR:  commutator operator @> is already the commutator of operator <@
+psql:pg_sphere.test.sql:9978: ERROR:  commutator operator @> is already the commutator of operator <@

This is from pgs_moc_compat.sql.in:

-- a minimal set of backwards-compatible operators for GAVO DaCHS,
-- see http://soft.g-vo.org/dachs

CREATE OPERATOR @ (
   LEFTARG    = bigint,
   RIGHTARG   = smoc,
   PROCEDURE  = healpix_subset_smoc,
   COMMUTATOR = '@>',
   NEGATOR    = '!<@',
   RESTRICT   = contsel,
   JOIN       = contjoinsel
);

CREATE OPERATOR @ (
   LEFTARG    = spoint,
   RIGHTARG   = smoc,
   PROCEDURE  = spoint_subset_smoc,
   COMMUTATOR = '@>',
   NEGATOR    = '!<@',
   RESTRICT   = contsel,
   JOIN       = contjoinsel
);

The IMHO best fix would be to drop the @ operator. Alternatively, we can drop the COMMUTATOR and NEGATOR clauses.

Comments?

Cc: @msdemlei

msdemlei commented 8 months ago

On Mon, Oct 23, 2023 at 04:30:24AM -0700, Christoph Berg wrote:

The IMHO best fix would be to drop the @ operator. Alternatively, we can drop the COMMUTATOR and NEGATOR clauses.

Yeah, let's drop it. I don't need them any more, and I'd certainly hope nobody else has taken it up in the meantime. I don't think it has ever been documented, has it?

df7cb commented 8 months ago

Upstream discussion: https://www.postgresql.org/message-id/flat/ZTfL1G1fBPQHVPWV%40msg.df7cb.de#ce3801c084bcf05b6b976cb2d0e25b2d

df7cb commented 8 months ago

The feedback from the PG discussion was mostly "what the heck are these operators doing there", so it seems best to indeed remove them from pgsphere. I just opened a PR to do just that.