limit.err 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. Registering pre-existing tables
  2. onek
  3. tenk1
  4. int8_tbl
  5. <sql-statement>
  6. --
  7. -- LIMIT
  8. -- Check the LIMIT/OFFSET feature of SELECT
  9. --
  10. SELECT ''::text AS two, unique1, unique2, stringu1
  11. FROM onek WHERE unique1 > 50
  12. ORDER BY unique1 LIMIT 2;
  13. </sql-statement>
  14. <sql-statement>
  15. SELECT ''::text AS five, unique1, unique2, stringu1
  16. FROM onek WHERE unique1 > 60
  17. ORDER BY unique1 LIMIT 5;
  18. </sql-statement>
  19. <sql-statement>
  20. SELECT ''::text AS two, unique1, unique2, stringu1
  21. FROM onek WHERE unique1 > 60 AND unique1 < 63
  22. ORDER BY unique1 LIMIT 5;
  23. </sql-statement>
  24. <sql-statement>
  25. SELECT ''::text AS three, unique1, unique2, stringu1
  26. FROM onek WHERE unique1 > 100
  27. ORDER BY unique1 LIMIT 3 OFFSET 20;
  28. </sql-statement>
  29. <sql-statement>
  30. SELECT ''::text AS zero, unique1, unique2, stringu1
  31. FROM onek WHERE unique1 < 50
  32. ORDER BY unique1 DESC LIMIT 8 OFFSET 99;
  33. </sql-statement>
  34. <sql-statement>
  35. SELECT ''::text AS eleven, unique1, unique2, stringu1
  36. FROM onek WHERE unique1 < 50
  37. ORDER BY unique1 DESC LIMIT 20 OFFSET 39;
  38. </sql-statement>
  39. <sql-statement>
  40. SELECT ''::text AS ten, unique1, unique2, stringu1
  41. FROM onek
  42. ORDER BY unique1 OFFSET 990;
  43. </sql-statement>
  44. <sql-statement>
  45. SELECT ''::text AS five, unique1, unique2, stringu1
  46. FROM onek
  47. ORDER BY unique1 OFFSET 990 LIMIT 5;
  48. </sql-statement>
  49. <sql-statement>
  50. SELECT ''::text AS five, unique1, unique2, stringu1
  51. FROM onek
  52. ORDER BY unique1 LIMIT 5 OFFSET 900;
  53. </sql-statement>
  54. <sql-statement>
  55. -- Test null limit and offset. The planner would discard a simple null
  56. -- constant, so to ensure executor is exercised, do this:
  57. select * from int8_tbl limit (case when random() < 0.5 then null::bigint end);
  58. </sql-statement>
  59. <sql-statement>
  60. select * from int8_tbl offset (case when random() < 0.5 then null::bigint end);
  61. </sql-statement>
  62. <sql-statement>
  63. -- Test assorted cases involving backwards fetch from a LIMIT plan node
  64. begin;
  65. </sql-statement>
  66. <sql-statement>
  67. declare c1 cursor for select * from int8_tbl limit 10;
  68. </sql-statement>
  69. -stdin-:<main>: Error: Parse Sql
  70. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
  71. declare c1 cursor for select * from int8_tbl limit 10;
  72. ^
  73. <sql-statement>
  74. fetch all in c1;
  75. </sql-statement>
  76. -stdin-:<main>: Error: Parse Sql
  77. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  78. fetch all in c1;
  79. ^
  80. <sql-statement>
  81. fetch 1 in c1;
  82. </sql-statement>
  83. -stdin-:<main>: Error: Parse Sql
  84. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  85. fetch 1 in c1;
  86. ^
  87. <sql-statement>
  88. fetch backward 1 in c1;
  89. </sql-statement>
  90. -stdin-:<main>: Error: Parse Sql
  91. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  92. fetch backward 1 in c1;
  93. ^
  94. <sql-statement>
  95. fetch backward all in c1;
  96. </sql-statement>
  97. -stdin-:<main>: Error: Parse Sql
  98. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  99. fetch backward all in c1;
  100. ^
  101. <sql-statement>
  102. fetch backward 1 in c1;
  103. </sql-statement>
  104. -stdin-:<main>: Error: Parse Sql
  105. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  106. fetch backward 1 in c1;
  107. ^
  108. <sql-statement>
  109. fetch all in c1;
  110. </sql-statement>
  111. -stdin-:<main>: Error: Parse Sql
  112. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  113. fetch all in c1;
  114. ^
  115. <sql-statement>
  116. declare c2 cursor for select * from int8_tbl limit 3;
  117. </sql-statement>
  118. -stdin-:<main>: Error: Parse Sql
  119. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
  120. declare c2 cursor for select * from int8_tbl limit 3;
  121. ^
  122. <sql-statement>
  123. fetch all in c2;
  124. </sql-statement>
  125. -stdin-:<main>: Error: Parse Sql
  126. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  127. fetch all in c2;
  128. ^
  129. <sql-statement>
  130. fetch 1 in c2;
  131. </sql-statement>
  132. -stdin-:<main>: Error: Parse Sql
  133. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  134. fetch 1 in c2;
  135. ^
  136. <sql-statement>
  137. fetch backward 1 in c2;
  138. </sql-statement>
  139. -stdin-:<main>: Error: Parse Sql
  140. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  141. fetch backward 1 in c2;
  142. ^
  143. <sql-statement>
  144. fetch backward all in c2;
  145. </sql-statement>
  146. -stdin-:<main>: Error: Parse Sql
  147. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  148. fetch backward all in c2;
  149. ^
  150. <sql-statement>
  151. fetch backward 1 in c2;
  152. </sql-statement>
  153. -stdin-:<main>: Error: Parse Sql
  154. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  155. fetch backward 1 in c2;
  156. ^
  157. <sql-statement>
  158. fetch all in c2;
  159. </sql-statement>
  160. -stdin-:<main>: Error: Parse Sql
  161. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  162. fetch all in c2;
  163. ^
  164. <sql-statement>
  165. declare c3 cursor for select * from int8_tbl offset 3;
  166. </sql-statement>
  167. -stdin-:<main>: Error: Parse Sql
  168. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
  169. declare c3 cursor for select * from int8_tbl offset 3;
  170. ^
  171. <sql-statement>
  172. fetch all in c3;
  173. </sql-statement>
  174. -stdin-:<main>: Error: Parse Sql
  175. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  176. fetch all in c3;
  177. ^
  178. <sql-statement>
  179. fetch 1 in c3;
  180. </sql-statement>
  181. -stdin-:<main>: Error: Parse Sql
  182. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  183. fetch 1 in c3;
  184. ^
  185. <sql-statement>
  186. fetch backward 1 in c3;
  187. </sql-statement>
  188. -stdin-:<main>: Error: Parse Sql
  189. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  190. fetch backward 1 in c3;
  191. ^
  192. <sql-statement>
  193. fetch backward all in c3;
  194. </sql-statement>
  195. -stdin-:<main>: Error: Parse Sql
  196. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  197. fetch backward all in c3;
  198. ^
  199. <sql-statement>
  200. fetch backward 1 in c3;
  201. </sql-statement>
  202. -stdin-:<main>: Error: Parse Sql
  203. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  204. fetch backward 1 in c3;
  205. ^
  206. <sql-statement>
  207. fetch all in c3;
  208. </sql-statement>
  209. -stdin-:<main>: Error: Parse Sql
  210. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  211. fetch all in c3;
  212. ^
  213. <sql-statement>
  214. declare c4 cursor for select * from int8_tbl offset 10;
  215. </sql-statement>
  216. -stdin-:<main>: Error: Parse Sql
  217. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
  218. declare c4 cursor for select * from int8_tbl offset 10;
  219. ^
  220. <sql-statement>
  221. fetch all in c4;
  222. </sql-statement>
  223. -stdin-:<main>: Error: Parse Sql
  224. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  225. fetch all in c4;
  226. ^
  227. <sql-statement>
  228. fetch 1 in c4;
  229. </sql-statement>
  230. -stdin-:<main>: Error: Parse Sql
  231. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  232. fetch 1 in c4;
  233. ^
  234. <sql-statement>
  235. fetch backward 1 in c4;
  236. </sql-statement>
  237. -stdin-:<main>: Error: Parse Sql
  238. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  239. fetch backward 1 in c4;
  240. ^
  241. <sql-statement>
  242. fetch backward all in c4;
  243. </sql-statement>
  244. -stdin-:<main>: Error: Parse Sql
  245. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  246. fetch backward all in c4;
  247. ^
  248. <sql-statement>
  249. fetch backward 1 in c4;
  250. </sql-statement>
  251. -stdin-:<main>: Error: Parse Sql
  252. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  253. fetch backward 1 in c4;
  254. ^
  255. <sql-statement>
  256. fetch all in c4;
  257. </sql-statement>
  258. -stdin-:<main>: Error: Parse Sql
  259. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  260. fetch all in c4;
  261. ^
  262. <sql-statement>
  263. declare c5 cursor for select * from int8_tbl order by q1 fetch first 2 rows with ties;
  264. </sql-statement>
  265. -stdin-:<main>: Error: Parse Sql
  266. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
  267. declare c5 cursor for select * from int8_tbl order by q1 fetch first 2 rows with ties;
  268. ^
  269. <sql-statement>
  270. fetch all in c5;
  271. </sql-statement>
  272. -stdin-:<main>: Error: Parse Sql
  273. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  274. fetch all in c5;
  275. ^
  276. <sql-statement>
  277. fetch 1 in c5;
  278. </sql-statement>
  279. -stdin-:<main>: Error: Parse Sql
  280. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  281. fetch 1 in c5;
  282. ^
  283. <sql-statement>
  284. fetch backward 1 in c5;
  285. </sql-statement>
  286. -stdin-:<main>: Error: Parse Sql
  287. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  288. fetch backward 1 in c5;
  289. ^
  290. <sql-statement>
  291. fetch backward 1 in c5;
  292. </sql-statement>
  293. -stdin-:<main>: Error: Parse Sql
  294. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  295. fetch backward 1 in c5;
  296. ^
  297. <sql-statement>
  298. fetch all in c5;
  299. </sql-statement>
  300. -stdin-:<main>: Error: Parse Sql
  301. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  302. fetch all in c5;
  303. ^
  304. <sql-statement>
  305. fetch backward all in c5;
  306. </sql-statement>
  307. -stdin-:<main>: Error: Parse Sql
  308. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  309. fetch backward all in c5;
  310. ^
  311. <sql-statement>
  312. fetch all in c5;
  313. </sql-statement>
  314. -stdin-:<main>: Error: Parse Sql
  315. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  316. fetch all in c5;
  317. ^
  318. <sql-statement>
  319. fetch backward all in c5;
  320. </sql-statement>
  321. -stdin-:<main>: Error: Parse Sql
  322. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
  323. fetch backward all in c5;
  324. ^
  325. <sql-statement>
  326. rollback;
  327. </sql-statement>
  328. <sql-statement>
  329. -- Stress test for variable LIMIT in conjunction with bounded-heap sorting
  330. SELECT
  331. (SELECT n
  332. FROM (VALUES (1)) AS x,
  333. (SELECT n FROM generate_series(1,10) AS n
  334. ORDER BY n LIMIT 1 OFFSET s-1) AS y) AS z
  335. FROM generate_series(1,10) AS s;
  336. </sql-statement>
  337. -stdin-:<main>: Error: Parse Sql
  338. -stdin-:<main>:6:40: Error: Columns are not allowed in: OFFSET
  339. ORDER BY n LIMIT 1 OFFSET s-1) AS y) AS z
  340. ^
  341. -stdin-:<main>: Error: Type annotation
  342. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
  343. -- Stress test for variable LIMIT in conjunction with bounded-heap sorting
  344. ^
  345. -stdin-:<main>:3:3: Error: At function: PgSubLink, At function: PgSelect
  346. (SELECT n
  347. ^
  348. -stdin-:<main>:3:3: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
  349. (SELECT n
  350. ^
  351. <sql-statement>
  352. --
  353. -- Test behavior of volatile and set-returning functions in conjunction
  354. -- with ORDER BY and LIMIT.
  355. --
  356. create temp sequence testseq;
  357. </sql-statement>
  358. -stdin-:<main>: Error: Pre type annotation
  359. -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
  360. --
  361. ^
  362. <sql-statement>
  363. explain (verbose, costs off)
  364. select unique1, unique2, nextval('testseq')
  365. from tenk1 order by unique2 limit 10;
  366. </sql-statement>
  367. -stdin-:<main>: Error: Parse Sql
  368. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  369. explain (verbose, costs off)
  370. ^
  371. <sql-statement>
  372. select unique1, unique2, nextval('testseq')
  373. from tenk1 order by unique2 limit 10;
  374. </sql-statement>
  375. -stdin-:<main>: Fatal: Execution
  376. -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
  377. select unique1, unique2, nextval('testseq')
  378. ^
  379. -stdin-:<main>:1:1: Fatal: ERROR: relation "testseq" does not exist
  380. select unique1, unique2, nextval('testseq')
  381. ^
  382. <sql-statement>
  383. select currval('testseq');
  384. </sql-statement>
  385. -stdin-:<main>: Fatal: Execution
  386. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  387. select currval('testseq');
  388. ^
  389. -stdin-:<main>:1:1: Fatal: ERROR: relation "testseq" does not exist
  390. select currval('testseq');
  391. ^
  392. <sql-statement>
  393. explain (verbose, costs off)
  394. select unique1, unique2, nextval('testseq')
  395. from tenk1 order by tenthous limit 10;
  396. </sql-statement>
  397. -stdin-:<main>: Error: Parse Sql
  398. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  399. explain (verbose, costs off)
  400. ^
  401. <sql-statement>
  402. select unique1, unique2, nextval('testseq')
  403. from tenk1 order by tenthous limit 10;
  404. </sql-statement>
  405. -stdin-:<main>: Fatal: Execution
  406. -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
  407. select unique1, unique2, nextval('testseq')
  408. ^
  409. -stdin-:<main>:1:1: Fatal: ERROR: relation "testseq" does not exist
  410. select unique1, unique2, nextval('testseq')
  411. ^
  412. <sql-statement>
  413. select currval('testseq');
  414. </sql-statement>
  415. -stdin-:<main>: Fatal: Execution
  416. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  417. select currval('testseq');
  418. ^
  419. -stdin-:<main>:1:1: Fatal: ERROR: relation "testseq" does not exist
  420. select currval('testseq');
  421. ^
  422. <sql-statement>
  423. explain (verbose, costs off)
  424. select unique1, unique2, generate_series(1,10)
  425. from tenk1 order by unique2 limit 7;
  426. </sql-statement>
  427. -stdin-:<main>: Error: Parse Sql
  428. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  429. explain (verbose, costs off)
  430. ^
  431. <sql-statement>
  432. select unique1, unique2, generate_series(1,10)
  433. from tenk1 order by unique2 limit 7;
  434. </sql-statement>
  435. -stdin-:<main>: Error: Parse Sql
  436. -stdin-:<main>:1:26: Error: Generator functions are not allowed in: SELECT
  437. select unique1, unique2, generate_series(1,10)
  438. ^
  439. <sql-statement>
  440. explain (verbose, costs off)
  441. select unique1, unique2, generate_series(1,10)
  442. from tenk1 order by tenthous limit 7;
  443. </sql-statement>
  444. -stdin-:<main>: Error: Parse Sql
  445. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  446. explain (verbose, costs off)
  447. ^
  448. <sql-statement>
  449. select unique1, unique2, generate_series(1,10)
  450. from tenk1 order by tenthous limit 7;
  451. </sql-statement>
  452. -stdin-:<main>: Error: Parse Sql
  453. -stdin-:<main>:1:26: Error: Generator functions are not allowed in: SELECT
  454. select unique1, unique2, generate_series(1,10)
  455. ^
  456. <sql-statement>
  457. -- use of random() is to keep planner from folding the expressions together
  458. explain (verbose, costs off)
  459. select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
  460. </sql-statement>
  461. -stdin-:<main>: Error: Parse Sql
  462. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  463. -- use of random() is to keep planner from folding the expressions together
  464. ^
  465. <sql-statement>
  466. select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
  467. </sql-statement>
  468. -stdin-:<main>: Error: Parse Sql
  469. -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
  470. select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
  471. ^
  472. <sql-statement>
  473. explain (verbose, costs off)
  474. select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
  475. order by s2 desc;
  476. </sql-statement>
  477. -stdin-:<main>: Error: Parse Sql
  478. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  479. explain (verbose, costs off)
  480. ^
  481. <sql-statement>
  482. select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
  483. order by s2 desc;
  484. </sql-statement>
  485. -stdin-:<main>: Error: Parse Sql
  486. -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
  487. select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
  488. ^
  489. <sql-statement>
  490. -- test for failure to set all aggregates' aggtranstype
  491. explain (verbose, costs off)
  492. select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
  493. from tenk1 group by thousand order by thousand limit 3;
  494. </sql-statement>
  495. -stdin-:<main>: Error: Parse Sql
  496. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  497. -- test for failure to set all aggregates' aggtranstype
  498. ^
  499. <sql-statement>
  500. select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
  501. from tenk1 group by thousand order by thousand limit 3;
  502. </sql-statement>
  503. <sql-statement>
  504. --
  505. -- FETCH FIRST
  506. -- Check the WITH TIES clause
  507. --
  508. SELECT thousand
  509. FROM onek WHERE thousand < 5
  510. ORDER BY thousand FETCH FIRST 2 ROW WITH TIES;
  511. </sql-statement>
  512. -stdin-:<main>: Error: Parse Sql
  513. -stdin-:<main>:1:1: Error: LimitOption unsupported value: 1
  514. --
  515. ^
  516. <sql-statement>
  517. SELECT thousand
  518. FROM onek WHERE thousand < 5
  519. ORDER BY thousand FETCH FIRST ROWS WITH TIES;
  520. </sql-statement>
  521. -stdin-:<main>: Error: Parse Sql
  522. -stdin-:<main>:1:1: Error: LimitOption unsupported value: 1
  523. SELECT thousand
  524. ^
  525. <sql-statement>
  526. SELECT thousand
  527. FROM onek WHERE thousand < 5
  528. ORDER BY thousand FETCH FIRST 1 ROW WITH TIES;
  529. </sql-statement>
  530. -stdin-:<main>: Error: Parse Sql
  531. -stdin-:<main>:1:1: Error: LimitOption unsupported value: 1
  532. SELECT thousand
  533. ^
  534. <sql-statement>
  535. SELECT thousand
  536. FROM onek WHERE thousand < 5
  537. ORDER BY thousand FETCH FIRST 2 ROW ONLY;
  538. </sql-statement>
  539. <sql-statement>
  540. -- SKIP LOCKED and WITH TIES are incompatible
  541. SELECT thousand
  542. FROM onek WHERE thousand < 5
  543. ORDER BY thousand FETCH FIRST 1 ROW WITH TIES FOR UPDATE SKIP LOCKED;
  544. </sql-statement>
  545. -stdin-:<main>: Error: Parse Sql
  546. -stdin-:<main>:1:1: Error: ERROR: SKIP LOCKED and WITH TIES options cannot be used together
  547. -- SKIP LOCKED and WITH TIES are incompatible
  548. ^
  549. <sql-statement>
  550. -- should fail
  551. SELECT ''::text AS two, unique1, unique2, stringu1
  552. FROM onek WHERE unique1 > 50
  553. FETCH FIRST 2 ROW WITH TIES;
  554. </sql-statement>
  555. -stdin-:<main>: Error: Parse Sql
  556. -stdin-:<main>:1:1: Error: ERROR: WITH TIES cannot be specified without ORDER BY clause
  557. -- should fail
  558. ^
  559. <sql-statement>
  560. -- test ruleutils
  561. CREATE VIEW limit_thousand_v_1 AS SELECT thousand FROM onek WHERE thousand < 995
  562. ORDER BY thousand FETCH FIRST 5 ROWS WITH TIES OFFSET 10;
  563. </sql-statement>
  564. -stdin-:<main>: Error: Parse Sql
  565. -stdin-:<main>:1:1: Error: expected at least one target column
  566. -- test ruleutils
  567. ^
  568. <sql-statement>
  569. \d+ limit_thousand_v_1
  570. </sql-statement>
  571. Metacommand \d+ limit_thousand_v_1 is not supported
  572. <sql-statement>
  573. CREATE VIEW limit_thousand_v_2 AS SELECT thousand FROM onek WHERE thousand < 995
  574. ORDER BY thousand OFFSET 10 FETCH FIRST 5 ROWS ONLY;
  575. </sql-statement>
  576. -stdin-:<main>: Error: Parse Sql
  577. -stdin-:<main>:1:1: Error: expected at least one target column
  578. CREATE VIEW limit_thousand_v_2 AS SELECT thousand FROM onek WHERE thousand < 995
  579. ^
  580. <sql-statement>
  581. \d+ limit_thousand_v_2
  582. </sql-statement>
  583. Metacommand \d+ limit_thousand_v_2 is not supported
  584. <sql-statement>
  585. CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
  586. ORDER BY thousand FETCH FIRST NULL ROWS WITH TIES; -- fails
  587. </sql-statement>
  588. -stdin-:<main>: Error: Parse Sql
  589. -stdin-:<main>:1:1: Error: expected at least one target column
  590. CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
  591. ^
  592. <sql-statement>
  593. CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
  594. ORDER BY thousand FETCH FIRST (NULL+1) ROWS WITH TIES;
  595. </sql-statement>
  596. -stdin-:<main>: Error: Parse Sql
  597. -stdin-:<main>:1:1: Error: expected at least one target column
  598. CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
  599. ^
  600. <sql-statement>
  601. \d+ limit_thousand_v_3
  602. </sql-statement>
  603. Metacommand \d+ limit_thousand_v_3 is not supported
  604. <sql-statement>
  605. CREATE VIEW limit_thousand_v_4 AS SELECT thousand FROM onek WHERE thousand < 995
  606. ORDER BY thousand FETCH FIRST NULL ROWS ONLY;
  607. </sql-statement>
  608. -stdin-:<main>: Error: Parse Sql
  609. -stdin-:<main>:1:1: Error: expected at least one target column
  610. CREATE VIEW limit_thousand_v_4 AS SELECT thousand FROM onek WHERE thousand < 995
  611. ^
  612. <sql-statement>
  613. \d+ limit_thousand_v_4
  614. </sql-statement>
  615. Metacommand \d+ limit_thousand_v_4 is not supported
  616. <sql-statement>
  617. -- leave these views
  618. </sql-statement>