File tree 3 files changed +30
-0
lines changed
3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -11816,6 +11816,14 @@ limit_clause:
11816
11816
n->limitOption = LIMIT_OPTION_COUNT;
11817
11817
$$ = n;
11818
11818
}
11819
+ | FETCH first_or_next row_or_rows WITH TIES
11820
+ {
11821
+ SelectLimit *n = (SelectLimit *) palloc(sizeof (SelectLimit));
11822
+ n->limitOffset = NULL ;
11823
+ n->limitCount = makeIntConst(1 , -1 );
11824
+ n->limitOption = LIMIT_OPTION_WITH_TIES;
11825
+ $$ = n;
11826
+ }
11819
11827
;
11820
11828
11821
11829
offset_clause :
Original file line number Diff line number Diff line change @@ -576,6 +576,23 @@ SELECT thousand
576
576
0
577
577
(10 rows)
578
578
579
+ SELECT thousand
580
+ FROM onek WHERE thousand < 5
581
+ ORDER BY thousand FETCH FIRST ROWS WITH TIES;
582
+ thousand
583
+ ----------
584
+ 0
585
+ 0
586
+ 0
587
+ 0
588
+ 0
589
+ 0
590
+ 0
591
+ 0
592
+ 0
593
+ 0
594
+ (10 rows)
595
+
579
596
SELECT thousand
580
597
FROM onek WHERE thousand < 5
581
598
ORDER BY thousand FETCH FIRST 1 ROW WITH TIES;
Original file line number Diff line number Diff line change @@ -161,13 +161,18 @@ SELECT thousand
161
161
FROM onek WHERE thousand < 5
162
162
ORDER BY thousand FETCH FIRST 2 ROW WITH TIES;
163
163
164
+ SELECT thousand
165
+ FROM onek WHERE thousand < 5
166
+ ORDER BY thousand FETCH FIRST ROWS WITH TIES;
167
+
164
168
SELECT thousand
165
169
FROM onek WHERE thousand < 5
166
170
ORDER BY thousand FETCH FIRST 1 ROW WITH TIES;
167
171
168
172
SELECT thousand
169
173
FROM onek WHERE thousand < 5
170
174
ORDER BY thousand FETCH FIRST 2 ROW ONLY;
175
+
171
176
-- should fail
172
177
SELECT ' ' ::text AS two, unique1, unique2, stringu1
173
178
FROM onek WHERE unique1 > 50
You can’t perform that action at this time.
0 commit comments