From daa9478bcd1988d5934541b7e09b37a909d23b92 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Mon, 22 Apr 2024 09:22:05 +0300 Subject: [PATCH] Alter spoint op family to add missed operator 17 (<->) (#121) The upgrade script misses the altering of spoint operator family to add operator 17. It is required for k-NN search. Change the version to 1.5.1. --- Makefile | 6 +++++- Makefile.common.mk | 2 +- expected/version.out | 2 +- pg_sphere.control | 2 +- upgrade_scripts/pg_sphere--1.5.0--1.5.1.sql.in | 11 +++++++++++ 5 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 upgrade_scripts/pg_sphere--1.5.0--1.5.1.sql.in diff --git a/Makefile b/Makefile index 81dc57c..78f2dc5 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,8 @@ DATA_built = $(RELEASE_SQL) \ pg_sphere--1.3.1--1.4.0.sql \ pg_sphere--1.4.0--1.4.1.sql \ pg_sphere--1.4.1--1.4.2.sql \ - pg_sphere--1.4.2--1.5.0.sql + pg_sphere--1.4.2--1.5.0.sql \ + pg_sphere--1.5.0--1.5.1.sql DOCS = README.pg_sphere COPYRIGHT.pg_sphere TESTS = version tables points euler circle line ellipse poly path box \ @@ -214,6 +215,9 @@ pg_sphere--1.4.0--1.4.1.sql pg_sphere--1.4.1--1.4.2.sql: pg_sphere--1.4.2--1.5.0.sql: cat upgrade_scripts/$@.in $^ > $@ +pg_sphere--1.5.0--1.5.1.sql: + cat upgrade_scripts/$@.in $^ > $@ + # end of local stuff src/sscan.o : src/sparse.c diff --git a/Makefile.common.mk b/Makefile.common.mk index 7764d84..be82047 100644 --- a/Makefile.common.mk +++ b/Makefile.common.mk @@ -5,4 +5,4 @@ #---------------------------------------------------------------------------- EXTENSION := pg_sphere -PGSPHERE_VERSION := 1.5.0 +PGSPHERE_VERSION := 1.5.1 diff --git a/expected/version.out b/expected/version.out index 1d82d75..ffad8f5 100644 --- a/expected/version.out +++ b/expected/version.out @@ -2,6 +2,6 @@ SELECT pg_sphere_version(); pg_sphere_version ------------------- - 1.5.0 + 1.5.1 (1 row) diff --git a/pg_sphere.control b/pg_sphere.control index 4ecf4cd..1e73251 100644 --- a/pg_sphere.control +++ b/pg_sphere.control @@ -1,5 +1,5 @@ # pg_sphere extension comment = 'spherical objects with useful functions, operators and index support' -default_version = '1.5.0' +default_version = '1.5.1' module_pathname = '$libdir/pg_sphere' relocatable = true diff --git a/upgrade_scripts/pg_sphere--1.5.0--1.5.1.sql.in b/upgrade_scripts/pg_sphere--1.5.0--1.5.1.sql.in new file mode 100644 index 0000000..20c7cf6 --- /dev/null +++ b/upgrade_scripts/pg_sphere--1.5.0--1.5.1.sql.in @@ -0,0 +1,11 @@ +-- Upgrade: 1.5.0 -> 1.5.1 + +DO $$ +BEGIN + ALTER OPERATOR FAMILY spoint USING gist ADD + OPERATOR 17 <-> (spoint, spoint) FOR ORDER BY float_ops; +EXCEPTION + WHEN duplicate_object THEN NULL; + WHEN OTHERS THEN RAISE; +END; +$$;