|
| 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 | +; |
0 commit comments