File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -190,8 +190,28 @@ SELECT COUNT(*) FROM ONLY test.num_range_rel;
190
190
0
191
191
(1 row)
192
192
193
+ /* test special case: ONLY statement with not-ONLY for partitioned table */
193
194
SELECT * FROM ONLY test.range_rel UNION SELECT * FROM test.range_rel;
194
195
ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
196
+ SELECT * FROM test.range_rel UNION SELECT * FROM ONLY test.range_rel;
197
+ ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
198
+ SELECT * FROM test.range_rel UNION SELECT * FROM test.range_rel UNION SELECT * FROM ONLY test.range_rel;
199
+ ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
200
+ SELECT * FROM ONLY test.range_rel UNION SELECT * FROM test.range_rel UNION SELECT * FROM test.range_rel;
201
+ ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
202
+ /* FIXME: result of next command execution is not right just yet */
203
+ WITH q1 AS (SELECT * FROM test.range_rel), q2 AS (SELECT * FROM ONLY test.range_rel) SELECT * FROM q1 JOIN q2 USING(id);
204
+ ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
205
+ WITH q1 AS (SELECT * FROM ONLY test.range_rel) SELECT * FROM test.range_rel JOIN q1 USING(id);
206
+ id | dt | txt | dt | txt
207
+ ----+----+-----+----+-----
208
+ (0 rows)
209
+
210
+ SELECT * FROM test.range_rel WHERE id = (SELECT id FROM ONLY test.range_rel LIMIT 1);
211
+ id | dt | txt
212
+ ----+----+-----
213
+ (0 rows)
214
+
195
215
SET pg_pathman.enable_runtimeappend = OFF;
196
216
SET pg_pathman.enable_runtimemergeappend = OFF;
197
217
VACUUM;
Original file line number Diff line number Diff line change @@ -57,7 +57,15 @@ INSERT INTO test.num_range_rel
57
57
SELECT COUNT (* ) FROM test .num_range_rel ;
58
58
SELECT COUNT (* ) FROM ONLY test .num_range_rel ;
59
59
60
+ /* test special case: ONLY statement with not-ONLY for partitioned table */
60
61
SELECT * FROM ONLY test .range_rel UNION SELECT * FROM test .range_rel ;
62
+ SELECT * FROM test .range_rel UNION SELECT * FROM ONLY test .range_rel ;
63
+ SELECT * FROM test .range_rel UNION SELECT * FROM test .range_rel UNION SELECT * FROM ONLY test .range_rel ;
64
+ SELECT * FROM ONLY test .range_rel UNION SELECT * FROM test .range_rel UNION SELECT * FROM test .range_rel ;
65
+ /* FIXME: result of next command execution is not right just yet */
66
+ WITH q1 AS (SELECT * FROM test .range_rel ), q2 AS (SELECT * FROM ONLY test .range_rel ) SELECT * FROM q1 JOIN q2 USING(id);
67
+ WITH q1 AS (SELECT * FROM ONLY test .range_rel ) SELECT * FROM test .range_rel JOIN q1 USING(id);
68
+ SELECT * FROM test .range_rel WHERE id = (SELECT id FROM ONLY test .range_rel LIMIT 1 );
61
69
62
70
SET pg_pathman .enable_runtimeappend = OFF;
63
71
SET pg_pathman .enable_runtimemergeappend = OFF;
You can’t perform that action at this time.
0 commit comments