File tree 3 files changed +21
-2
lines changed
Filter options
3 files changed +21
-2
lines changed
Original file line number Diff line number Diff line change @@ -114,9 +114,19 @@ SET enable_indexscan=on;
114
114
SELECT a
115
115
FROM test_rum
116
116
WHERE a @@ to_tsquery('pg_catalog.english', 'bar')
117
- ORDER BY a <=> (to_tsquery('pg_catalog.english', 'bar'),0)
117
+ ORDER BY a <=> (to_tsquery('pg_catalog.english', 'bar'),0);
118
118
a
119
119
------------------------------
120
120
'bar':2,8 'foo':1,3,6 'qq':7
121
121
(1 row)
122
122
123
+ -- PGPRO-9026: column and attached column cannot be the same
124
+ CREATE TABLE test_array (i int2[]);
125
+ CREATE INDEX idx_array ON test_array USING rum (i rum_anyarray_addon_ops) WITH (attach = 'i', to = 'i');
126
+ ERROR: column "i" and attached column cannot be the same
127
+ SELECT * FROM test_array WHERE i && '{1}';
128
+ i
129
+ ---
130
+ (0 rows)
131
+
132
+ DROP TABLE test_array;
Original file line number Diff line number Diff line change @@ -58,4 +58,10 @@ SET enable_indexscan=on;
58
58
SELECT a
59
59
FROM test_rum
60
60
WHERE a @@ to_tsquery(' pg_catalog.english' , ' bar' )
61
- ORDER BY a <=> (to_tsquery(' pg_catalog.english' , ' bar' ),0 )
61
+ ORDER BY a <=> (to_tsquery(' pg_catalog.english' , ' bar' ),0 );
62
+
63
+ -- PGPRO-9026: column and attached column cannot be the same
64
+ CREATE TABLE test_array (i int2[]);
65
+ CREATE INDEX idx_array ON test_array USING rum (i rum_anyarray_addon_ops) WITH (attach = ' i' , to = ' i' );
66
+ SELECT * FROM test_array WHERE i && ' {1}' ;
67
+ DROP TABLE test_array;
Original file line number Diff line number Diff line change @@ -211,6 +211,9 @@ initRumState(RumState * state, Relation index)
211
211
212
212
if (!AttributeNumberIsValid (state -> attrnAddToColumn ))
213
213
elog (ERROR , "attribute \"%s\" is not found in index" , colname );
214
+
215
+ if (state -> attrnAddToColumn == state -> attrnAttachColumn )
216
+ elog (ERROR , "column \"%s\" and attached column cannot be the same" , colname );
214
217
}
215
218
216
219
if (!(AttributeNumberIsValid (state -> attrnAttachColumn ) &&
You can’t perform that action at this time.
0 commit comments