Skip to content

Commit 2d42b82

Browse files
committed
g_spoint3_fetch was already part of the spoint3 opclass in older versions
Allow upgrading of older installations (made pre 1.1.5) that already have g_spoint3_fetch in the spoint3 opclass. Close #82.
1 parent 1366e73 commit 2d42b82

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Diff for: upgrade_scripts/pg_sphere--1.3.1--1.3.2.sql.in

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
-- add "fetch" support function to enable index-only scans for spoint3
22

3-
ALTER OPERATOR FAMILY spoint3 USING gist ADD
4-
FUNCTION 9 (spoint, spoint) g_spoint3_fetch (internal);
3+
-- g_spoint3_fetch was already part of the spoint3 opclass in older versions
4+
-- around 1.0, but later made optional (see bdc37d1)
5+
6+
DO $$
7+
BEGIN
8+
ALTER OPERATOR FAMILY spoint3 USING gist ADD
9+
FUNCTION 9 (spoint, spoint) g_spoint3_fetch (internal);
10+
EXCEPTION
11+
WHEN duplicate_object THEN NULL;
12+
WHEN OTHERS THEN RAISE;
13+
END;
14+
$$;

0 commit comments

Comments
 (0)