Skip to content

Commit 0c4df71

Browse files
author
Markus Nullmeier
committed
add new contains operators '<@', '@>' to operator class definitions
1 parent 244c154 commit 0c4df71

File tree

2 files changed

+240
-1
lines changed

2 files changed

+240
-1
lines changed

gist.c

Lines changed: 180 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,24 @@ g_spoint_consistent(PG_FUNCTION_ARGS)
490490
case 16:
491491
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
492492
break;
493+
case 37:
494+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0);
495+
break;
496+
case 38:
497+
SCK_INTERLEAVE(SLine, sphereline_gen_key, 0);
498+
break;
499+
case 39:
500+
SCK_INTERLEAVE(SPATH, spherepath_gen_key, 0);
501+
break;
502+
case 40:
503+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0);
504+
break;
505+
case 41:
506+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0);
507+
break;
508+
case 42:
509+
SCK_INTERLEAVE(SBOX, spherebox_gen_key , 0);
510+
break;
493511
}
494512

495513
if (GIST_LEAF(entry))
@@ -751,6 +769,39 @@ g_scircle_consistent(PG_FUNCTION_ARGS)
751769
case 36:
752770
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
753771
break;
772+
case 37:
773+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0);
774+
break;
775+
case 38:
776+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0);
777+
break;
778+
case 39:
779+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0);
780+
break;
781+
case 40:
782+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
783+
break;
784+
case 43:
785+
SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1);
786+
break;
787+
case 44:
788+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1);
789+
break;
790+
case 45:
791+
SCK_INTERLEAVE(SLine, sphereline_gen_key, 1);
792+
break;
793+
case 46:
794+
SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1);
795+
break;
796+
case 47:
797+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1);
798+
break;
799+
case 48:
800+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1);
801+
break;
802+
case 49:
803+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1);
804+
break;
754805
}
755806

756807
if (GIST_LEAF(entry))
@@ -845,7 +896,21 @@ g_sline_consistent(PG_FUNCTION_ARGS)
845896
case 36:
846897
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1);
847898
break;
848-
899+
case 37:
900+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0);
901+
break;
902+
case 38:
903+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0);
904+
break;
905+
case 39:
906+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0);
907+
break;
908+
case 40:
909+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
910+
break;
911+
case 43:
912+
SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1);
913+
break;
849914
}
850915

851916
if (GIST_LEAF(entry))
@@ -939,6 +1004,21 @@ g_spath_consistent(PG_FUNCTION_ARGS)
9391004
case 36:
9401005
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1);
9411006
break;
1007+
case 37:
1008+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0);
1009+
break;
1010+
case 38:
1011+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0);
1012+
break;
1013+
case 39:
1014+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0);
1015+
break;
1016+
case 40:
1017+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
1018+
break;
1019+
case 43:
1020+
SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1);
1021+
break;
9421022
}
9431023

9441024
if (GIST_LEAF(entry))
@@ -1051,6 +1131,39 @@ g_spoly_consistent(PG_FUNCTION_ARGS)
10511131
case 36:
10521132
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
10531133
break;
1134+
case 37:
1135+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0);
1136+
break;
1137+
case 38:
1138+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0);
1139+
break;
1140+
case 39:
1141+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0);
1142+
break;
1143+
case 40:
1144+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
1145+
break;
1146+
case 43:
1147+
SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1);
1148+
break;
1149+
case 44:
1150+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1);
1151+
break;
1152+
case 45:
1153+
SCK_INTERLEAVE(SLine, sphereline_gen_key, 1);
1154+
break;
1155+
case 46:
1156+
SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1);
1157+
break;
1158+
case 47:
1159+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1);
1160+
break;
1161+
case 48:
1162+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1);
1163+
break;
1164+
case 49:
1165+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1);
1166+
break;
10541167
}
10551168

10561169
if (GIST_LEAF(entry))
@@ -1162,6 +1275,39 @@ g_sellipse_consistent(PG_FUNCTION_ARGS)
11621275
case 36:
11631276
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
11641277
break;
1278+
case 37:
1279+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0);
1280+
break;
1281+
case 38:
1282+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0);
1283+
break;
1284+
case 39:
1285+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0);
1286+
break;
1287+
case 40:
1288+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
1289+
break;
1290+
case 43:
1291+
SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1);
1292+
break;
1293+
case 44:
1294+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1);
1295+
break;
1296+
case 45:
1297+
SCK_INTERLEAVE(SLine, sphereline_gen_key, 1);
1298+
break;
1299+
case 46:
1300+
SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1);
1301+
break;
1302+
case 47:
1303+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1);
1304+
break;
1305+
case 48:
1306+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1);
1307+
break;
1308+
case 49:
1309+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1);
1310+
break;
11651311
}
11661312

