Skip to content

Operator @ is incompatible with PG17 #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
df7cb opened this issue Oct 23, 2023 · 3 comments · Fixed by #92
Closed

Operator @ is incompatible with PG17 #85

df7cb opened this issue Oct 23, 2023 · 3 comments · Fixed by #92

Comments

@df7cb
Copy link
Contributor

df7cb commented Oct 23, 2023

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
Copy link
Contributor

msdemlei commented Oct 23, 2023 via email

@df7cb
Copy link
Contributor Author

df7cb commented Oct 24, 2023

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

df7cb added a commit to cybertec-postgresql/pgsphere that referenced this issue Oct 26, 2023
These were required by GAVO DaCHS, but are not used anymore.
Furthermore, PG17 will forbid declaring commutators and negators
relations with operators that themselves have relations to different
operators.

We delete pgs_moc_compat.sql.in and remove it from the old
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql upgrade script. This is ok
to do since dropping the operators uses "if exists".

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

Close postgrespro#85.
df7cb added a commit to cybertec-postgresql/pgsphere that referenced this issue Oct 26, 2023
These were required by GAVO DaCHS, but are not used anymore.
Furthermore, PG17 will forbid declaring commutators and negators
relations with operators that themselves have relations to different
operators.

We delete pgs_moc_compat.sql.in and remove it from the old
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql upgrade script. This is ok
to do since dropping the operators uses "if exists".

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

Close postgrespro#85.
@df7cb
Copy link
Contributor Author

df7cb commented Oct 26, 2023

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.

df7cb added a commit to cybertec-postgresql/pgsphere that referenced this issue Oct 26, 2023
These were required by GAVO DaCHS, but are not used anymore.
Furthermore, PG17 will forbid declaring commutators and negators
relations with operators that themselves have relations to different
operators.

We delete pgs_moc_compat.sql.in and remove it from the old
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql upgrade script. This is ok
to do since dropping the operators uses "if exists".

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

Close postgrespro#85.
df7cb added a commit to cybertec-postgresql/pgsphere that referenced this issue Oct 27, 2023
These were required by GAVO DaCHS, but are not used anymore.
Furthermore, PG17 will forbid declaring commutators and negators
relations with operators that themselves have relations to different
operators.

We delete pgs_moc_compat.sql.in and remove it from the old
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql upgrade script. This is ok
to do since dropping the operators uses "if exists".

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

Close postgrespro#85.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants