Skip to content

Commit 22088dd

Browse files
author
Commitfest Bot
committed
[CF 5535] v3 - Cross-type index comparison support in contrib/btree_gin
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5535 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/[email protected] Author(s): Tom Lane
2 parents 3631612 + a8821e9 commit 22088dd

31 files changed

+2548
-116
lines changed

contrib/btree_gin/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ OBJS = \
77

88
EXTENSION = btree_gin
99
DATA = btree_gin--1.0.sql btree_gin--1.0--1.1.sql btree_gin--1.1--1.2.sql \
10-
btree_gin--1.2--1.3.sql
10+
btree_gin--1.2--1.3.sql btree_gin--1.3--1.4.sql
1111
PGFILEDESC = "btree_gin - B-tree equivalent GIN operator classes"
1212

1313
REGRESS = install_btree_gin int2 int4 int8 float4 float8 money oid \
+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
/* contrib/btree_gin/btree_gin--1.3--1.4.sql */
2+
3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "ALTER EXTENSION btree_gin UPDATE TO '1.4'" to load this file. \quit
5+
6+
--
7+
-- Cross-type operator support is new in 1.4. We only need to worry
8+
-- about this for cross-type operators that exist in core.
9+
--
10+
-- Because the opclass extractQuery and consistent methods don't directly
11+
-- get any information about the datatype of the RHS value, we have to
12+
-- encode that in the operator strategy numbers. The strategy numbers
13+
-- are the operator's normal btree strategy (1-5) plus 8 times a code
14+
-- for the RHS datatype.
15+
--
16+
17+
ALTER OPERATOR FAMILY int2_ops USING gin
18+
ADD
19+
-- Code 1: RHS is int4
20+
OPERATOR 9 < (int2, int4),
21+
OPERATOR 10 <= (int2, int4),
22+
OPERATOR 11 = (int2, int4),
23+
OPERATOR 12 >= (int2, int4),
24+
OPERATOR 13 > (int2, int4),
25+
-- Code 2: RHS is int8
26+
OPERATOR 17 < (int2, int8),
27+
OPERATOR 18 <= (int2, int8),
28+
OPERATOR 19 = (int2, int8),
29+
OPERATOR 20 >= (int2, int8),
30+
OPERATOR 21 > (int2, int8)
31+
;
32+
33+
ALTER OPERATOR FAMILY int4_ops USING gin
34+
ADD
35+
-- Code 1: RHS is int2
36+
OPERATOR 9 < (int4, int2),
37+
OPERATOR 10 <= (int4, int2),
38+
OPERATOR 11 = (int4, int2),
39+
OPERATOR 12 >= (int4, int2),
40+
OPERATOR 13 > (int4, int2),
41+
-- Code 2: RHS is int8
42+
OPERATOR 17 < (int4, int8),
43+
OPERATOR 18 <= (int4, int8),
44+
OPERATOR 19 = (int4, int8),
45+
OPERATOR 20 >= (int4, int8),
46+
OPERATOR 21 > (int4, int8)
47+
;
48+
49+
ALTER OPERATOR FAMILY int8_ops USING gin
50+
ADD
51+
-- Code 1: RHS is int2
52+
OPERATOR 9 < (int8, int2),
53+
OPERATOR 10 <= (int8, int2),
54+
OPERATOR 11 = (int8, int2),
55+
OPERATOR 12 >= (int8, int2),
56+
OPERATOR 13 > (int8, int2),
57+
-- Code 2: RHS is int4
58+
OPERATOR 17 < (int8, int4),
59+
OPERATOR 18 <= (int8, int4),
60+
OPERATOR 19 = (int8, int4),
61+
OPERATOR 20 >= (int8, int4),
62+
OPERATOR 21 > (int8, int4)
63+
;
64+
65+
ALTER OPERATOR FAMILY float4_ops USING gin
66+
ADD
67+
-- Code 1: RHS is float8
68+
OPERATOR 9 < (float4, float8),
69+
OPERATOR 10 <= (float4, float8),
70+
OPERATOR 11 = (float4, float8),
71+
OPERATOR 12 >= (float4, float8),
72+
OPERATOR 13 > (float4, float8)
73+
;
74+
75+
ALTER OPERATOR FAMILY float8_ops USING gin
76+
ADD
77+
-- Code 1: RHS is float4
78+
OPERATOR 9 < (float8, float4),
79+
OPERATOR 10 <= (float8, float4),
80+
OPERATOR 11 = (float8, float4),
81+
OPERATOR 12 >= (float8, float4),
82+
OPERATOR 13 > (float8, float4)
83+
;
84+
85+
ALTER OPERATOR FAMILY text_ops USING gin
86+
ADD
87+
-- Code 1: RHS is name
88+
OPERATOR 9 < (text, name),
89+
OPERATOR 10 <= (text, name),
90+
OPERATOR 11 = (text, name),
91+
OPERATOR 12 >= (text, name),
92+
OPERATOR 13 > (text, name)
93+
;
94+
95+
ALTER OPERATOR FAMILY name_ops USING gin
96+
ADD
97+
-- Code 1: RHS is text
98+
OPERATOR 9 < (name, text),
99+
OPERATOR 10 <= (name, text),
100+
OPERATOR 11 = (name, text),
101+
OPERATOR 12 >= (name, text),
102+
OPERATOR 13 > (name, text)
103+
;
104+
105+
ALTER OPERATOR FAMILY date_ops USING gin
106+
ADD
107+
-- Code 1: RHS is timestamp
108+
OPERATOR 9 < (date, timestamp),
109+
OPERATOR 10 <= (date, timestamp),
110+
OPERATOR 11 = (date, timestamp),
111+
OPERATOR 12 >= (date, timestamp),
112+
OPERATOR 13 > (date, timestamp),
113+
-- Code 2: RHS is timestamptz
114+
OPERATOR 17 < (date, timestamptz),
115+
OPERATOR 18 <= (date, timestamptz),
116+
OPERATOR 19 = (date, timestamptz),
117+
OPERATOR 20 >= (date, timestamptz),
118+
OPERATOR 21 > (date, timestamptz)
119+
;
120+
121+
ALTER OPERATOR FAMILY timestamp_ops USING gin
122+
ADD
123+
-- Code 1: RHS is date
124+
OPERATOR 9 < (timestamp, date),
125+
OPERATOR 10 <= (timestamp, date),
126+
OPERATOR 11 = (timestamp, date),
127+
OPERATOR 12 >= (timestamp, date),
128+
OPERATOR 13 > (timestamp, date),
129+
-- Code 2: RHS is timestamptz
130+
OPERATOR 17 < (timestamp, timestamptz),
131+
OPERATOR 18 <= (timestamp, timestamptz),
132+
OPERATOR 19 = (timestamp, timestamptz),
133+
OPERATOR 20 >= (timestamp, timestamptz),
134+
OPERATOR 21 > (timestamp, timestamptz)
135+
;
136+
137+
ALTER OPERATOR FAMILY timestamptz_ops USING gin
138+
ADD
139+
-- Code 1: RHS is date
140+
OPERATOR 9 < (timestamptz, date),
141+
OPERATOR 10 <= (timestamptz, date),
142+
OPERATOR 11 = (timestamptz, date),
143+
OPERATOR 12 >= (timestamptz, date),
144+
OPERATOR 13 > (timestamptz, date),
145+
-- Code 2: RHS is timestamp
146+
OPERATOR 17 < (timestamptz, timestamp),
147+
OPERATOR 18 <= (timestamptz, timestamp),
148+
OPERATOR 19 = (timestamptz, timestamp),
149+
OPERATOR 20 >= (timestamptz, timestamp),
150+
OPERATOR 21 > (timestamptz, timestamp)
151+
;

0 commit comments

Comments
 (0)