11671313
if (GIST_LEAF(entry))
@@ -1273,6 +1419,39 @@ g_sbox_consistent(PG_FUNCTION_ARGS)
12731419
case 36:
12741420
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
12751421
break;
1422+
case 37:
1423+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0);
1424+
break;
1425+
case 38:
1426+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0);
1427+
break;
1428+
case 39:
1429+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0);
1430+
break;
1431+
case 40:
1432+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0);
1433+
break;
1434+
case 43:
1435+
SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1);
1436+
break;
1437+
case 44:
1438+
SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1);
1439+
break;
1440+
case 45:
1441+
SCK_INTERLEAVE(SLine, sphereline_gen_key, 1);
1442+
break;
1443+
case 46:
1444+
SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1);
1445+
break;
1446+
case 47:
1447+
SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1);
1448+
break;
1449+
case 48:
1450+
SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1);
1451+
break;
1452+
case 49:
1453+
SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1);
1454+
break;
12761455
}
12771456

12781457
if (GIST_LEAF(entry))

pgs_gist.sql.in

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ CREATE OPERATOR CLASS spoint
113113
OPERATOR 14 @ (spoint, spoly),
114114
OPERATOR 15 @ (spoint, sellipse),
115115
OPERATOR 16 @ (spoint, sbox),
116+
OPERATOR 37 <@ (spoint, scircle),
117+
OPERATOR 38 <@ (spoint, sline),
118+
OPERATOR 39 <@ (spoint, spath),
119+
OPERATOR 40 <@ (spoint, spoly),
120+
OPERATOR 41 <@ (spoint, sellipse),
121+
OPERATOR 42 <@ (spoint, sbox),
116122
FUNCTION 1 g_spoint_consistent (internal, internal, int4, oid, internal),
117123
FUNCTION 2 g_spherekey_union (bytea, internal),
118124
FUNCTION 3 g_spoint_compress (internal),
@@ -212,6 +218,17 @@ CREATE OPERATOR CLASS scircle
212218
OPERATOR 34 && (scircle, spoly),
213219
OPERATOR 35 && (scircle, sellipse),
214220
OPERATOR 36 && (scircle, sbox),
221+
OPERATOR 37 <@ (scircle, scircle),
222+
OPERATOR 38 <@ (scircle, spoly),
223+
OPERATOR 39 <@ (scircle, sellipse),
224+
OPERATOR 40 <@ (scircle, sbox),
225+
OPERATOR 43 @> (scircle, spoint),
226+
OPERATOR 44 @> (scircle, scircle),
227+
OPERATOR 45 @> (scircle, sline),
228+
OPERATOR 46 @> (scircle, spath),
229+
OPERATOR 47 @> (scircle, spoly),
230+
OPERATOR 48 @> (scircle, sellipse),
231+
OPERATOR 49 @> (scircle, sbox),
215232
FUNCTION 1 g_scircle_consistent (internal, internal, int4, oid, internal),
216233
FUNCTION 2 g_spherekey_union (bytea, internal),
217234
FUNCTION 3 g_scircle_compress (internal),
@@ -251,6 +268,11 @@ CREATE OPERATOR CLASS sline
251268
OPERATOR 34 && (sline, spoly),
252269
OPERATOR 35 && (sline, sellipse),
253270
OPERATOR 36 && (sline, sbox),
271+
OPERATOR 37 <@ (sline, scircle),
272+
OPERATOR 38 <@ (sline, spoly),
273+
OPERATOR 39 <@ (sline, sellipse),
274+
OPERATOR 40 <@ (sline, sbox),
275+
OPERATOR 43 @> (sline, spoint),
254276
FUNCTION 1 g_sline_consistent (internal, internal, int4, oid, internal),
255277
FUNCTION 2 g_spherekey_union (bytea, internal),
256278
FUNCTION 3 g_sline_compress (internal),
@@ -292,6 +314,17 @@ CREATE OPERATOR CLASS sellipse
292314
OPERATOR 34 && (sellipse, spoly),
293315
OPERATOR 35 && (sellipse, sellipse),
294316
OPERATOR 36 && (sellipse, sbox),
317+
OPERATOR 37 <@ (sellipse, scircle),
318+
OPERATOR 38 <@ (sellipse, spoly),
319+
OPERATOR 39 <@ (sellipse, sellipse),
320+
OPERATOR 40 <@ (sellipse, sbox),
321+
OPERATOR 43 @> (sellipse, spoint),
322+
OPERATOR 44 @> (sellipse, scircle),
323+
OPERATOR 45 @> (sellipse, sline),
324+
OPERATOR 46 @> (sellipse, spath),
325+
OPERATOR 47 @> (sellipse, spoly),
326+
OPERATOR 48 @> (sellipse, sellipse),
327+
OPERATOR 49 @> (sellipse, sbox),
295328
FUNCTION 1 g_sellipse_consistent (internal, internal, int4, oid, internal),
296329
FUNCTION 2 g_spherekey_union (bytea, internal),
297330
FUNCTION 3 g_sellipse_compress (internal),
@@ -334,6 +367,17 @@ CREATE OPERATOR CLASS spoly
334367
OPERATOR 34 && (spoly, spoly),
335368
OPERATOR 35 && (spoly, sellipse),
336369
OPERATOR 36 && (spoly, sbox),
370+
OPERATOR 37 <@ (spoly, scircle),
371+
OPERATOR 38 <@ (spoly, spoly),
372+
OPERATOR 39 <@ (spoly, sellipse),
373+
OPERATOR 40 <@ (spoly, sbox),
374+
OPERATOR 43 @> (spoly, spoint),
375+
OPERATOR 44 @> (spoly, scircle),
376+
OPERATOR 45 @> (spoly, sline),
377+
OPERATOR 46 @> (spoly, spath),
378+
OPERATOR 47 @> (spoly, spoly),
379+
OPERATOR 48 @> (spoly, sellipse),
380+
OPERATOR 49 @> (spoly, sbox),
337381
FUNCTION 1 g_spoly_consistent (internal, internal, int4, oid, internal),
338382
FUNCTION 2 g_spherekey_union (bytea, internal),
339383
FUNCTION 3 g_spoly_compress (internal),
@@ -371,6 +415,11 @@ CREATE OPERATOR CLASS spath
371415
OPERATOR 34 && (spath, spoly),
372416
OPERATOR 35 && (spath, sellipse),
373417
OPERATOR 36 && (spath, sbox),
418+
OPERATOR 37 <@ (spath, scircle),
419+
OPERATOR 38 <@ (spath, spoly),
420+
OPERATOR 39 <@ (spath, sellipse),
421+
OPERATOR 40 <@ (spath, sbox),
422+
OPERATOR 43 @> (spath, spoint),
374423
FUNCTION 1 g_spath_consistent (internal, internal, int4, oid, internal),
375424
FUNCTION 2 g_spherekey_union (bytea, internal),
376425
FUNCTION 3 g_spath_compress (internal),
@@ -413,6 +462,17 @@ CREATE OPERATOR CLASS sbox
413462
OPERATOR 34 && (sbox, spoly),
414463
OPERATOR 35 && (sbox, sellipse),
415464
OPERATOR 36 && (sbox, sbox),
465+
OPERATOR 37 <@ (sbox, scircle),
466+
OPERATOR 38 <@ (sbox, spoly),
467+
OPERATOR 39 <@ (sbox, sellipse),
468+
OPERATOR 40 <@ (sbox, sbox),
469+
OPERATOR 43 @> (sbox, spoint),
470+
OPERATOR 44 @> (sbox, scircle),
471+
OPERATOR 45 @> (sbox, sline),
472+
OPERATOR 46 @> (sbox, spath),
473+
OPERATOR 47 @> (sbox, spoly),
474+
OPERATOR 48 @> (sbox, sellipse),
475+
OPERATOR 49 @> (sbox, sbox),
416476
FUNCTION 1 g_sbox_consistent (internal, internal, int4, oid, internal),
417477
FUNCTION 2 g_spherekey_union (bytea, internal),
418478
FUNCTION 3 g_sbox_compress (internal),

0 commit comments

Comments
 (0)