Only skip pages marked as clean in the visibility map, if the last 32
[PostgreSQL.git] / contrib / btree_gist / btree_gist.sql.in
blobc66536157a9ea76c371ff883802d924823815c4a
1 /* $PostgreSQL$ */
3 -- Adjust this setting to control where the objects get created.
4 SET search_path = public;
6 CREATE OR REPLACE FUNCTION gbtreekey4_in(cstring)
7 RETURNS gbtreekey4
8 AS 'MODULE_PATHNAME', 'gbtreekey_in'
9 LANGUAGE C IMMUTABLE STRICT;
11 CREATE OR REPLACE FUNCTION gbtreekey4_out(gbtreekey4)
12 RETURNS cstring
13 AS 'MODULE_PATHNAME', 'gbtreekey_out'
14 LANGUAGE C IMMUTABLE STRICT;
16 CREATE TYPE gbtreekey4 (
17 INTERNALLENGTH = 4,
18 INPUT = gbtreekey4_in,
19 OUTPUT = gbtreekey4_out
22 CREATE OR REPLACE FUNCTION gbtreekey8_in(cstring)
23 RETURNS gbtreekey8
24 AS 'MODULE_PATHNAME', 'gbtreekey_in'
25 LANGUAGE C IMMUTABLE STRICT;
27 CREATE OR REPLACE FUNCTION gbtreekey8_out(gbtreekey8)
28 RETURNS cstring
29 AS 'MODULE_PATHNAME', 'gbtreekey_out'
30 LANGUAGE C IMMUTABLE STRICT;
32 CREATE TYPE gbtreekey8 (
33 INTERNALLENGTH = 8,
34 INPUT = gbtreekey8_in,
35 OUTPUT = gbtreekey8_out
38 CREATE OR REPLACE FUNCTION gbtreekey16_in(cstring)
39 RETURNS gbtreekey16
40 AS 'MODULE_PATHNAME', 'gbtreekey_in'
41 LANGUAGE C IMMUTABLE STRICT;
43 CREATE OR REPLACE FUNCTION gbtreekey16_out(gbtreekey16)
44 RETURNS cstring
45 AS 'MODULE_PATHNAME', 'gbtreekey_out'
46 LANGUAGE C IMMUTABLE STRICT;
48 CREATE TYPE gbtreekey16 (
49 INTERNALLENGTH = 16,
50 INPUT = gbtreekey16_in,
51 OUTPUT = gbtreekey16_out
54 CREATE OR REPLACE FUNCTION gbtreekey32_in(cstring)
55 RETURNS gbtreekey32
56 AS 'MODULE_PATHNAME', 'gbtreekey_in'
57 LANGUAGE C IMMUTABLE STRICT;
59 CREATE OR REPLACE FUNCTION gbtreekey32_out(gbtreekey32)
60 RETURNS cstring
61 AS 'MODULE_PATHNAME', 'gbtreekey_out'
62 LANGUAGE C IMMUTABLE STRICT;
64 CREATE TYPE gbtreekey32 (
65 INTERNALLENGTH = 32,
66 INPUT = gbtreekey32_in,
67 OUTPUT = gbtreekey32_out
70 CREATE OR REPLACE FUNCTION gbtreekey_var_in(cstring)
71 RETURNS gbtreekey_var
72 AS 'MODULE_PATHNAME', 'gbtreekey_in'
73 LANGUAGE C IMMUTABLE STRICT;
75 CREATE OR REPLACE FUNCTION gbtreekey_var_out(gbtreekey_var)
76 RETURNS cstring
77 AS 'MODULE_PATHNAME', 'gbtreekey_out'
78 LANGUAGE C IMMUTABLE STRICT;
80 CREATE TYPE gbtreekey_var (
81 INTERNALLENGTH = VARIABLE,
82 INPUT = gbtreekey_var_in,
83 OUTPUT = gbtreekey_var_out,
84 STORAGE = EXTENDED
92 -- oid ops
96 -- define the GiST support methods
97 CREATE OR REPLACE FUNCTION gbt_oid_consistent(internal,oid,int2,oid,internal)
98 RETURNS bool
99 AS 'MODULE_PATHNAME'
100 LANGUAGE C IMMUTABLE;
102 CREATE OR REPLACE FUNCTION gbt_oid_compress(internal)
103 RETURNS internal
104 AS 'MODULE_PATHNAME'
105 LANGUAGE C IMMUTABLE;
107 CREATE OR REPLACE FUNCTION gbt_decompress(internal)
108 RETURNS internal
109 AS 'MODULE_PATHNAME'
110 LANGUAGE C IMMUTABLE;
112 CREATE OR REPLACE FUNCTION gbt_var_decompress(internal)
113 RETURNS internal
114 AS 'MODULE_PATHNAME'
115 LANGUAGE C IMMUTABLE;
117 CREATE OR REPLACE FUNCTION gbt_oid_penalty(internal,internal,internal)
118 RETURNS internal
119 AS 'MODULE_PATHNAME'
120 LANGUAGE C IMMUTABLE STRICT;
122 CREATE OR REPLACE FUNCTION gbt_oid_picksplit(internal, internal)
123 RETURNS internal
124 AS 'MODULE_PATHNAME'
125 LANGUAGE C IMMUTABLE;
127 CREATE OR REPLACE FUNCTION gbt_oid_union(bytea, internal)
128 RETURNS gbtreekey8
129 AS 'MODULE_PATHNAME'
130 LANGUAGE C IMMUTABLE;
132 CREATE OR REPLACE FUNCTION gbt_oid_same(internal, internal, internal)
133 RETURNS internal
134 AS 'MODULE_PATHNAME'
135 LANGUAGE C IMMUTABLE;
137 -- Create the operator class
138 CREATE OPERATOR CLASS gist_oid_ops
139 DEFAULT FOR TYPE oid USING gist
141 OPERATOR 1 < ,
142 OPERATOR 2 <= ,
143 OPERATOR 3 = ,
144 OPERATOR 4 >= ,
145 OPERATOR 5 > ,
146 FUNCTION 1 gbt_oid_consistent (internal, oid, int2, oid, internal),
147 FUNCTION 2 gbt_oid_union (bytea, internal),
148 FUNCTION 3 gbt_oid_compress (internal),
149 FUNCTION 4 gbt_decompress (internal),
150 FUNCTION 5 gbt_oid_penalty (internal, internal, internal),
151 FUNCTION 6 gbt_oid_picksplit (internal, internal),
152 FUNCTION 7 gbt_oid_same (internal, internal, internal),
153 STORAGE gbtreekey8;
159 -- int2 ops
163 -- define the GiST support methods
164 CREATE OR REPLACE FUNCTION gbt_int2_consistent(internal,int2,int2,oid,internal)
165 RETURNS bool
166 AS 'MODULE_PATHNAME'
167 LANGUAGE C IMMUTABLE;
169 CREATE OR REPLACE FUNCTION gbt_int2_compress(internal)
170 RETURNS internal
171 AS 'MODULE_PATHNAME'
172 LANGUAGE C IMMUTABLE;
174 CREATE OR REPLACE FUNCTION gbt_int2_penalty(internal,internal,internal)
175 RETURNS internal
176 AS 'MODULE_PATHNAME'
177 LANGUAGE C IMMUTABLE STRICT;
179 CREATE OR REPLACE FUNCTION gbt_int2_picksplit(internal, internal)
180 RETURNS internal
181 AS 'MODULE_PATHNAME'
182 LANGUAGE C IMMUTABLE;
184 CREATE OR REPLACE FUNCTION gbt_int2_union(bytea, internal)
185 RETURNS gbtreekey4
186 AS 'MODULE_PATHNAME'
187 LANGUAGE C IMMUTABLE;
189 CREATE OR REPLACE FUNCTION gbt_int2_same(internal, internal, internal)
190 RETURNS internal
191 AS 'MODULE_PATHNAME'
192 LANGUAGE C IMMUTABLE;
194 -- Create the operator class
195 CREATE OPERATOR CLASS gist_int2_ops
196 DEFAULT FOR TYPE int2 USING gist
198 OPERATOR 1 < ,
199 OPERATOR 2 <= ,
200 OPERATOR 3 = ,
201 OPERATOR 4 >= ,
202 OPERATOR 5 > ,
203 FUNCTION 1 gbt_int2_consistent (internal, int2, int2, oid, internal),
204 FUNCTION 2 gbt_int2_union (bytea, internal),
205 FUNCTION 3 gbt_int2_compress (internal),
206 FUNCTION 4 gbt_decompress (internal),
207 FUNCTION 5 gbt_int2_penalty (internal, internal, internal),
208 FUNCTION 6 gbt_int2_picksplit (internal, internal),
209 FUNCTION 7 gbt_int2_same (internal, internal, internal),
210 STORAGE gbtreekey4;
215 -- int4 ops
219 -- define the GiST support methods
220 CREATE OR REPLACE FUNCTION gbt_int4_consistent(internal,int4,int2,oid,internal)
221 RETURNS bool
222 AS 'MODULE_PATHNAME'
223 LANGUAGE C IMMUTABLE;
225 CREATE OR REPLACE FUNCTION gbt_int4_compress(internal)
226 RETURNS internal
227 AS 'MODULE_PATHNAME'
228 LANGUAGE C IMMUTABLE;
230 CREATE OR REPLACE FUNCTION gbt_int4_penalty(internal,internal,internal)
231 RETURNS internal
232 AS 'MODULE_PATHNAME'
233 LANGUAGE C IMMUTABLE STRICT;
235 CREATE OR REPLACE FUNCTION gbt_int4_picksplit(internal, internal)
236 RETURNS internal
237 AS 'MODULE_PATHNAME'
238 LANGUAGE C IMMUTABLE;
240 CREATE OR REPLACE FUNCTION gbt_int4_union(bytea, internal)
241 RETURNS gbtreekey8
242 AS 'MODULE_PATHNAME'
243 LANGUAGE C IMMUTABLE;
245 CREATE OR REPLACE FUNCTION gbt_int4_same(internal, internal, internal)
246 RETURNS internal
247 AS 'MODULE_PATHNAME'
248 LANGUAGE C IMMUTABLE;
250 -- Create the operator class
251 CREATE OPERATOR CLASS gist_int4_ops
252 DEFAULT FOR TYPE int4 USING gist
254 OPERATOR 1 < ,
255 OPERATOR 2 <= ,
256 OPERATOR 3 = ,
257 OPERATOR 4 >= ,
258 OPERATOR 5 > ,
259 FUNCTION 1 gbt_int4_consistent (internal, int4, int2, oid, internal),
260 FUNCTION 2 gbt_int4_union (bytea, internal),
261 FUNCTION 3 gbt_int4_compress (internal),
262 FUNCTION 4 gbt_decompress (internal),
263 FUNCTION 5 gbt_int4_penalty (internal, internal, internal),
264 FUNCTION 6 gbt_int4_picksplit (internal, internal),
265 FUNCTION 7 gbt_int4_same (internal, internal, internal),
266 STORAGE gbtreekey8;
271 -- int8 ops
275 -- define the GiST support methods
276 CREATE OR REPLACE FUNCTION gbt_int8_consistent(internal,int8,int2,oid,internal)
277 RETURNS bool
278 AS 'MODULE_PATHNAME'
279 LANGUAGE C IMMUTABLE;
281 CREATE OR REPLACE FUNCTION gbt_int8_compress(internal)
282 RETURNS internal
283 AS 'MODULE_PATHNAME'
284 LANGUAGE C IMMUTABLE;
286 CREATE OR REPLACE FUNCTION gbt_int8_penalty(internal,internal,internal)
287 RETURNS internal
288 AS 'MODULE_PATHNAME'
289 LANGUAGE C IMMUTABLE STRICT;
291 CREATE OR REPLACE FUNCTION gbt_int8_picksplit(internal, internal)
292 RETURNS internal
293 AS 'MODULE_PATHNAME'
294 LANGUAGE C IMMUTABLE;
296 CREATE OR REPLACE FUNCTION gbt_int8_union(bytea, internal)
297 RETURNS gbtreekey16
298 AS 'MODULE_PATHNAME'
299 LANGUAGE C IMMUTABLE;
301 CREATE OR REPLACE FUNCTION gbt_int8_same(internal, internal, internal)
302 RETURNS internal
303 AS 'MODULE_PATHNAME'
304 LANGUAGE C IMMUTABLE;
306 -- Create the operator class
307 CREATE OPERATOR CLASS gist_int8_ops
308 DEFAULT FOR TYPE int8 USING gist
310 OPERATOR 1 < ,
311 OPERATOR 2 <= ,
312 OPERATOR 3 = ,
313 OPERATOR 4 >= ,
314 OPERATOR 5 > ,
315 FUNCTION 1 gbt_int8_consistent (internal, int8, int2, oid, internal),
316 FUNCTION 2 gbt_int8_union (bytea, internal),
317 FUNCTION 3 gbt_int8_compress (internal),
318 FUNCTION 4 gbt_decompress (internal),
319 FUNCTION 5 gbt_int8_penalty (internal, internal, internal),
320 FUNCTION 6 gbt_int8_picksplit (internal, internal),
321 FUNCTION 7 gbt_int8_same (internal, internal, internal),
322 STORAGE gbtreekey16;
328 -- float4 ops
332 -- define the GiST support methods
333 CREATE OR REPLACE FUNCTION gbt_float4_consistent(internal,float4,int2,oid,internal)
334 RETURNS bool
335 AS 'MODULE_PATHNAME'
336 LANGUAGE C IMMUTABLE;
338 CREATE OR REPLACE FUNCTION gbt_float4_compress(internal)
339 RETURNS internal
340 AS 'MODULE_PATHNAME'
341 LANGUAGE C IMMUTABLE;
343 CREATE OR REPLACE FUNCTION gbt_float4_penalty(internal,internal,internal)
344 RETURNS internal
345 AS 'MODULE_PATHNAME'
346 LANGUAGE C IMMUTABLE STRICT;
348 CREATE OR REPLACE FUNCTION gbt_float4_picksplit(internal, internal)
349 RETURNS internal
350 AS 'MODULE_PATHNAME'
351 LANGUAGE C IMMUTABLE;
353 CREATE OR REPLACE FUNCTION gbt_float4_union(bytea, internal)
354 RETURNS gbtreekey8
355 AS 'MODULE_PATHNAME'
356 LANGUAGE C IMMUTABLE;
358 CREATE OR REPLACE FUNCTION gbt_float4_same(internal, internal, internal)
359 RETURNS internal
360 AS 'MODULE_PATHNAME'
361 LANGUAGE C IMMUTABLE;
363 -- Create the operator class
364 CREATE OPERATOR CLASS gist_float4_ops
365 DEFAULT FOR TYPE float4 USING gist
367 OPERATOR 1 < ,
368 OPERATOR 2 <= ,
369 OPERATOR 3 = ,
370 OPERATOR 4 >= ,
371 OPERATOR 5 > ,
372 FUNCTION 1 gbt_float4_consistent (internal, float4, int2, oid, internal),
373 FUNCTION 2 gbt_float4_union (bytea, internal),
374 FUNCTION 3 gbt_float4_compress (internal),
375 FUNCTION 4 gbt_decompress (internal),
376 FUNCTION 5 gbt_float4_penalty (internal, internal, internal),
377 FUNCTION 6 gbt_float4_picksplit (internal, internal),
378 FUNCTION 7 gbt_float4_same (internal, internal, internal),
379 STORAGE gbtreekey8;
387 -- float8 ops
391 -- define the GiST support methods
392 CREATE OR REPLACE FUNCTION gbt_float8_consistent(internal,float8,int2,oid,internal)
393 RETURNS bool
394 AS 'MODULE_PATHNAME'
395 LANGUAGE C IMMUTABLE;
397 CREATE OR REPLACE FUNCTION gbt_float8_compress(internal)
398 RETURNS internal
399 AS 'MODULE_PATHNAME'
400 LANGUAGE C IMMUTABLE;
402 CREATE OR REPLACE FUNCTION gbt_float8_penalty(internal,internal,internal)
403 RETURNS internal
404 AS 'MODULE_PATHNAME'
405 LANGUAGE C IMMUTABLE STRICT;
407 CREATE OR REPLACE FUNCTION gbt_float8_picksplit(internal, internal)
408 RETURNS internal
409 AS 'MODULE_PATHNAME'
410 LANGUAGE C IMMUTABLE;
412 CREATE OR REPLACE FUNCTION gbt_float8_union(bytea, internal)
413 RETURNS gbtreekey16
414 AS 'MODULE_PATHNAME'
415 LANGUAGE C IMMUTABLE;
417 CREATE OR REPLACE FUNCTION gbt_float8_same(internal, internal, internal)
418 RETURNS internal
419 AS 'MODULE_PATHNAME'
420 LANGUAGE C IMMUTABLE;
422 -- Create the operator class
423 CREATE OPERATOR CLASS gist_float8_ops
424 DEFAULT FOR TYPE float8 USING gist
426 OPERATOR 1 < ,
427 OPERATOR 2 <= ,
428 OPERATOR 3 = ,
429 OPERATOR 4 >= ,
430 OPERATOR 5 > ,
431 FUNCTION 1 gbt_float8_consistent (internal, float8, int2, oid, internal),
432 FUNCTION 2 gbt_float8_union (bytea, internal),
433 FUNCTION 3 gbt_float8_compress (internal),
434 FUNCTION 4 gbt_decompress (internal),
435 FUNCTION 5 gbt_float8_penalty (internal, internal, internal),
436 FUNCTION 6 gbt_float8_picksplit (internal, internal),
437 FUNCTION 7 gbt_float8_same (internal, internal, internal),
438 STORAGE gbtreekey16;
444 -- timestamp ops
449 CREATE OR REPLACE FUNCTION gbt_ts_consistent(internal,timestamp,int2,oid,internal)
450 RETURNS bool
451 AS 'MODULE_PATHNAME'
452 LANGUAGE C IMMUTABLE;
454 CREATE OR REPLACE FUNCTION gbt_tstz_consistent(internal,timestamptz,int2,oid,internal)
455 RETURNS bool
456 AS 'MODULE_PATHNAME'
457 LANGUAGE C IMMUTABLE;
459 CREATE OR REPLACE FUNCTION gbt_ts_compress(internal)
460 RETURNS internal
461 AS 'MODULE_PATHNAME'
462 LANGUAGE C IMMUTABLE;
464 CREATE OR REPLACE FUNCTION gbt_tstz_compress(internal)
465 RETURNS internal
466 AS 'MODULE_PATHNAME'
467 LANGUAGE C IMMUTABLE;
469 CREATE OR REPLACE FUNCTION gbt_ts_penalty(internal,internal,internal)
470 RETURNS internal
471 AS 'MODULE_PATHNAME'
472 LANGUAGE C IMMUTABLE STRICT;
474 CREATE OR REPLACE FUNCTION gbt_ts_picksplit(internal, internal)
475 RETURNS internal
476 AS 'MODULE_PATHNAME'
477 LANGUAGE C IMMUTABLE;
479 CREATE OR REPLACE FUNCTION gbt_ts_union(bytea, internal)
480 RETURNS gbtreekey16
481 AS 'MODULE_PATHNAME'
482 LANGUAGE C IMMUTABLE;
484 CREATE OR REPLACE FUNCTION gbt_ts_same(internal, internal, internal)
485 RETURNS internal
486 AS 'MODULE_PATHNAME'
487 LANGUAGE C IMMUTABLE;
489 -- Create the operator class
490 CREATE OPERATOR CLASS gist_timestamp_ops
491 DEFAULT FOR TYPE timestamp USING gist
493 OPERATOR 1 < ,
494 OPERATOR 2 <= ,
495 OPERATOR 3 = ,
496 OPERATOR 4 >= ,
497 OPERATOR 5 > ,
498 FUNCTION 1 gbt_ts_consistent (internal, timestamp, int2, oid, internal),
499 FUNCTION 2 gbt_ts_union (bytea, internal),
500 FUNCTION 3 gbt_ts_compress (internal),
501 FUNCTION 4 gbt_decompress (internal),
502 FUNCTION 5 gbt_ts_penalty (internal, internal, internal),
503 FUNCTION 6 gbt_ts_picksplit (internal, internal),
504 FUNCTION 7 gbt_ts_same (internal, internal, internal),
505 STORAGE gbtreekey16;
508 -- Create the operator class
509 CREATE OPERATOR CLASS gist_timestamptz_ops
510 DEFAULT FOR TYPE timestamptz USING gist
512 OPERATOR 1 < ,
513 OPERATOR 2 <= ,
514 OPERATOR 3 = ,
515 OPERATOR 4 >= ,
516 OPERATOR 5 > ,
517 FUNCTION 1 gbt_tstz_consistent (internal, timestamptz, int2, oid, internal),
518 FUNCTION 2 gbt_ts_union (bytea, internal),
519 FUNCTION 3 gbt_tstz_compress (internal),
520 FUNCTION 4 gbt_decompress (internal),
521 FUNCTION 5 gbt_ts_penalty (internal, internal, internal),
522 FUNCTION 6 gbt_ts_picksplit (internal, internal),
523 FUNCTION 7 gbt_ts_same (internal, internal, internal),
524 STORAGE gbtreekey16;
530 -- time ops
535 CREATE OR REPLACE FUNCTION gbt_time_consistent(internal,time,int2,oid,internal)
536 RETURNS bool
537 AS 'MODULE_PATHNAME'
538 LANGUAGE C IMMUTABLE;
540 CREATE OR REPLACE FUNCTION gbt_timetz_consistent(internal,timetz,int2,oid,internal)
541 RETURNS bool
542 AS 'MODULE_PATHNAME'
543 LANGUAGE C IMMUTABLE;
545 CREATE OR REPLACE FUNCTION gbt_time_compress(internal)
546 RETURNS internal
547 AS 'MODULE_PATHNAME'
548 LANGUAGE C IMMUTABLE;
550 CREATE OR REPLACE FUNCTION gbt_timetz_compress(internal)
551 RETURNS internal
552 AS 'MODULE_PATHNAME'
553 LANGUAGE C IMMUTABLE;
555 CREATE OR REPLACE FUNCTION gbt_time_penalty(internal,internal,internal)
556 RETURNS internal
557 AS 'MODULE_PATHNAME'
558 LANGUAGE C IMMUTABLE STRICT;
560 CREATE OR REPLACE FUNCTION gbt_time_picksplit(internal, internal)
561 RETURNS internal
562 AS 'MODULE_PATHNAME'
563 LANGUAGE C IMMUTABLE;
565 CREATE OR REPLACE FUNCTION gbt_time_union(bytea, internal)
566 RETURNS gbtreekey16
567 AS 'MODULE_PATHNAME'
568 LANGUAGE C IMMUTABLE;
570 CREATE OR REPLACE FUNCTION gbt_time_same(internal, internal, internal)
571 RETURNS internal
572 AS 'MODULE_PATHNAME'
573 LANGUAGE C IMMUTABLE;
575 -- Create the operator class
576 CREATE OPERATOR CLASS gist_time_ops
577 DEFAULT FOR TYPE time USING gist
579 OPERATOR 1 < ,
580 OPERATOR 2 <= ,
581 OPERATOR 3 = ,
582 OPERATOR 4 >= ,
583 OPERATOR 5 > ,
584 FUNCTION 1 gbt_time_consistent (internal, time, int2, oid, internal),
585 FUNCTION 2 gbt_time_union (bytea, internal),
586 FUNCTION 3 gbt_time_compress (internal),
587 FUNCTION 4 gbt_decompress (internal),
588 FUNCTION 5 gbt_time_penalty (internal, internal, internal),
589 FUNCTION 6 gbt_time_picksplit (internal, internal),
590 FUNCTION 7 gbt_time_same (internal, internal, internal),
591 STORAGE gbtreekey16;
593 CREATE OPERATOR CLASS gist_timetz_ops
594 DEFAULT FOR TYPE timetz USING gist
596 OPERATOR 1 < ,
597 OPERATOR 2 <= ,
598 OPERATOR 3 = ,
599 OPERATOR 4 >= ,
600 OPERATOR 5 > ,
601 FUNCTION 1 gbt_timetz_consistent (internal, timetz, int2, oid, internal),
602 FUNCTION 2 gbt_time_union (bytea, internal),
603 FUNCTION 3 gbt_timetz_compress (internal),
604 FUNCTION 4 gbt_decompress (internal),
605 FUNCTION 5 gbt_time_penalty (internal, internal, internal),
606 FUNCTION 6 gbt_time_picksplit (internal, internal),
607 FUNCTION 7 gbt_time_same (internal, internal, internal),
608 STORAGE gbtreekey16;
614 -- date ops
619 CREATE OR REPLACE FUNCTION gbt_date_consistent(internal,date,int2,oid,internal)
620 RETURNS bool
621 AS 'MODULE_PATHNAME'
622 LANGUAGE C IMMUTABLE;
624 CREATE OR REPLACE FUNCTION gbt_date_compress(internal)
625 RETURNS internal
626 AS 'MODULE_PATHNAME'
627 LANGUAGE C IMMUTABLE;
629 CREATE OR REPLACE FUNCTION gbt_date_penalty(internal,internal,internal)
630 RETURNS internal
631 AS 'MODULE_PATHNAME'
632 LANGUAGE C IMMUTABLE STRICT;
634 CREATE OR REPLACE FUNCTION gbt_date_picksplit(internal, internal)
635 RETURNS internal
636 AS 'MODULE_PATHNAME'
637 LANGUAGE C IMMUTABLE;
639 CREATE OR REPLACE FUNCTION gbt_date_union(bytea, internal)
640 RETURNS gbtreekey8
641 AS 'MODULE_PATHNAME'
642 LANGUAGE C IMMUTABLE;
644 CREATE OR REPLACE FUNCTION gbt_date_same(internal, internal, internal)
645 RETURNS internal
646 AS 'MODULE_PATHNAME'
647 LANGUAGE C IMMUTABLE;
649 -- Create the operator class
650 CREATE OPERATOR CLASS gist_date_ops
651 DEFAULT FOR TYPE date USING gist
653 OPERATOR 1 < ,
654 OPERATOR 2 <= ,
655 OPERATOR 3 = ,
656 OPERATOR 4 >= ,
657 OPERATOR 5 > ,
658 FUNCTION 1 gbt_date_consistent (internal, date, int2, oid, internal),
659 FUNCTION 2 gbt_date_union (bytea, internal),
660 FUNCTION 3 gbt_date_compress (internal),
661 FUNCTION 4 gbt_decompress (internal),
662 FUNCTION 5 gbt_date_penalty (internal, internal, internal),
663 FUNCTION 6 gbt_date_picksplit (internal, internal),
664 FUNCTION 7 gbt_date_same (internal, internal, internal),
665 STORAGE gbtreekey8;
671 -- interval ops
676 CREATE OR REPLACE FUNCTION gbt_intv_consistent(internal,interval,int2,oid,internal)
677 RETURNS bool
678 AS 'MODULE_PATHNAME'
679 LANGUAGE C IMMUTABLE;
681 CREATE OR REPLACE FUNCTION gbt_intv_compress(internal)
682 RETURNS internal
683 AS 'MODULE_PATHNAME'
684 LANGUAGE C IMMUTABLE;
686 CREATE OR REPLACE FUNCTION gbt_intv_decompress(internal)
687 RETURNS internal
688 AS 'MODULE_PATHNAME'
689 LANGUAGE C IMMUTABLE;
691 CREATE OR REPLACE FUNCTION gbt_intv_penalty(internal,internal,internal)
692 RETURNS internal
693 AS 'MODULE_PATHNAME'
694 LANGUAGE C IMMUTABLE STRICT;
696 CREATE OR REPLACE FUNCTION gbt_intv_picksplit(internal, internal)
697 RETURNS internal
698 AS 'MODULE_PATHNAME'
699 LANGUAGE C IMMUTABLE;
701 CREATE OR REPLACE FUNCTION gbt_intv_union(bytea, internal)
702 RETURNS gbtreekey32
703 AS 'MODULE_PATHNAME'
704 LANGUAGE C IMMUTABLE;
706 CREATE OR REPLACE FUNCTION gbt_intv_same(internal, internal, internal)
707 RETURNS internal
708 AS 'MODULE_PATHNAME'
709 LANGUAGE C IMMUTABLE;
711 -- Create the operator class
712 CREATE OPERATOR CLASS gist_interval_ops
713 DEFAULT FOR TYPE interval USING gist
715 OPERATOR 1 < ,
716 OPERATOR 2 <= ,
717 OPERATOR 3 = ,
718 OPERATOR 4 >= ,
719 OPERATOR 5 > ,
720 FUNCTION 1 gbt_intv_consistent (internal, interval, int2, oid, internal),
721 FUNCTION 2 gbt_intv_union (bytea, internal),
722 FUNCTION 3 gbt_intv_compress (internal),
723 FUNCTION 4 gbt_intv_decompress (internal),
724 FUNCTION 5 gbt_intv_penalty (internal, internal, internal),
725 FUNCTION 6 gbt_intv_picksplit (internal, internal),
726 FUNCTION 7 gbt_intv_same (internal, internal, internal),
727 STORAGE gbtreekey32;
732 -- cash ops
736 -- define the GiST support methods
737 CREATE OR REPLACE FUNCTION gbt_cash_consistent(internal,money,int2,oid,internal)
738 RETURNS bool
739 AS 'MODULE_PATHNAME'
740 LANGUAGE C IMMUTABLE;
742 CREATE OR REPLACE FUNCTION gbt_cash_compress(internal)
743 RETURNS internal
744 AS 'MODULE_PATHNAME'
745 LANGUAGE C IMMUTABLE;
747 CREATE OR REPLACE FUNCTION gbt_cash_penalty(internal,internal,internal)
748 RETURNS internal
749 AS 'MODULE_PATHNAME'
750 LANGUAGE C IMMUTABLE STRICT;
752 CREATE OR REPLACE FUNCTION gbt_cash_picksplit(internal, internal)
753 RETURNS internal
754 AS 'MODULE_PATHNAME'
755 LANGUAGE C IMMUTABLE;
757 CREATE OR REPLACE FUNCTION gbt_cash_union(bytea, internal)
758 RETURNS gbtreekey8
759 AS 'MODULE_PATHNAME'
760 LANGUAGE C IMMUTABLE;
762 CREATE OR REPLACE FUNCTION gbt_cash_same(internal, internal, internal)
763 RETURNS internal
764 AS 'MODULE_PATHNAME'
765 LANGUAGE C IMMUTABLE;
767 -- Create the operator class
768 CREATE OPERATOR CLASS gist_cash_ops
769 DEFAULT FOR TYPE money USING gist
771 OPERATOR 1 < ,
772 OPERATOR 2 <= ,
773 OPERATOR 3 = ,
774 OPERATOR 4 >= ,
775 OPERATOR 5 > ,
776 FUNCTION 1 gbt_cash_consistent (internal, money, int2, oid, internal),
777 FUNCTION 2 gbt_cash_union (bytea, internal),
778 FUNCTION 3 gbt_cash_compress (internal),
779 FUNCTION 4 gbt_decompress (internal),
780 FUNCTION 5 gbt_cash_penalty (internal, internal, internal),
781 FUNCTION 6 gbt_cash_picksplit (internal, internal),
782 FUNCTION 7 gbt_cash_same (internal, internal, internal),
783 STORAGE gbtreekey16;
788 -- macaddr ops
792 -- define the GiST support methods
793 CREATE OR REPLACE FUNCTION gbt_macad_consistent(internal,macaddr,int2,oid,internal)
794 RETURNS bool
795 AS 'MODULE_PATHNAME'
796 LANGUAGE C IMMUTABLE;
798 CREATE OR REPLACE FUNCTION gbt_macad_compress(internal)
799 RETURNS internal
800 AS 'MODULE_PATHNAME'
801 LANGUAGE C IMMUTABLE;
803 CREATE OR REPLACE FUNCTION gbt_macad_penalty(internal,internal,internal)
804 RETURNS internal
805 AS 'MODULE_PATHNAME'
806 LANGUAGE C IMMUTABLE STRICT;
808 CREATE OR REPLACE FUNCTION gbt_macad_picksplit(internal, internal)
809 RETURNS internal
810 AS 'MODULE_PATHNAME'
811 LANGUAGE C IMMUTABLE;
813 CREATE OR REPLACE FUNCTION gbt_macad_union(bytea, internal)
814 RETURNS gbtreekey16
815 AS 'MODULE_PATHNAME'
816 LANGUAGE C IMMUTABLE;
818 CREATE OR REPLACE FUNCTION gbt_macad_same(internal, internal, internal)
819 RETURNS internal
820 AS 'MODULE_PATHNAME'
821 LANGUAGE C IMMUTABLE;
823 -- Create the operator class
824 CREATE OPERATOR CLASS gist_macaddr_ops
825 DEFAULT FOR TYPE macaddr USING gist
827 OPERATOR 1 < ,
828 OPERATOR 2 <= ,
829 OPERATOR 3 = ,
830 OPERATOR 4 >= ,
831 OPERATOR 5 > ,
832 FUNCTION 1 gbt_macad_consistent (internal, macaddr, int2, oid, internal),
833 FUNCTION 2 gbt_macad_union (bytea, internal),
834 FUNCTION 3 gbt_macad_compress (internal),
835 FUNCTION 4 gbt_decompress (internal),
836 FUNCTION 5 gbt_macad_penalty (internal, internal, internal),
837 FUNCTION 6 gbt_macad_picksplit (internal, internal),
838 FUNCTION 7 gbt_macad_same (internal, internal, internal),
839 STORAGE gbtreekey16;
846 -- text/ bpchar ops
850 -- define the GiST support methods
851 CREATE OR REPLACE FUNCTION gbt_text_consistent(internal,text,int2,oid,internal)
852 RETURNS bool
853 AS 'MODULE_PATHNAME'
854 LANGUAGE C IMMUTABLE;
856 CREATE OR REPLACE FUNCTION gbt_bpchar_consistent(internal,bpchar,int2,oid,internal)
857 RETURNS bool
858 AS 'MODULE_PATHNAME'
859 LANGUAGE C IMMUTABLE;
861 CREATE OR REPLACE FUNCTION gbt_text_compress(internal)
862 RETURNS internal
863 AS 'MODULE_PATHNAME'
864 LANGUAGE C IMMUTABLE;
866 CREATE OR REPLACE FUNCTION gbt_bpchar_compress(internal)
867 RETURNS internal
868 AS 'MODULE_PATHNAME'
869 LANGUAGE C IMMUTABLE;
871 CREATE OR REPLACE FUNCTION gbt_text_penalty(internal,internal,internal)
872 RETURNS internal
873 AS 'MODULE_PATHNAME'
874 LANGUAGE C IMMUTABLE STRICT;
876 CREATE OR REPLACE FUNCTION gbt_text_picksplit(internal, internal)
877 RETURNS internal
878 AS 'MODULE_PATHNAME'
879 LANGUAGE C IMMUTABLE;
881 CREATE OR REPLACE FUNCTION gbt_text_union(bytea, internal)
882 RETURNS gbtreekey_var
883 AS 'MODULE_PATHNAME'
884 LANGUAGE C IMMUTABLE;
886 CREATE OR REPLACE FUNCTION gbt_text_same(internal, internal, internal)
887 RETURNS internal
888 AS 'MODULE_PATHNAME'
889 LANGUAGE C IMMUTABLE;
891 -- Create the operator class
892 CREATE OPERATOR CLASS gist_text_ops
893 DEFAULT FOR TYPE text USING gist
895 OPERATOR 1 < ,
896 OPERATOR 2 <= ,
897 OPERATOR 3 = ,
898 OPERATOR 4 >= ,
899 OPERATOR 5 > ,
900 FUNCTION 1 gbt_text_consistent (internal, text, int2, oid, internal),
901 FUNCTION 2 gbt_text_union (bytea, internal),
902 FUNCTION 3 gbt_text_compress (internal),
903 FUNCTION 4 gbt_var_decompress (internal),
904 FUNCTION 5 gbt_text_penalty (internal, internal, internal),
905 FUNCTION 6 gbt_text_picksplit (internal, internal),
906 FUNCTION 7 gbt_text_same (internal, internal, internal),
907 STORAGE gbtreekey_var;
910 ---- Create the operator class
911 CREATE OPERATOR CLASS gist_bpchar_ops
912 DEFAULT FOR TYPE bpchar USING gist
914 OPERATOR 1 < ,
915 OPERATOR 2 <= ,
916 OPERATOR 3 = ,
917 OPERATOR 4 >= ,
918 OPERATOR 5 > ,
919 FUNCTION 1 gbt_bpchar_consistent (internal, bpchar , int2, oid, internal),
920 FUNCTION 2 gbt_text_union (bytea, internal),
921 FUNCTION 3 gbt_bpchar_compress (internal),
922 FUNCTION 4 gbt_var_decompress (internal),
923 FUNCTION 5 gbt_text_penalty (internal, internal, internal),
924 FUNCTION 6 gbt_text_picksplit (internal, internal),
925 FUNCTION 7 gbt_text_same (internal, internal, internal),
926 STORAGE gbtreekey_var;
932 -- bytea ops
936 -- define the GiST support methods
937 CREATE OR REPLACE FUNCTION gbt_bytea_consistent(internal,bytea,int2,oid,internal)
938 RETURNS bool
939 AS 'MODULE_PATHNAME'
940 LANGUAGE C IMMUTABLE;
942 CREATE OR REPLACE FUNCTION gbt_bytea_compress(internal)
943 RETURNS internal
944 AS 'MODULE_PATHNAME'
945 LANGUAGE C IMMUTABLE;
947 CREATE OR REPLACE FUNCTION gbt_bytea_penalty(internal,internal,internal)
948 RETURNS internal
949 AS 'MODULE_PATHNAME'
950 LANGUAGE C IMMUTABLE STRICT;
952 CREATE OR REPLACE FUNCTION gbt_bytea_picksplit(internal, internal)
953 RETURNS internal
954 AS 'MODULE_PATHNAME'
955 LANGUAGE C IMMUTABLE;
957 CREATE OR REPLACE FUNCTION gbt_bytea_union(bytea, internal)
958 RETURNS gbtreekey_var
959 AS 'MODULE_PATHNAME'
960 LANGUAGE C IMMUTABLE;
962 CREATE OR REPLACE FUNCTION gbt_bytea_same(internal, internal, internal)
963 RETURNS internal
964 AS 'MODULE_PATHNAME'
965 LANGUAGE C IMMUTABLE;
967 -- Create the operator class
968 CREATE OPERATOR CLASS gist_bytea_ops
969 DEFAULT FOR TYPE bytea USING gist
971 OPERATOR 1 < ,
972 OPERATOR 2 <= ,
973 OPERATOR 3 = ,
974 OPERATOR 4 >= ,
975 OPERATOR 5 > ,
976 FUNCTION 1 gbt_bytea_consistent (internal, bytea, int2, oid, internal),
977 FUNCTION 2 gbt_bytea_union (bytea, internal),
978 FUNCTION 3 gbt_bytea_compress (internal),
979 FUNCTION 4 gbt_var_decompress (internal),
980 FUNCTION 5 gbt_bytea_penalty (internal, internal, internal),
981 FUNCTION 6 gbt_bytea_picksplit (internal, internal),
982 FUNCTION 7 gbt_bytea_same (internal, internal, internal),
983 STORAGE gbtreekey_var;
989 -- numeric ops
993 -- define the GiST support methods
994 CREATE OR REPLACE FUNCTION gbt_numeric_consistent(internal,numeric,int2,oid,internal)
995 RETURNS bool
996 AS 'MODULE_PATHNAME'
997 LANGUAGE C IMMUTABLE;
999 CREATE OR REPLACE FUNCTION gbt_numeric_compress(internal)
1000 RETURNS internal
1001 AS 'MODULE_PATHNAME'
1002 LANGUAGE C IMMUTABLE;
1004 CREATE OR REPLACE FUNCTION gbt_numeric_penalty(internal,internal,internal)
1005 RETURNS internal
1006 AS 'MODULE_PATHNAME'
1007 LANGUAGE C IMMUTABLE STRICT;
1009 CREATE OR REPLACE FUNCTION gbt_numeric_picksplit(internal, internal)
1010 RETURNS internal
1011 AS 'MODULE_PATHNAME'
1012 LANGUAGE C IMMUTABLE;
1014 CREATE OR REPLACE FUNCTION gbt_numeric_union(bytea, internal)
1015 RETURNS gbtreekey_var
1016 AS 'MODULE_PATHNAME'
1017 LANGUAGE C IMMUTABLE;
1019 CREATE OR REPLACE FUNCTION gbt_numeric_same(internal, internal, internal)
1020 RETURNS internal
1021 AS 'MODULE_PATHNAME'
1022 LANGUAGE C IMMUTABLE;
1024 -- Create the operator class
1025 CREATE OPERATOR CLASS gist_numeric_ops
1026 DEFAULT FOR TYPE numeric USING gist
1028 OPERATOR 1 < ,
1029 OPERATOR 2 <= ,
1030 OPERATOR 3 = ,
1031 OPERATOR 4 >= ,
1032 OPERATOR 5 > ,
1033 FUNCTION 1 gbt_numeric_consistent (internal, numeric, int2, oid, internal),
1034 FUNCTION 2 gbt_numeric_union (bytea, internal),
1035 FUNCTION 3 gbt_numeric_compress (internal),
1036 FUNCTION 4 gbt_var_decompress (internal),
1037 FUNCTION 5 gbt_numeric_penalty (internal, internal, internal),
1038 FUNCTION 6 gbt_numeric_picksplit (internal, internal),
1039 FUNCTION 7 gbt_numeric_same (internal, internal, internal),
1040 STORAGE gbtreekey_var;
1044 -- bit ops
1048 -- define the GiST support methods
1049 CREATE OR REPLACE FUNCTION gbt_bit_consistent(internal,bit,int2,oid,internal)
1050 RETURNS bool
1051 AS 'MODULE_PATHNAME'
1052 LANGUAGE C IMMUTABLE;
1054 CREATE OR REPLACE FUNCTION gbt_bit_compress(internal)
1055 RETURNS internal
1056 AS 'MODULE_PATHNAME'
1057 LANGUAGE C IMMUTABLE;
1059 CREATE OR REPLACE FUNCTION gbt_bit_penalty(internal,internal,internal)
1060 RETURNS internal
1061 AS 'MODULE_PATHNAME'
1062 LANGUAGE C IMMUTABLE STRICT;
1064 CREATE OR REPLACE FUNCTION gbt_bit_picksplit(internal, internal)
1065 RETURNS internal
1066 AS 'MODULE_PATHNAME'
1067 LANGUAGE C IMMUTABLE;
1069 CREATE OR REPLACE FUNCTION gbt_bit_union(bytea, internal)
1070 RETURNS gbtreekey_var
1071 AS 'MODULE_PATHNAME'
1072 LANGUAGE C IMMUTABLE;
1074 CREATE OR REPLACE FUNCTION gbt_bit_same(internal, internal, internal)
1075 RETURNS internal
1076 AS 'MODULE_PATHNAME'
1077 LANGUAGE C IMMUTABLE;
1079 -- Create the operator class
1080 CREATE OPERATOR CLASS gist_bit_ops
1081 DEFAULT FOR TYPE bit USING gist
1083 OPERATOR 1 < ,
1084 OPERATOR 2 <= ,
1085 OPERATOR 3 = ,
1086 OPERATOR 4 >= ,
1087 OPERATOR 5 > ,
1088 FUNCTION 1 gbt_bit_consistent (internal, bit, int2, oid, internal),
1089 FUNCTION 2 gbt_bit_union (bytea, internal),
1090 FUNCTION 3 gbt_bit_compress (internal),
1091 FUNCTION 4 gbt_var_decompress (internal),
1092 FUNCTION 5 gbt_bit_penalty (internal, internal, internal),
1093 FUNCTION 6 gbt_bit_picksplit (internal, internal),
1094 FUNCTION 7 gbt_bit_same (internal, internal, internal),
1095 STORAGE gbtreekey_var;
1098 -- Create the operator class
1099 CREATE OPERATOR CLASS gist_vbit_ops
1100 DEFAULT FOR TYPE varbit USING gist
1102 OPERATOR 1 < ,
1103 OPERATOR 2 <= ,
1104 OPERATOR 3 = ,
1105 OPERATOR 4 >= ,
1106 OPERATOR 5 > ,
1107 FUNCTION 1 gbt_bit_consistent (internal, bit, int2, oid, internal),
1108 FUNCTION 2 gbt_bit_union (bytea, internal),
1109 FUNCTION 3 gbt_bit_compress (internal),
1110 FUNCTION 4 gbt_var_decompress (internal),
1111 FUNCTION 5 gbt_bit_penalty (internal, internal, internal),
1112 FUNCTION 6 gbt_bit_picksplit (internal, internal),
1113 FUNCTION 7 gbt_bit_same (internal, internal, internal),
1114 STORAGE gbtreekey_var;
1121 -- inet/cidr ops
1125 -- define the GiST support methods
1126 CREATE OR REPLACE FUNCTION gbt_inet_consistent(internal,inet,int2,oid,internal)
1127 RETURNS bool
1128 AS 'MODULE_PATHNAME'
1129 LANGUAGE C IMMUTABLE;
1131 CREATE OR REPLACE FUNCTION gbt_inet_compress(internal)
1132 RETURNS internal
1133 AS 'MODULE_PATHNAME'
1134 LANGUAGE C IMMUTABLE;
1136 CREATE OR REPLACE FUNCTION gbt_inet_penalty(internal,internal,internal)
1137 RETURNS internal
1138 AS 'MODULE_PATHNAME'
1139 LANGUAGE C IMMUTABLE STRICT;
1141 CREATE OR REPLACE FUNCTION gbt_inet_picksplit(internal, internal)
1142 RETURNS internal
1143 AS 'MODULE_PATHNAME'
1144 LANGUAGE C IMMUTABLE;
1146 CREATE OR REPLACE FUNCTION gbt_inet_union(bytea, internal)
1147 RETURNS gbtreekey16
1148 AS 'MODULE_PATHNAME'
1149 LANGUAGE C IMMUTABLE;
1151 CREATE OR REPLACE FUNCTION gbt_inet_same(internal, internal, internal)
1152 RETURNS internal
1153 AS 'MODULE_PATHNAME'
1154 LANGUAGE C IMMUTABLE;
1156 -- Create the operator class
1157 CREATE OPERATOR CLASS gist_inet_ops
1158 DEFAULT FOR TYPE inet USING gist
1160 OPERATOR 1 < ,
1161 OPERATOR 2 <= ,
1162 OPERATOR 3 = ,
1163 OPERATOR 4 >= ,
1164 OPERATOR 5 > ,
1165 FUNCTION 1 gbt_inet_consistent (internal, inet, int2, oid, internal),
1166 FUNCTION 2 gbt_inet_union (bytea, internal),
1167 FUNCTION 3 gbt_inet_compress (internal),
1168 FUNCTION 4 gbt_decompress (internal),
1169 FUNCTION 5 gbt_inet_penalty (internal, internal, internal),
1170 FUNCTION 6 gbt_inet_picksplit (internal, internal),
1171 FUNCTION 7 gbt_inet_same (internal, internal, internal),
1172 STORAGE gbtreekey16;
1174 -- Create the operator class
1175 CREATE OPERATOR CLASS gist_cidr_ops
1176 DEFAULT FOR TYPE cidr USING gist
1178 OPERATOR 1 < (inet, inet) ,
1179 OPERATOR 2 <= (inet, inet) ,
1180 OPERATOR 3 = (inet, inet) ,
1181 OPERATOR 4 >= (inet, inet) ,
1182 OPERATOR 5 > (inet, inet) ,
1183 FUNCTION 1 gbt_inet_consistent (internal, inet, int2, oid, internal),
1184 FUNCTION 2 gbt_inet_union (bytea, internal),
1185 FUNCTION 3 gbt_inet_compress (internal),
1186 FUNCTION 4 gbt_decompress (internal),
1187 FUNCTION 5 gbt_inet_penalty (internal, internal, internal),
1188 FUNCTION 6 gbt_inet_picksplit (internal, internal),
1189 FUNCTION 7 gbt_inet_same (internal, internal, internal),
1190 STORAGE gbtreekey16;