Skip to content

Commit

Permalink
Alter spoint op family to add missed operator 17 (<->) (#121)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vitcpp authored Apr 22, 2024
1 parent 8394ae7 commit daa9478
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile.common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
#----------------------------------------------------------------------------

EXTENSION := pg_sphere
PGSPHERE_VERSION := 1.5.0
PGSPHERE_VERSION := 1.5.1
2 changes: 1 addition & 1 deletion expected/version.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
SELECT pg_sphere_version();
pg_sphere_version
-------------------
1.5.0
1.5.1
(1 row)

2 changes: 1 addition & 1 deletion pg_sphere.control
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions upgrade_scripts/pg_sphere--1.5.0--1.5.1.sql.in
Original file line number Diff line number Diff line change
@@ -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;
$$;

0 comments on commit daa9478

Please sign in to comment.