1 /* contrib/btree_gin/btree_gin--1.0.sql */
3 -- complain if script is sourced in psql, rather than via CREATE EXTENSION
4 \echo Use "CREATE EXTENSION btree_gin" to load this file. \quit
6 CREATE FUNCTION gin_btree_consistent(internal, int2, anyelement, int4, internal, internal)
9 LANGUAGE C STRICT IMMUTABLE;
11 CREATE FUNCTION gin_extract_value_int2(int2, internal)
14 LANGUAGE C STRICT IMMUTABLE;
16 CREATE FUNCTION gin_compare_prefix_int2(int2, int2, int2, internal)
19 LANGUAGE C STRICT IMMUTABLE;
21 CREATE FUNCTION gin_extract_query_int2(int2, internal, int2, internal, internal)
24 LANGUAGE C STRICT IMMUTABLE;
26 CREATE OPERATOR CLASS int2_ops
27 DEFAULT FOR TYPE int2 USING gin
34 FUNCTION 1 btint2cmp(int2,int2),
35 FUNCTION 2 gin_extract_value_int2(int2, internal),
36 FUNCTION 3 gin_extract_query_int2(int2, internal, int2, internal, internal),
37 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
38 FUNCTION 5 gin_compare_prefix_int2(int2,int2,int2, internal),
41 CREATE FUNCTION gin_extract_value_int4(int4, internal)
44 LANGUAGE C STRICT IMMUTABLE;
46 CREATE FUNCTION gin_compare_prefix_int4(int4, int4, int2, internal)
49 LANGUAGE C STRICT IMMUTABLE;
51 CREATE FUNCTION gin_extract_query_int4(int4, internal, int2, internal, internal)
54 LANGUAGE C STRICT IMMUTABLE;
56 CREATE OPERATOR CLASS int4_ops
57 DEFAULT FOR TYPE int4 USING gin
64 FUNCTION 1 btint4cmp(int4,int4),
65 FUNCTION 2 gin_extract_value_int4(int4, internal),
66 FUNCTION 3 gin_extract_query_int4(int4, internal, int2, internal, internal),
67 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
68 FUNCTION 5 gin_compare_prefix_int4(int4,int4,int2, internal),
71 CREATE FUNCTION gin_extract_value_int8(int8, internal)
74 LANGUAGE C STRICT IMMUTABLE;
76 CREATE FUNCTION gin_compare_prefix_int8(int8, int8, int2, internal)
79 LANGUAGE C STRICT IMMUTABLE;
81 CREATE FUNCTION gin_extract_query_int8(int8, internal, int2, internal, internal)
84 LANGUAGE C STRICT IMMUTABLE;
86 CREATE OPERATOR CLASS int8_ops
87 DEFAULT FOR TYPE int8 USING gin
94 FUNCTION 1 btint8cmp(int8,int8),
95 FUNCTION 2 gin_extract_value_int8(int8, internal),
96 FUNCTION 3 gin_extract_query_int8(int8, internal, int2, internal, internal),
97 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
98 FUNCTION 5 gin_compare_prefix_int8(int8,int8,int2, internal),
101 CREATE FUNCTION gin_extract_value_float4(float4, internal)
104 LANGUAGE C STRICT IMMUTABLE;
106 CREATE FUNCTION gin_compare_prefix_float4(float4, float4, int2, internal)
109 LANGUAGE C STRICT IMMUTABLE;
111 CREATE FUNCTION gin_extract_query_float4(float4, internal, int2, internal, internal)
114 LANGUAGE C STRICT IMMUTABLE;
116 CREATE OPERATOR CLASS float4_ops
117 DEFAULT FOR TYPE float4 USING gin
124 FUNCTION 1 btfloat4cmp(float4,float4),
125 FUNCTION 2 gin_extract_value_float4(float4, internal),
126 FUNCTION 3 gin_extract_query_float4(float4, internal, int2, internal, internal),
127 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
128 FUNCTION 5 gin_compare_prefix_float4(float4,float4,int2, internal),
131 CREATE FUNCTION gin_extract_value_float8(float8, internal)
134 LANGUAGE C STRICT IMMUTABLE;
136 CREATE FUNCTION gin_compare_prefix_float8(float8, float8, int2, internal)
139 LANGUAGE C STRICT IMMUTABLE;
141 CREATE FUNCTION gin_extract_query_float8(float8, internal, int2, internal, internal)
144 LANGUAGE C STRICT IMMUTABLE;
146 CREATE OPERATOR CLASS float8_ops
147 DEFAULT FOR TYPE float8 USING gin
154 FUNCTION 1 btfloat8cmp(float8,float8),
155 FUNCTION 2 gin_extract_value_float8(float8, internal),
156 FUNCTION 3 gin_extract_query_float8(float8, internal, int2, internal, internal),
157 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
158 FUNCTION 5 gin_compare_prefix_float8(float8,float8,int2, internal),
161 CREATE FUNCTION gin_extract_value_money(money, internal)
164 LANGUAGE C STRICT IMMUTABLE;
166 CREATE FUNCTION gin_compare_prefix_money(money, money, int2, internal)
169 LANGUAGE C STRICT IMMUTABLE;
171 CREATE FUNCTION gin_extract_query_money(money, internal, int2, internal, internal)
174 LANGUAGE C STRICT IMMUTABLE;
176 CREATE OPERATOR CLASS money_ops
177 DEFAULT FOR TYPE money USING gin
184 FUNCTION 1 cash_cmp(money,money),
185 FUNCTION 2 gin_extract_value_money(money, internal),
186 FUNCTION 3 gin_extract_query_money(money, internal, int2, internal, internal),
187 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
188 FUNCTION 5 gin_compare_prefix_money(money,money,int2, internal),
191 CREATE FUNCTION gin_extract_value_oid(oid, internal)
194 LANGUAGE C STRICT IMMUTABLE;
196 CREATE FUNCTION gin_compare_prefix_oid(oid, oid, int2, internal)
199 LANGUAGE C STRICT IMMUTABLE;
201 CREATE FUNCTION gin_extract_query_oid(oid, internal, int2, internal, internal)
204 LANGUAGE C STRICT IMMUTABLE;
206 CREATE OPERATOR CLASS oid_ops
207 DEFAULT FOR TYPE oid USING gin
214 FUNCTION 1 btoidcmp(oid,oid),
215 FUNCTION 2 gin_extract_value_oid(oid, internal),
216 FUNCTION 3 gin_extract_query_oid(oid, internal, int2, internal, internal),
217 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
218 FUNCTION 5 gin_compare_prefix_oid(oid,oid,int2, internal),
221 CREATE FUNCTION gin_extract_value_timestamp(timestamp, internal)
224 LANGUAGE C STRICT IMMUTABLE;
226 CREATE FUNCTION gin_compare_prefix_timestamp(timestamp, timestamp, int2, internal)
229 LANGUAGE C STRICT IMMUTABLE;
231 CREATE FUNCTION gin_extract_query_timestamp(timestamp, internal, int2, internal, internal)
234 LANGUAGE C STRICT IMMUTABLE;
236 CREATE OPERATOR CLASS timestamp_ops
237 DEFAULT FOR TYPE timestamp USING gin
244 FUNCTION 1 timestamp_cmp(timestamp,timestamp),
245 FUNCTION 2 gin_extract_value_timestamp(timestamp, internal),
246 FUNCTION 3 gin_extract_query_timestamp(timestamp, internal, int2, internal, internal),
247 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
248 FUNCTION 5 gin_compare_prefix_timestamp(timestamp,timestamp,int2, internal),
251 CREATE FUNCTION gin_extract_value_timestamptz(timestamptz, internal)
254 LANGUAGE C STRICT IMMUTABLE;
256 CREATE FUNCTION gin_compare_prefix_timestamptz(timestamptz, timestamptz, int2, internal)
259 LANGUAGE C STRICT IMMUTABLE;
261 CREATE FUNCTION gin_extract_query_timestamptz(timestamptz, internal, int2, internal, internal)
264 LANGUAGE C STRICT IMMUTABLE;
266 CREATE OPERATOR CLASS timestamptz_ops
267 DEFAULT FOR TYPE timestamptz USING gin
274 FUNCTION 1 timestamptz_cmp(timestamptz,timestamptz),
275 FUNCTION 2 gin_extract_value_timestamptz(timestamptz, internal),
276 FUNCTION 3 gin_extract_query_timestamptz(timestamptz, internal, int2, internal, internal),
277 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
278 FUNCTION 5 gin_compare_prefix_timestamptz(timestamptz,timestamptz,int2, internal),
281 CREATE FUNCTION gin_extract_value_time(time, internal)
284 LANGUAGE C STRICT IMMUTABLE;
286 CREATE FUNCTION gin_compare_prefix_time(time, time, int2, internal)
289 LANGUAGE C STRICT IMMUTABLE;
291 CREATE FUNCTION gin_extract_query_time(time, internal, int2, internal, internal)
294 LANGUAGE C STRICT IMMUTABLE;
296 CREATE OPERATOR CLASS time_ops
297 DEFAULT FOR TYPE time USING gin
304 FUNCTION 1 time_cmp(time,time),
305 FUNCTION 2 gin_extract_value_time(time, internal),
306 FUNCTION 3 gin_extract_query_time(time, internal, int2, internal, internal),
307 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
308 FUNCTION 5 gin_compare_prefix_time(time,time,int2, internal),
311 CREATE FUNCTION gin_extract_value_timetz(timetz, internal)
314 LANGUAGE C STRICT IMMUTABLE;
316 CREATE FUNCTION gin_compare_prefix_timetz(timetz, timetz, int2, internal)
319 LANGUAGE C STRICT IMMUTABLE;
321 CREATE FUNCTION gin_extract_query_timetz(timetz, internal, int2, internal, internal)
324 LANGUAGE C STRICT IMMUTABLE;
326 CREATE OPERATOR CLASS timetz_ops
327 DEFAULT FOR TYPE timetz USING gin
334 FUNCTION 1 timetz_cmp(timetz,timetz),
335 FUNCTION 2 gin_extract_value_timetz(timetz, internal),
336 FUNCTION 3 gin_extract_query_timetz(timetz, internal, int2, internal, internal),
337 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
338 FUNCTION 5 gin_compare_prefix_timetz(timetz,timetz,int2, internal),
341 CREATE FUNCTION gin_extract_value_date(date, internal)
344 LANGUAGE C STRICT IMMUTABLE;
346 CREATE FUNCTION gin_compare_prefix_date(date, date, int2, internal)
349 LANGUAGE C STRICT IMMUTABLE;
351 CREATE FUNCTION gin_extract_query_date(date, internal, int2, internal, internal)
354 LANGUAGE C STRICT IMMUTABLE;
356 CREATE OPERATOR CLASS date_ops
357 DEFAULT FOR TYPE date USING gin
364 FUNCTION 1 date_cmp(date,date),
365 FUNCTION 2 gin_extract_value_date(date, internal),
366 FUNCTION 3 gin_extract_query_date(date, internal, int2, internal, internal),
367 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
368 FUNCTION 5 gin_compare_prefix_date(date,date,int2, internal),
371 CREATE FUNCTION gin_extract_value_interval(interval, internal)
374 LANGUAGE C STRICT IMMUTABLE;
376 CREATE FUNCTION gin_compare_prefix_interval(interval, interval, int2, internal)
379 LANGUAGE C STRICT IMMUTABLE;
381 CREATE FUNCTION gin_extract_query_interval(interval, internal, int2, internal, internal)
384 LANGUAGE C STRICT IMMUTABLE;
386 CREATE OPERATOR CLASS interval_ops
387 DEFAULT FOR TYPE interval USING gin
394 FUNCTION 1 interval_cmp(interval,interval),
395 FUNCTION 2 gin_extract_value_interval(interval, internal),
396 FUNCTION 3 gin_extract_query_interval(interval, internal, int2, internal, internal),
397 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
398 FUNCTION 5 gin_compare_prefix_interval(interval,interval,int2, internal),
401 CREATE FUNCTION gin_extract_value_macaddr(macaddr, internal)
404 LANGUAGE C STRICT IMMUTABLE;
406 CREATE FUNCTION gin_compare_prefix_macaddr(macaddr, macaddr, int2, internal)
409 LANGUAGE C STRICT IMMUTABLE;
411 CREATE FUNCTION gin_extract_query_macaddr(macaddr, internal, int2, internal, internal)
414 LANGUAGE C STRICT IMMUTABLE;
416 CREATE OPERATOR CLASS macaddr_ops
417 DEFAULT FOR TYPE macaddr USING gin
424 FUNCTION 1 macaddr_cmp(macaddr,macaddr),
425 FUNCTION 2 gin_extract_value_macaddr(macaddr, internal),
426 FUNCTION 3 gin_extract_query_macaddr(macaddr, internal, int2, internal, internal),
427 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
428 FUNCTION 5 gin_compare_prefix_macaddr(macaddr,macaddr,int2, internal),
431 CREATE FUNCTION gin_extract_value_inet(inet, internal)
434 LANGUAGE C STRICT IMMUTABLE;
436 CREATE FUNCTION gin_compare_prefix_inet(inet, inet, int2, internal)
439 LANGUAGE C STRICT IMMUTABLE;
441 CREATE FUNCTION gin_extract_query_inet(inet, internal, int2, internal, internal)
444 LANGUAGE C STRICT IMMUTABLE;
446 CREATE OPERATOR CLASS inet_ops
447 DEFAULT FOR TYPE inet USING gin
454 FUNCTION 1 network_cmp(inet,inet),
455 FUNCTION 2 gin_extract_value_inet(inet, internal),
456 FUNCTION 3 gin_extract_query_inet(inet, internal, int2, internal, internal),
457 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
458 FUNCTION 5 gin_compare_prefix_inet(inet,inet,int2, internal),
461 CREATE FUNCTION gin_extract_value_cidr(cidr, internal)
464 LANGUAGE C STRICT IMMUTABLE;
466 CREATE FUNCTION gin_compare_prefix_cidr(cidr, cidr, int2, internal)
469 LANGUAGE C STRICT IMMUTABLE;
471 CREATE FUNCTION gin_extract_query_cidr(cidr, internal, int2, internal, internal)
474 LANGUAGE C STRICT IMMUTABLE;
476 CREATE OPERATOR CLASS cidr_ops
477 DEFAULT FOR TYPE cidr USING gin
479 OPERATOR 1 <(inet,inet),
480 OPERATOR 2 <=(inet,inet),
481 OPERATOR 3 =(inet,inet),
482 OPERATOR 4 >=(inet,inet),
483 OPERATOR 5 >(inet,inet),
484 FUNCTION 1 network_cmp(inet,inet),
485 FUNCTION 2 gin_extract_value_cidr(cidr, internal),
486 FUNCTION 3 gin_extract_query_cidr(cidr, internal, int2, internal, internal),
487 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
488 FUNCTION 5 gin_compare_prefix_cidr(cidr,cidr,int2, internal),
491 CREATE FUNCTION gin_extract_value_text(text, internal)
494 LANGUAGE C STRICT IMMUTABLE;
496 CREATE FUNCTION gin_compare_prefix_text(text, text, int2, internal)
499 LANGUAGE C STRICT IMMUTABLE;
501 CREATE FUNCTION gin_extract_query_text(text, internal, int2, internal, internal)
504 LANGUAGE C STRICT IMMUTABLE;
506 CREATE OPERATOR CLASS text_ops
507 DEFAULT FOR TYPE text USING gin
514 FUNCTION 1 bttextcmp(text,text),
515 FUNCTION 2 gin_extract_value_text(text, internal),
516 FUNCTION 3 gin_extract_query_text(text, internal, int2, internal, internal),
517 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
518 FUNCTION 5 gin_compare_prefix_text(text,text,int2, internal),
521 CREATE OPERATOR CLASS varchar_ops
522 DEFAULT FOR TYPE varchar USING gin
524 OPERATOR 1 <(text,text),
525 OPERATOR 2 <=(text,text),
526 OPERATOR 3 =(text,text),
527 OPERATOR 4 >=(text,text),
528 OPERATOR 5 >(text,text),
529 FUNCTION 1 bttextcmp(text,text),
530 FUNCTION 2 gin_extract_value_text(text, internal),
531 FUNCTION 3 gin_extract_query_text(text, internal, int2, internal, internal),
532 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
533 FUNCTION 5 gin_compare_prefix_text(text,text,int2, internal),
536 CREATE FUNCTION gin_extract_value_char("char", internal)
539 LANGUAGE C STRICT IMMUTABLE;
541 CREATE FUNCTION gin_compare_prefix_char("char", "char", int2, internal)
544 LANGUAGE C STRICT IMMUTABLE;
546 CREATE FUNCTION gin_extract_query_char("char", internal, int2, internal, internal)
549 LANGUAGE C STRICT IMMUTABLE;
551 CREATE OPERATOR CLASS char_ops
552 DEFAULT FOR TYPE "char" USING gin
559 FUNCTION 1 btcharcmp("char","char"),
560 FUNCTION 2 gin_extract_value_char("char", internal),
561 FUNCTION 3 gin_extract_query_char("char", internal, int2, internal, internal),
562 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
563 FUNCTION 5 gin_compare_prefix_char("char","char",int2, internal),
566 CREATE FUNCTION gin_extract_value_bytea(bytea, internal)
569 LANGUAGE C STRICT IMMUTABLE;
571 CREATE FUNCTION gin_compare_prefix_bytea(bytea, bytea, int2, internal)
574 LANGUAGE C STRICT IMMUTABLE;
576 CREATE FUNCTION gin_extract_query_bytea(bytea, internal, int2, internal, internal)
579 LANGUAGE C STRICT IMMUTABLE;
581 CREATE OPERATOR CLASS bytea_ops
582 DEFAULT FOR TYPE bytea USING gin
589 FUNCTION 1 byteacmp(bytea,bytea),
590 FUNCTION 2 gin_extract_value_bytea(bytea, internal),
591 FUNCTION 3 gin_extract_query_bytea(bytea, internal, int2, internal, internal),
592 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
593 FUNCTION 5 gin_compare_prefix_bytea(bytea,bytea,int2, internal),
596 CREATE FUNCTION gin_extract_value_bit(bit, internal)
599 LANGUAGE C STRICT IMMUTABLE;
601 CREATE FUNCTION gin_compare_prefix_bit(bit, bit, int2, internal)
604 LANGUAGE C STRICT IMMUTABLE;
606 CREATE FUNCTION gin_extract_query_bit(bit, internal, int2, internal, internal)
609 LANGUAGE C STRICT IMMUTABLE;
611 CREATE OPERATOR CLASS bit_ops
612 DEFAULT FOR TYPE bit USING gin
619 FUNCTION 1 bitcmp(bit,bit),
620 FUNCTION 2 gin_extract_value_bit(bit, internal),
621 FUNCTION 3 gin_extract_query_bit(bit, internal, int2, internal, internal),
622 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
623 FUNCTION 5 gin_compare_prefix_bit(bit,bit,int2, internal),
626 CREATE FUNCTION gin_extract_value_varbit(varbit, internal)
629 LANGUAGE C STRICT IMMUTABLE;
631 CREATE FUNCTION gin_compare_prefix_varbit(varbit, varbit, int2, internal)
634 LANGUAGE C STRICT IMMUTABLE;
636 CREATE FUNCTION gin_extract_query_varbit(varbit, internal, int2, internal, internal)
639 LANGUAGE C STRICT IMMUTABLE;
641 CREATE OPERATOR CLASS varbit_ops
642 DEFAULT FOR TYPE varbit USING gin
649 FUNCTION 1 varbitcmp(varbit,varbit),
650 FUNCTION 2 gin_extract_value_varbit(varbit, internal),
651 FUNCTION 3 gin_extract_query_varbit(varbit, internal, int2, internal, internal),
652 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
653 FUNCTION 5 gin_compare_prefix_varbit(varbit,varbit,int2, internal),
656 CREATE FUNCTION gin_extract_value_numeric(numeric, internal)
659 LANGUAGE C STRICT IMMUTABLE;
661 CREATE FUNCTION gin_compare_prefix_numeric(numeric, numeric, int2, internal)
664 LANGUAGE C STRICT IMMUTABLE;
666 CREATE FUNCTION gin_extract_query_numeric(numeric, internal, int2, internal, internal)
669 LANGUAGE C STRICT IMMUTABLE;
671 CREATE FUNCTION gin_numeric_cmp(numeric, numeric)
674 LANGUAGE C STRICT IMMUTABLE;
676 CREATE OPERATOR CLASS numeric_ops
677 DEFAULT FOR TYPE numeric USING gin
684 FUNCTION 1 gin_numeric_cmp(numeric,numeric),
685 FUNCTION 2 gin_extract_value_numeric(numeric, internal),
686 FUNCTION 3 gin_extract_query_numeric(numeric, internal, int2, internal, internal),
687 FUNCTION 4 gin_btree_consistent(internal, int2, anyelement, int4, internal, internal),
688 FUNCTION 5 gin_compare_prefix_numeric(numeric,numeric,int2, internal),