create_table.err 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898
  1. <sql-statement>
  2. --
  3. -- CREATE_TABLE
  4. --
  5. --
  6. -- CLASS DEFINITIONS
  7. --
  8. CREATE TABLE hobbies_r (
  9. name text,
  10. person text
  11. );
  12. </sql-statement>
  13. <sql-statement>
  14. CREATE TABLE equipment_r (
  15. name text,
  16. hobby text
  17. );
  18. </sql-statement>
  19. <sql-statement>
  20. CREATE TABLE onek (
  21. unique1 int4,
  22. unique2 int4,
  23. two int4,
  24. four int4,
  25. ten int4,
  26. twenty int4,
  27. hundred int4,
  28. thousand int4,
  29. twothousand int4,
  30. fivethous int4,
  31. tenthous int4,
  32. odd int4,
  33. even int4,
  34. stringu1 name,
  35. stringu2 name,
  36. string4 name
  37. );
  38. </sql-statement>
  39. <sql-statement>
  40. CREATE TABLE tenk1 (
  41. unique1 int4,
  42. unique2 int4,
  43. two int4,
  44. four int4,
  45. ten int4,
  46. twenty int4,
  47. hundred int4,
  48. thousand int4,
  49. twothousand int4,
  50. fivethous int4,
  51. tenthous int4,
  52. odd int4,
  53. even int4,
  54. stringu1 name,
  55. stringu2 name,
  56. string4 name
  57. );
  58. </sql-statement>
  59. <sql-statement>
  60. CREATE TABLE tenk2 (
  61. unique1 int4,
  62. unique2 int4,
  63. two int4,
  64. four int4,
  65. ten int4,
  66. twenty int4,
  67. hundred int4,
  68. thousand int4,
  69. twothousand int4,
  70. fivethous int4,
  71. tenthous int4,
  72. odd int4,
  73. even int4,
  74. stringu1 name,
  75. stringu2 name,
  76. string4 name
  77. );
  78. </sql-statement>
  79. <sql-statement>
  80. CREATE TABLE person (
  81. name text,
  82. age int4,
  83. location point
  84. );
  85. </sql-statement>
  86. <sql-statement>
  87. CREATE TABLE emp (
  88. salary int4,
  89. manager name
  90. ) INHERITS (person);
  91. </sql-statement>
  92. -stdin-:<main>: Error: Parse Sql
  93. -stdin-:<main>:1:1: Error: table inheritance not supported
  94. CREATE TABLE emp (
  95. ^
  96. <sql-statement>
  97. CREATE TABLE student (
  98. gpa float8
  99. ) INHERITS (person);
  100. </sql-statement>
  101. -stdin-:<main>: Error: Parse Sql
  102. -stdin-:<main>:1:1: Error: table inheritance not supported
  103. CREATE TABLE student (
  104. ^
  105. <sql-statement>
  106. CREATE TABLE stud_emp (
  107. percent int4
  108. ) INHERITS (emp, student);
  109. </sql-statement>
  110. -stdin-:<main>: Error: Parse Sql
  111. -stdin-:<main>:1:1: Error: table inheritance not supported
  112. CREATE TABLE stud_emp (
  113. ^
  114. <sql-statement>
  115. CREATE TABLE city (
  116. name name,
  117. location box,
  118. budget city_budget
  119. );
  120. </sql-statement>
  121. <sql-statement>
  122. CREATE TABLE dept (
  123. dname name,
  124. mgrname text
  125. );
  126. </sql-statement>
  127. <sql-statement>
  128. CREATE TABLE slow_emp4000 (
  129. home_base box
  130. );
  131. </sql-statement>
  132. <sql-statement>
  133. CREATE TABLE fast_emp4000 (
  134. home_base box
  135. );
  136. </sql-statement>
  137. <sql-statement>
  138. CREATE TABLE road (
  139. name text,
  140. thepath path
  141. );
  142. </sql-statement>
  143. <sql-statement>
  144. CREATE TABLE ihighway () INHERITS (road);
  145. </sql-statement>
  146. -stdin-:<main>: Error: Parse Sql
  147. -stdin-:<main>:1:1: Error: table inheritance not supported
  148. CREATE TABLE ihighway () INHERITS (road);
  149. ^
  150. <sql-statement>
  151. CREATE TABLE shighway (
  152. surface text
  153. ) INHERITS (road);
  154. </sql-statement>
  155. -stdin-:<main>: Error: Parse Sql
  156. -stdin-:<main>:1:1: Error: table inheritance not supported
  157. CREATE TABLE shighway (
  158. ^
  159. <sql-statement>
  160. CREATE TABLE real_city (
  161. pop int4,
  162. cname text,
  163. outline path
  164. );
  165. </sql-statement>
  166. <sql-statement>
  167. --
  168. -- test the "star" operators a bit more thoroughly -- this time,
  169. -- throw in lots of NULL fields...
  170. --
  171. -- a is the type root
  172. -- b and c inherit from a (one-level single inheritance)
  173. -- d inherits from b and c (two-level multiple inheritance)
  174. -- e inherits from c (two-level single inheritance)
  175. -- f inherits from e (three-level single inheritance)
  176. --
  177. CREATE TABLE a_star (
  178. class char,
  179. a int4
  180. );
  181. </sql-statement>
  182. <sql-statement>
  183. CREATE TABLE b_star (
  184. b text
  185. ) INHERITS (a_star);
  186. </sql-statement>
  187. -stdin-:<main>: Error: Parse Sql
  188. -stdin-:<main>:1:1: Error: table inheritance not supported
  189. CREATE TABLE b_star (
  190. ^
  191. <sql-statement>
  192. CREATE TABLE c_star (
  193. c name
  194. ) INHERITS (a_star);
  195. </sql-statement>
  196. -stdin-:<main>: Error: Parse Sql
  197. -stdin-:<main>:1:1: Error: table inheritance not supported
  198. CREATE TABLE c_star (
  199. ^
  200. <sql-statement>
  201. CREATE TABLE d_star (
  202. d float8
  203. ) INHERITS (b_star, c_star);
  204. </sql-statement>
  205. -stdin-:<main>: Error: Parse Sql
  206. -stdin-:<main>:1:1: Error: table inheritance not supported
  207. CREATE TABLE d_star (
  208. ^
  209. <sql-statement>
  210. CREATE TABLE e_star (
  211. e int2
  212. ) INHERITS (c_star);
  213. </sql-statement>
  214. -stdin-:<main>: Error: Parse Sql
  215. -stdin-:<main>:1:1: Error: table inheritance not supported
  216. CREATE TABLE e_star (
  217. ^
  218. <sql-statement>
  219. CREATE TABLE f_star (
  220. f polygon
  221. ) INHERITS (e_star);
  222. </sql-statement>
  223. -stdin-:<main>: Error: Parse Sql
  224. -stdin-:<main>:1:1: Error: table inheritance not supported
  225. CREATE TABLE f_star (
  226. ^
  227. <sql-statement>
  228. CREATE TABLE aggtest (
  229. a int2,
  230. b float4
  231. );
  232. </sql-statement>
  233. <sql-statement>
  234. CREATE TABLE hash_i4_heap (
  235. seqno int4,
  236. random int4
  237. );
  238. </sql-statement>
  239. <sql-statement>
  240. CREATE TABLE hash_name_heap (
  241. seqno int4,
  242. random name
  243. );
  244. </sql-statement>
  245. <sql-statement>
  246. CREATE TABLE hash_txt_heap (
  247. seqno int4,
  248. random text
  249. );
  250. </sql-statement>
  251. <sql-statement>
  252. CREATE TABLE hash_f8_heap (
  253. seqno int4,
  254. random float8
  255. );
  256. </sql-statement>
  257. <sql-statement>
  258. -- don't include the hash_ovfl_heap stuff in the distribution
  259. -- the data set is too large for what it's worth
  260. --
  261. -- CREATE TABLE hash_ovfl_heap (
  262. -- x int4,
  263. -- y int4
  264. -- );
  265. CREATE TABLE bt_i4_heap (
  266. seqno int4,
  267. random int4
  268. );
  269. </sql-statement>
  270. <sql-statement>
  271. CREATE TABLE bt_name_heap (
  272. seqno name,
  273. random int4
  274. );
  275. </sql-statement>
  276. <sql-statement>
  277. CREATE TABLE bt_txt_heap (
  278. seqno text,
  279. random int4
  280. );
  281. </sql-statement>
  282. <sql-statement>
  283. CREATE TABLE bt_f8_heap (
  284. seqno float8,
  285. random int4
  286. );
  287. </sql-statement>
  288. <sql-statement>
  289. CREATE TABLE array_op_test (
  290. seqno int4,
  291. i int4[],
  292. t text[]
  293. );
  294. </sql-statement>
  295. <sql-statement>
  296. CREATE TABLE array_index_op_test (
  297. seqno int4,
  298. i int4[],
  299. t text[]
  300. );
  301. </sql-statement>
  302. <sql-statement>
  303. CREATE TABLE testjsonb (
  304. j jsonb
  305. );
  306. </sql-statement>
  307. <sql-statement>
  308. CREATE TABLE unknowntab (
  309. u unknown -- fail
  310. );
  311. </sql-statement>
  312. <sql-statement>
  313. CREATE TYPE unknown_comptype AS (
  314. u unknown -- fail
  315. );
  316. </sql-statement>
  317. -stdin-:<main>: Error: Parse Sql
  318. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
  319. CREATE TYPE unknown_comptype AS (
  320. ^
  321. <sql-statement>
  322. CREATE TABLE IF NOT EXISTS test_tsvector(
  323. t text,
  324. a tsvector
  325. );
  326. </sql-statement>
  327. <sql-statement>
  328. CREATE TABLE IF NOT EXISTS test_tsvector(
  329. t text
  330. );
  331. </sql-statement>
  332. <sql-statement>
  333. -- invalid: non-lowercase quoted reloptions identifiers
  334. CREATE TABLE tas_case WITH ("Fillfactor" = 10) AS SELECT 1 a;
  335. </sql-statement>
  336. -stdin-:<main>: Error: Parse Sql
  337. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
  338. -- invalid: non-lowercase quoted reloptions identifiers
  339. ^
  340. <sql-statement>
  341. CREATE TEMP TABLE explicitly_temp (a int primary key); -- also OK
  342. </sql-statement>
  343. <sql-statement>
  344. CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
  345. </sql-statement>
  346. -stdin-:<main>: Error: Parse Sql
  347. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
  348. CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
  349. ^
  350. <sql-statement>
  351. CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
  352. </sql-statement>
  353. -stdin-:<main>: Error: Parse Sql
  354. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
  355. CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
  356. ^
  357. <sql-statement>
  358. CREATE TABLE IF NOT EXISTS as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
  359. </sql-statement>
  360. -stdin-:<main>: Error: Parse Sql
  361. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
  362. CREATE TABLE IF NOT EXISTS as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
  363. ^
  364. <sql-statement>
  365. DROP TABLE as_select1;
  366. </sql-statement>
  367. <sql-statement>
  368. PREPARE select1 AS SELECT 1 as a;
  369. </sql-statement>
  370. -stdin-:<main>: Error: Parse Sql
  371. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 301
  372. PREPARE select1 AS SELECT 1 as a;
  373. ^
  374. <sql-statement>
  375. CREATE TABLE as_select1 AS EXECUTE select1;
  376. </sql-statement>
  377. -stdin-:<main>: Error: Parse Sql
  378. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
  379. CREATE TABLE as_select1 AS EXECUTE select1;
  380. ^
  381. <sql-statement>
  382. CREATE TABLE as_select1 AS EXECUTE select1;
  383. </sql-statement>
  384. -stdin-:<main>: Error: Parse Sql
  385. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
  386. CREATE TABLE as_select1 AS EXECUTE select1;
  387. ^
  388. <sql-statement>
  389. SELECT * FROM as_select1;
  390. </sql-statement>
  391. -stdin-:<main>: Fatal: Table metadata loading
  392. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.as_select1
  393. <sql-statement>
  394. CREATE TABLE IF NOT EXISTS as_select1 AS EXECUTE select1;
  395. </sql-statement>
  396. -stdin-:<main>: Error: Parse Sql
  397. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
  398. CREATE TABLE IF NOT EXISTS as_select1 AS EXECUTE select1;
  399. ^
  400. <sql-statement>
  401. DROP TABLE as_select1;
  402. </sql-statement>
  403. <sql-statement>
  404. DEALLOCATE select1;
  405. </sql-statement>
  406. -stdin-:<main>: Error: Parse Sql
  407. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 303
  408. DEALLOCATE select1;
  409. ^
  410. <sql-statement>
  411. -- create an extra wide table to test for issues related to that
  412. -- (temporarily hide query, to avoid the long CREATE TABLE stmt)
  413. \set ECHO none
  414. </sql-statement>
  415. Metacommand \set ECHO none is not supported
  416. <sql-statement>
  417. SELECT 'CREATE TABLE extra_wide_table(firstc text, '|| array_to_string(array_agg('c'||i||' bool'),',')||', lastc text);'
  418. FROM generate_series(1, 1100) g(i)
  419. \gexec
  420. </sql-statement>
  421. Metacommand \gexec is not supported
  422. <sql-statement>
  423. \set ECHO all
  424. </sql-statement>
  425. Metacommand \set ECHO all is not supported
  426. <sql-statement>
  427. INSERT INTO extra_wide_table(firstc, lastc) VALUES('first col', 'last col');
  428. </sql-statement>
  429. -stdin-:<main>: Fatal: Table metadata loading
  430. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.extra_wide_table
  431. <sql-statement>
  432. SELECT firstc, lastc FROM extra_wide_table;
  433. </sql-statement>
  434. -stdin-:<main>: Fatal: Table metadata loading
  435. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.extra_wide_table
  436. <sql-statement>
  437. -- check that tables with oids cannot be created anymore
  438. CREATE TABLE withoid() WITH OIDS;
  439. </sql-statement>
  440. -stdin-:<main>: Error: Parse Sql
  441. -stdin-:<main>:2:29: Error: ERROR: syntax error at or near "OIDS"
  442. CREATE TABLE withoid() WITH OIDS;
  443. ^
  444. <sql-statement>
  445. CREATE TABLE withoid() WITH (oids);
  446. </sql-statement>
  447. -stdin-:<main>: Error: Parse Sql
  448. -stdin-:<main>:1:1: Error: table options not supported
  449. CREATE TABLE withoid() WITH (oids);
  450. ^
  451. <sql-statement>
  452. CREATE TABLE withoid() WITH (oids = true);
  453. </sql-statement>
  454. -stdin-:<main>: Error: Parse Sql
  455. -stdin-:<main>:1:1: Error: table options not supported
  456. CREATE TABLE withoid() WITH (oids = true);
  457. ^
  458. <sql-statement>
  459. -- but explicitly not adding oids is still supported
  460. CREATE TEMP TABLE withoutoid() WITHOUT OIDS;
  461. </sql-statement>
  462. <sql-statement>
  463. DROP TABLE withoutoid;
  464. </sql-statement>
  465. <sql-statement>
  466. CREATE TEMP TABLE withoutoid() WITH (oids = false);
  467. </sql-statement>
  468. -stdin-:<main>: Error: Parse Sql
  469. -stdin-:<main>:1:1: Error: table options not supported
  470. CREATE TEMP TABLE withoutoid() WITH (oids = false);
  471. ^
  472. <sql-statement>
  473. DROP TABLE withoutoid;
  474. </sql-statement>
  475. <sql-statement>
  476. -- check restriction with default expressions
  477. -- invalid use of column reference in default expressions
  478. CREATE TABLE default_expr_column (id int DEFAULT (id));
  479. </sql-statement>
  480. -stdin-:<main>: Error: Parse Sql
  481. -stdin-:<main>:3:51: Error: Columns are not allowed in: DEFAULT
  482. CREATE TABLE default_expr_column (id int DEFAULT (id));
  483. ^
  484. <sql-statement>
  485. CREATE TABLE default_expr_column (id int DEFAULT (bar.id));
  486. </sql-statement>
  487. -stdin-:<main>: Error: Parse Sql
  488. -stdin-:<main>:1:51: Error: Columns are not allowed in: DEFAULT
  489. CREATE TABLE default_expr_column (id int DEFAULT (bar.id));
  490. ^
  491. <sql-statement>
  492. CREATE TABLE default_expr_agg_column (id int DEFAULT (avg(id)));
  493. </sql-statement>
  494. -stdin-:<main>: Error: Parse Sql
  495. -stdin-:<main>:1:55: Error: Aggregate functions are not allowed in: DEFAULT
  496. CREATE TABLE default_expr_agg_column (id int DEFAULT (avg(id)));
  497. ^
  498. <sql-statement>
  499. -- invalid column definition
  500. CREATE TABLE default_expr_non_column (a int DEFAULT (avg(non_existent)));
  501. </sql-statement>
  502. -stdin-:<main>: Error: Parse Sql
  503. -stdin-:<main>:2:54: Error: Aggregate functions are not allowed in: DEFAULT
  504. CREATE TABLE default_expr_non_column (a int DEFAULT (avg(non_existent)));
  505. ^
  506. <sql-statement>
  507. -- invalid use of aggregate
  508. CREATE TABLE default_expr_agg (a int DEFAULT (avg(1)));
  509. </sql-statement>
  510. -stdin-:<main>: Error: Parse Sql
  511. -stdin-:<main>:2:47: Error: Aggregate functions are not allowed in: DEFAULT
  512. CREATE TABLE default_expr_agg (a int DEFAULT (avg(1)));
  513. ^
  514. <sql-statement>
  515. -- invalid use of subquery
  516. CREATE TABLE default_expr_agg (a int DEFAULT (select 1));
  517. </sql-statement>
  518. -stdin-:<main>: Error: Parse Sql
  519. -stdin-:<main>:2:46: Error: SubLinks are not allowed in: DEFAULT
  520. CREATE TABLE default_expr_agg (a int DEFAULT (select 1));
  521. ^
  522. <sql-statement>
  523. -- invalid use of set-returning function
  524. CREATE TABLE default_expr_agg (a int DEFAULT (generate_series(1,3)));
  525. </sql-statement>
  526. -stdin-:<main>: Error: Parse Sql
  527. -stdin-:<main>:2:47: Error: Generator functions are not allowed in: DEFAULT
  528. CREATE TABLE default_expr_agg (a int DEFAULT (generate_series(1,3)));
  529. ^
  530. <sql-statement>
  531. -- Verify that subtransaction rollback restores rd_createSubid.
  532. BEGIN;
  533. </sql-statement>
  534. <sql-statement>
  535. CREATE TABLE remember_create_subid (c int);
  536. </sql-statement>
  537. <sql-statement>
  538. SAVEPOINT q;
  539. </sql-statement>
  540. <sql-statement>
  541. DROP TABLE remember_create_subid;
  542. </sql-statement>
  543. <sql-statement>
  544. ROLLBACK TO q;
  545. </sql-statement>
  546. <sql-statement>
  547. COMMIT;
  548. </sql-statement>
  549. <sql-statement>
  550. DROP TABLE remember_create_subid;
  551. </sql-statement>
  552. <sql-statement>
  553. -- Verify that subtransaction rollback restores rd_firstRelfilenodeSubid.
  554. CREATE TABLE remember_node_subid (c int);
  555. </sql-statement>
  556. <sql-statement>
  557. BEGIN;
  558. </sql-statement>
  559. <sql-statement>
  560. ALTER TABLE remember_node_subid ALTER c TYPE bigint;
  561. </sql-statement>
  562. -stdin-:<main>: Error: Parse Sql
  563. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  564. ALTER TABLE remember_node_subid ALTER c TYPE bigint;
  565. ^
  566. <sql-statement>
  567. SAVEPOINT q;
  568. </sql-statement>
  569. <sql-statement>
  570. DROP TABLE remember_node_subid;
  571. </sql-statement>
  572. <sql-statement>
  573. ROLLBACK TO q;
  574. </sql-statement>
  575. <sql-statement>
  576. COMMIT;
  577. </sql-statement>
  578. <sql-statement>
  579. DROP TABLE remember_node_subid;
  580. </sql-statement>
  581. <sql-statement>
  582. --
  583. -- Partitioned tables
  584. --
  585. -- cannot combine INHERITS and PARTITION BY (although grammar allows)
  586. CREATE TABLE partitioned (
  587. a int
  588. ) INHERITS (some_table) PARTITION BY LIST (a);
  589. </sql-statement>
  590. -stdin-:<main>: Error: Parse Sql
  591. -stdin-:<main>:1:1: Error: table inheritance not supported
  592. --
  593. ^
  594. <sql-statement>
  595. -- cannot use more than 1 column as partition key for list partitioned table
  596. CREATE TABLE partitioned (
  597. a1 int,
  598. a2 int
  599. ) PARTITION BY LIST (a1, a2); -- fail
  600. </sql-statement>
  601. -stdin-:<main>: Error: Parse Sql
  602. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  603. -- cannot use more than 1 column as partition key for list partitioned table
  604. ^
  605. <sql-statement>
  606. -- unsupported constraint type for partitioned tables
  607. CREATE TABLE partitioned (
  608. a int,
  609. EXCLUDE USING gist (a WITH &&)
  610. ) PARTITION BY RANGE (a);
  611. </sql-statement>
  612. -stdin-:<main>: Error: Parse Sql
  613. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  614. -- unsupported constraint type for partitioned tables
  615. ^
  616. <sql-statement>
  617. -- prevent using prohibited expressions in the key
  618. CREATE FUNCTION retset (a int) RETURNS SETOF int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
  619. </sql-statement>
  620. -stdin-:<main>: Error: Parse Sql
  621. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  622. -- prevent using prohibited expressions in the key
  623. ^
  624. <sql-statement>
  625. CREATE TABLE partitioned (
  626. a int
  627. ) PARTITION BY RANGE (retset(a));
  628. </sql-statement>
  629. -stdin-:<main>: Error: Parse Sql
  630. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  631. CREATE TABLE partitioned (
  632. ^
  633. <sql-statement>
  634. DROP FUNCTION retset(int);
  635. </sql-statement>
  636. -stdin-:<main>: Error: Parse Sql
  637. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
  638. DROP FUNCTION retset(int);
  639. ^
  640. <sql-statement>
  641. CREATE TABLE partitioned (
  642. a int
  643. ) PARTITION BY RANGE ((avg(a)));
  644. </sql-statement>
  645. -stdin-:<main>: Error: Parse Sql
  646. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  647. CREATE TABLE partitioned (
  648. ^
  649. <sql-statement>
  650. CREATE TABLE partitioned (
  651. a int,
  652. b int
  653. ) PARTITION BY RANGE ((avg(a) OVER (PARTITION BY b)));
  654. </sql-statement>
  655. -stdin-:<main>: Error: Parse Sql
  656. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  657. CREATE TABLE partitioned (
  658. ^
  659. <sql-statement>
  660. CREATE TABLE partitioned (
  661. a int
  662. ) PARTITION BY LIST ((a LIKE (SELECT 1)));
  663. </sql-statement>
  664. -stdin-:<main>: Error: Parse Sql
  665. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  666. CREATE TABLE partitioned (
  667. ^
  668. <sql-statement>
  669. CREATE TABLE partitioned (
  670. a int
  671. ) PARTITION BY RANGE ((42));
  672. </sql-statement>
  673. -stdin-:<main>: Error: Parse Sql
  674. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  675. CREATE TABLE partitioned (
  676. ^
  677. <sql-statement>
  678. CREATE FUNCTION const_func () RETURNS int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
  679. </sql-statement>
  680. -stdin-:<main>: Error: Parse Sql
  681. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  682. CREATE FUNCTION const_func () RETURNS int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
  683. ^
  684. <sql-statement>
  685. CREATE TABLE partitioned (
  686. a int
  687. ) PARTITION BY RANGE (const_func());
  688. </sql-statement>
  689. -stdin-:<main>: Error: Parse Sql
  690. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  691. CREATE TABLE partitioned (
  692. ^
  693. <sql-statement>
  694. DROP FUNCTION const_func();
  695. </sql-statement>
  696. -stdin-:<main>: Error: Parse Sql
  697. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
  698. DROP FUNCTION const_func();
  699. ^
  700. <sql-statement>
  701. -- only accept valid partitioning strategy
  702. CREATE TABLE partitioned (
  703. a int
  704. ) PARTITION BY MAGIC (a);
  705. </sql-statement>
  706. -stdin-:<main>: Error: Parse Sql
  707. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  708. -- only accept valid partitioning strategy
  709. ^
  710. <sql-statement>
  711. -- specified column must be present in the table
  712. CREATE TABLE partitioned (
  713. a int
  714. ) PARTITION BY RANGE (b);
  715. </sql-statement>
  716. -stdin-:<main>: Error: Parse Sql
  717. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  718. -- specified column must be present in the table
  719. ^
  720. <sql-statement>
  721. -- cannot use system columns in partition key
  722. CREATE TABLE partitioned (
  723. a int
  724. ) PARTITION BY RANGE (xmin);
  725. </sql-statement>
  726. -stdin-:<main>: Error: Parse Sql
  727. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  728. -- cannot use system columns in partition key
  729. ^
  730. <sql-statement>
  731. -- cannot use pseudotypes
  732. CREATE TABLE partitioned (
  733. a int,
  734. b int
  735. ) PARTITION BY RANGE (((a, b)));
  736. </sql-statement>
  737. -stdin-:<main>: Error: Parse Sql
  738. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  739. -- cannot use pseudotypes
  740. ^
  741. <sql-statement>
  742. CREATE TABLE partitioned (
  743. a int,
  744. b int
  745. ) PARTITION BY RANGE (a, ('unknown'));
  746. </sql-statement>
  747. -stdin-:<main>: Error: Parse Sql
  748. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  749. CREATE TABLE partitioned (
  750. ^
  751. <sql-statement>
  752. -- functions in key must be immutable
  753. CREATE FUNCTION immut_func (a int) RETURNS int AS $$ SELECT a + random()::int; $$ LANGUAGE SQL;
  754. </sql-statement>
  755. -stdin-:<main>: Error: Parse Sql
  756. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  757. -- functions in key must be immutable
  758. ^
  759. <sql-statement>
  760. CREATE TABLE partitioned (
  761. a int
  762. ) PARTITION BY RANGE (immut_func(a));
  763. </sql-statement>
  764. -stdin-:<main>: Error: Parse Sql
  765. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  766. CREATE TABLE partitioned (
  767. ^
  768. <sql-statement>
  769. DROP FUNCTION immut_func(int);
  770. </sql-statement>
  771. -stdin-:<main>: Error: Parse Sql
  772. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
  773. DROP FUNCTION immut_func(int);
  774. ^
  775. <sql-statement>
  776. -- prevent using columns of unsupported types in key (type must have a btree operator class)
  777. CREATE TABLE partitioned (
  778. a point
  779. ) PARTITION BY LIST (a);
  780. </sql-statement>
  781. -stdin-:<main>: Error: Parse Sql
  782. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  783. -- prevent using columns of unsupported types in key (type must have a btree operator class)
  784. ^
  785. <sql-statement>
  786. CREATE TABLE partitioned (
  787. a point
  788. ) PARTITION BY LIST (a point_ops);
  789. </sql-statement>
  790. -stdin-:<main>: Error: Parse Sql
  791. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  792. CREATE TABLE partitioned (
  793. ^
  794. <sql-statement>
  795. CREATE TABLE partitioned (
  796. a point
  797. ) PARTITION BY RANGE (a);
  798. </sql-statement>
  799. -stdin-:<main>: Error: Parse Sql
  800. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  801. CREATE TABLE partitioned (
  802. ^
  803. <sql-statement>
  804. CREATE TABLE partitioned (
  805. a point
  806. ) PARTITION BY RANGE (a point_ops);
  807. </sql-statement>
  808. -stdin-:<main>: Error: Parse Sql
  809. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  810. CREATE TABLE partitioned (
  811. ^
  812. <sql-statement>
  813. -- cannot add NO INHERIT constraints to partitioned tables
  814. CREATE TABLE partitioned (
  815. a int,
  816. CONSTRAINT check_a CHECK (a > 0) NO INHERIT
  817. ) PARTITION BY RANGE (a);
  818. </sql-statement>
  819. -stdin-:<main>: Error: Parse Sql
  820. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  821. -- cannot add NO INHERIT constraints to partitioned tables
  822. ^
  823. <sql-statement>
  824. -- some checks after successful creation of a partitioned table
  825. CREATE FUNCTION plusone(a int) RETURNS INT AS $$ SELECT a+1; $$ LANGUAGE SQL;
  826. </sql-statement>
  827. -stdin-:<main>: Error: Parse Sql
  828. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  829. -- some checks after successful creation of a partitioned table
  830. ^
  831. <sql-statement>
  832. CREATE TABLE partitioned (
  833. a int,
  834. b int,
  835. c text,
  836. d text
  837. ) PARTITION BY RANGE (a oid_ops, plusone(b), c collate "default", d collate "C");
  838. </sql-statement>
  839. -stdin-:<main>: Error: Parse Sql
  840. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  841. CREATE TABLE partitioned (
  842. ^
  843. <sql-statement>
  844. -- check relkind
  845. SELECT relkind FROM pg_class WHERE relname = 'partitioned';
  846. </sql-statement>
  847. <sql-statement>
  848. -- prevent a function referenced in partition key from being dropped
  849. DROP FUNCTION plusone(int);
  850. </sql-statement>
  851. -stdin-:<main>: Error: Parse Sql
  852. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
  853. -- prevent a function referenced in partition key from being dropped
  854. ^
  855. <sql-statement>
  856. -- partitioned table cannot participate in regular inheritance
  857. CREATE TABLE partitioned2 (
  858. a int,
  859. b text
  860. ) PARTITION BY RANGE ((a+1), substr(b, 1, 5));
  861. </sql-statement>
  862. -stdin-:<main>: Error: Parse Sql
  863. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  864. -- partitioned table cannot participate in regular inheritance
  865. ^
  866. <sql-statement>
  867. CREATE TABLE fail () INHERITS (partitioned2);
  868. </sql-statement>
  869. -stdin-:<main>: Error: Parse Sql
  870. -stdin-:<main>:1:1: Error: table inheritance not supported
  871. CREATE TABLE fail () INHERITS (partitioned2);
  872. ^
  873. <sql-statement>
  874. -- Partition key in describe output
  875. \d partitioned
  876. </sql-statement>
  877. Metacommand \d partitioned is not supported
  878. <sql-statement>
  879. \d+ partitioned2
  880. </sql-statement>
  881. Metacommand \d+ partitioned2 is not supported
  882. <sql-statement>
  883. INSERT INTO partitioned2 VALUES (1, 'hello');
  884. </sql-statement>
  885. -stdin-:<main>: Fatal: Table metadata loading
  886. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.partitioned2
  887. <sql-statement>
  888. CREATE TABLE part2_1 PARTITION OF partitioned2 FOR VALUES FROM (-1, 'aaaaa') TO (100, 'ccccc');
  889. </sql-statement>
  890. -stdin-:<main>: Error: Parse Sql
  891. -stdin-:<main>:1:1: Error: table inheritance not supported
  892. CREATE TABLE part2_1 PARTITION OF partitioned2 FOR VALUES FROM (-1, 'aaaaa') TO (100, 'ccccc');
  893. ^
  894. <sql-statement>
  895. \d+ part2_1
  896. </sql-statement>
  897. Metacommand \d+ part2_1 is not supported
  898. <sql-statement>
  899. DROP TABLE partitioned, partitioned2;
  900. </sql-statement>
  901. <sql-statement>
  902. -- check reference to partitioned table's rowtype in partition descriptor
  903. create table partitioned (a int, b int)
  904. partition by list ((row(a, b)::partitioned));
  905. </sql-statement>
  906. -stdin-:<main>: Error: Parse Sql
  907. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  908. -- check reference to partitioned table's rowtype in partition descriptor
  909. ^
  910. <sql-statement>
  911. create table partitioned1
  912. partition of partitioned for values in ('(1,2)'::partitioned);
  913. </sql-statement>
  914. -stdin-:<main>: Error: Parse Sql
  915. -stdin-:<main>:1:1: Error: table inheritance not supported
  916. create table partitioned1
  917. ^
  918. <sql-statement>
  919. create table partitioned2
  920. partition of partitioned for values in ('(2,4)'::partitioned);
  921. </sql-statement>
  922. -stdin-:<main>: Error: Parse Sql
  923. -stdin-:<main>:1:1: Error: table inheritance not supported
  924. create table partitioned2
  925. ^
  926. <sql-statement>
  927. explain (costs off)
  928. select * from partitioned where row(a,b)::partitioned = '(1,2)'::partitioned;
  929. </sql-statement>
  930. -stdin-:<main>: Error: Parse Sql
  931. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  932. explain (costs off)
  933. ^
  934. <sql-statement>
  935. drop table partitioned;
  936. </sql-statement>
  937. <sql-statement>
  938. -- whole-row Var in partition key works too
  939. create table partitioned (a int, b int)
  940. partition by list ((partitioned));
  941. </sql-statement>
  942. -stdin-:<main>: Error: Parse Sql
  943. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  944. -- whole-row Var in partition key works too
  945. ^
  946. <sql-statement>
  947. create table partitioned1
  948. partition of partitioned for values in ('(1,2)');
  949. </sql-statement>
  950. -stdin-:<main>: Error: Parse Sql
  951. -stdin-:<main>:1:1: Error: table inheritance not supported
  952. create table partitioned1
  953. ^
  954. <sql-statement>
  955. create table partitioned2
  956. partition of partitioned for values in ('(2,4)');
  957. </sql-statement>
  958. -stdin-:<main>: Error: Parse Sql
  959. -stdin-:<main>:1:1: Error: table inheritance not supported
  960. create table partitioned2
  961. ^
  962. <sql-statement>
  963. explain (costs off)
  964. select * from partitioned where partitioned = '(1,2)'::partitioned;
  965. </sql-statement>
  966. -stdin-:<main>: Error: Parse Sql
  967. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  968. explain (costs off)
  969. ^
  970. <sql-statement>
  971. \d+ partitioned1
  972. </sql-statement>
  973. Metacommand \d+ partitioned1 is not supported
  974. <sql-statement>
  975. drop table partitioned;
  976. </sql-statement>
  977. <sql-statement>
  978. -- check that dependencies of partition columns are handled correctly
  979. create domain intdom1 as int;
  980. </sql-statement>
  981. -stdin-:<main>: Error: Parse Sql
  982. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
  983. -- check that dependencies of partition columns are handled correctly
  984. ^
  985. <sql-statement>
  986. create table partitioned (
  987. a intdom1,
  988. b text
  989. ) partition by range (a);
  990. </sql-statement>
  991. -stdin-:<main>: Error: Parse Sql
  992. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  993. create table partitioned (
  994. ^
  995. <sql-statement>
  996. alter table partitioned drop column a; -- fail
  997. </sql-statement>
  998. -stdin-:<main>: Error: Parse Sql
  999. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1000. alter table partitioned drop column a; -- fail
  1001. ^
  1002. <sql-statement>
  1003. drop domain intdom1; -- fail, requires cascade
  1004. </sql-statement>
  1005. -stdin-:<main>: Error: Parse Sql
  1006. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
  1007. drop domain intdom1; -- fail, requires cascade
  1008. ^
  1009. <sql-statement>
  1010. drop domain intdom1 cascade;
  1011. </sql-statement>
  1012. -stdin-:<main>: Error: Parse Sql
  1013. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
  1014. drop domain intdom1 cascade;
  1015. ^
  1016. <sql-statement>
  1017. table partitioned; -- gone
  1018. </sql-statement>
  1019. -stdin-:<main>: Fatal: Table metadata loading
  1020. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.partitioned
  1021. <sql-statement>
  1022. -- likewise for columns used in partition expressions
  1023. create domain intdom1 as int;
  1024. </sql-statement>
  1025. -stdin-:<main>: Error: Parse Sql
  1026. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
  1027. -- likewise for columns used in partition expressions
  1028. ^
  1029. <sql-statement>
  1030. create table partitioned (
  1031. a intdom1,
  1032. b text
  1033. ) partition by range (plusone(a));
  1034. </sql-statement>
  1035. -stdin-:<main>: Error: Parse Sql
  1036. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1037. create table partitioned (
  1038. ^
  1039. <sql-statement>
  1040. alter table partitioned drop column a; -- fail
  1041. </sql-statement>
  1042. -stdin-:<main>: Error: Parse Sql
  1043. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1044. alter table partitioned drop column a; -- fail
  1045. ^
  1046. <sql-statement>
  1047. drop domain intdom1; -- fail, requires cascade
  1048. </sql-statement>
  1049. -stdin-:<main>: Error: Parse Sql
  1050. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
  1051. drop domain intdom1; -- fail, requires cascade
  1052. ^
  1053. <sql-statement>
  1054. drop domain intdom1 cascade;
  1055. </sql-statement>
  1056. -stdin-:<main>: Error: Parse Sql
  1057. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
  1058. drop domain intdom1 cascade;
  1059. ^
  1060. <sql-statement>
  1061. table partitioned; -- gone
  1062. </sql-statement>
  1063. -stdin-:<main>: Fatal: Table metadata loading
  1064. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.partitioned
  1065. <sql-statement>
  1066. --
  1067. -- Partitions
  1068. --
  1069. -- check partition bound syntax
  1070. CREATE TABLE list_parted (
  1071. a int
  1072. ) PARTITION BY LIST (a);
  1073. </sql-statement>
  1074. -stdin-:<main>: Error: Parse Sql
  1075. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1076. --
  1077. ^
  1078. <sql-statement>
  1079. CREATE TABLE part_p1 PARTITION OF list_parted FOR VALUES IN ('1');
  1080. </sql-statement>
  1081. -stdin-:<main>: Error: Parse Sql
  1082. -stdin-:<main>:1:1: Error: table inheritance not supported
  1083. CREATE TABLE part_p1 PARTITION OF list_parted FOR VALUES IN ('1');
  1084. ^
  1085. <sql-statement>
  1086. CREATE TABLE part_p2 PARTITION OF list_parted FOR VALUES IN (2);
  1087. </sql-statement>
  1088. -stdin-:<main>: Error: Parse Sql
  1089. -stdin-:<main>:1:1: Error: table inheritance not supported
  1090. CREATE TABLE part_p2 PARTITION OF list_parted FOR VALUES IN (2);
  1091. ^
  1092. <sql-statement>
  1093. CREATE TABLE part_p3 PARTITION OF list_parted FOR VALUES IN ((2+1));
  1094. </sql-statement>
  1095. -stdin-:<main>: Error: Parse Sql
  1096. -stdin-:<main>:1:1: Error: table inheritance not supported
  1097. CREATE TABLE part_p3 PARTITION OF list_parted FOR VALUES IN ((2+1));
  1098. ^
  1099. <sql-statement>
  1100. CREATE TABLE part_null PARTITION OF list_parted FOR VALUES IN (null);
  1101. </sql-statement>
  1102. -stdin-:<main>: Error: Parse Sql
  1103. -stdin-:<main>:1:1: Error: table inheritance not supported
  1104. CREATE TABLE part_null PARTITION OF list_parted FOR VALUES IN (null);
  1105. ^
  1106. <sql-statement>
  1107. \d+ list_parted
  1108. </sql-statement>
  1109. Metacommand \d+ list_parted is not supported
  1110. <sql-statement>
  1111. -- forbidden expressions for partition bound with list partitioned table
  1112. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename);
  1113. </sql-statement>
  1114. -stdin-:<main>: Error: Parse Sql
  1115. -stdin-:<main>:1:1: Error: table inheritance not supported
  1116. -- forbidden expressions for partition bound with list partitioned table
  1117. ^
  1118. <sql-statement>
  1119. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename.somename);
  1120. </sql-statement>
  1121. -stdin-:<main>: Error: Parse Sql
  1122. -stdin-:<main>:1:1: Error: table inheritance not supported
  1123. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename.somename);
  1124. ^
  1125. <sql-statement>
  1126. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (a);
  1127. </sql-statement>
  1128. -stdin-:<main>: Error: Parse Sql
  1129. -stdin-:<main>:1:1: Error: table inheritance not supported
  1130. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (a);
  1131. ^
  1132. <sql-statement>
  1133. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(a));
  1134. </sql-statement>
  1135. -stdin-:<main>: Error: Parse Sql
  1136. -stdin-:<main>:1:1: Error: table inheritance not supported
  1137. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(a));
  1138. ^
  1139. <sql-statement>
  1140. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(somename));
  1141. </sql-statement>
  1142. -stdin-:<main>: Error: Parse Sql
  1143. -stdin-:<main>:1:1: Error: table inheritance not supported
  1144. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(somename));
  1145. ^
  1146. <sql-statement>
  1147. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(1));
  1148. </sql-statement>
  1149. -stdin-:<main>: Error: Parse Sql
  1150. -stdin-:<main>:1:1: Error: table inheritance not supported
  1151. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(1));
  1152. ^
  1153. <sql-statement>
  1154. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((select 1));
  1155. </sql-statement>
  1156. -stdin-:<main>: Error: Parse Sql
  1157. -stdin-:<main>:1:1: Error: table inheritance not supported
  1158. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((select 1));
  1159. ^
  1160. <sql-statement>
  1161. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (generate_series(4, 6));
  1162. </sql-statement>
  1163. -stdin-:<main>: Error: Parse Sql
  1164. -stdin-:<main>:1:1: Error: table inheritance not supported
  1165. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (generate_series(4, 6));
  1166. ^
  1167. <sql-statement>
  1168. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((1+1) collate "POSIX");
  1169. </sql-statement>
  1170. -stdin-:<main>: Error: Parse Sql
  1171. -stdin-:<main>:1:1: Error: table inheritance not supported
  1172. CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((1+1) collate "POSIX");
  1173. ^
  1174. <sql-statement>
  1175. -- syntax does not allow empty list of values for list partitions
  1176. CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
  1177. </sql-statement>
  1178. -stdin-:<main>: Error: Parse Sql
  1179. -stdin-:<main>:2:64: Error: ERROR: syntax error at or near ")"
  1180. CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
  1181. ^
  1182. <sql-statement>
  1183. -- trying to specify range for list partitioned table
  1184. CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES FROM (1) TO (2);
  1185. </sql-statement>
  1186. -stdin-:<main>: Error: Parse Sql
  1187. -stdin-:<main>:1:1: Error: table inheritance not supported
  1188. -- trying to specify range for list partitioned table
  1189. ^
  1190. <sql-statement>
  1191. -- trying to specify modulus and remainder for list partitioned table
  1192. CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
  1193. </sql-statement>
  1194. -stdin-:<main>: Error: Parse Sql
  1195. -stdin-:<main>:2:66: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1196. CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
  1197. ^
  1198. <sql-statement>
  1199. -- check default partition cannot be created more than once
  1200. CREATE TABLE part_default PARTITION OF list_parted DEFAULT;
  1201. </sql-statement>
  1202. -stdin-:<main>: Error: Parse Sql
  1203. -stdin-:<main>:1:1: Error: table inheritance not supported
  1204. -- check default partition cannot be created more than once
  1205. ^
  1206. <sql-statement>
  1207. CREATE TABLE fail_default_part PARTITION OF list_parted DEFAULT;
  1208. </sql-statement>
  1209. -stdin-:<main>: Error: Parse Sql
  1210. -stdin-:<main>:1:1: Error: table inheritance not supported
  1211. CREATE TABLE fail_default_part PARTITION OF list_parted DEFAULT;
  1212. ^
  1213. <sql-statement>
  1214. -- specified literal can't be cast to the partition column data type
  1215. CREATE TABLE bools (
  1216. a bool
  1217. ) PARTITION BY LIST (a);
  1218. </sql-statement>
  1219. -stdin-:<main>: Error: Parse Sql
  1220. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1221. -- specified literal can't be cast to the partition column data type
  1222. ^
  1223. <sql-statement>
  1224. CREATE TABLE bools_true PARTITION OF bools FOR VALUES IN (1);
  1225. </sql-statement>
  1226. -stdin-:<main>: Error: Parse Sql
  1227. -stdin-:<main>:1:1: Error: table inheritance not supported
  1228. CREATE TABLE bools_true PARTITION OF bools FOR VALUES IN (1);
  1229. ^
  1230. <sql-statement>
  1231. DROP TABLE bools;
  1232. </sql-statement>
  1233. <sql-statement>
  1234. -- specified literal can be cast, and the cast might not be immutable
  1235. CREATE TABLE moneyp (
  1236. a money
  1237. ) PARTITION BY LIST (a);
  1238. </sql-statement>
  1239. -stdin-:<main>: Error: Parse Sql
  1240. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1241. -- specified literal can be cast, and the cast might not be immutable
  1242. ^
  1243. <sql-statement>
  1244. CREATE TABLE moneyp_10 PARTITION OF moneyp FOR VALUES IN (10);
  1245. </sql-statement>
  1246. -stdin-:<main>: Error: Parse Sql
  1247. -stdin-:<main>:1:1: Error: table inheritance not supported
  1248. CREATE TABLE moneyp_10 PARTITION OF moneyp FOR VALUES IN (10);
  1249. ^
  1250. <sql-statement>
  1251. CREATE TABLE moneyp_11 PARTITION OF moneyp FOR VALUES IN ('11');
  1252. </sql-statement>
  1253. -stdin-:<main>: Error: Parse Sql
  1254. -stdin-:<main>:1:1: Error: table inheritance not supported
  1255. CREATE TABLE moneyp_11 PARTITION OF moneyp FOR VALUES IN ('11');
  1256. ^
  1257. <sql-statement>
  1258. CREATE TABLE moneyp_12 PARTITION OF moneyp FOR VALUES IN (to_char(12, '99')::int);
  1259. </sql-statement>
  1260. -stdin-:<main>: Error: Parse Sql
  1261. -stdin-:<main>:1:1: Error: table inheritance not supported
  1262. CREATE TABLE moneyp_12 PARTITION OF moneyp FOR VALUES IN (to_char(12, '99')::int);
  1263. ^
  1264. <sql-statement>
  1265. DROP TABLE moneyp;
  1266. </sql-statement>
  1267. <sql-statement>
  1268. -- cast is immutable
  1269. CREATE TABLE bigintp (
  1270. a bigint
  1271. ) PARTITION BY LIST (a);
  1272. </sql-statement>
  1273. -stdin-:<main>: Error: Parse Sql
  1274. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1275. -- cast is immutable
  1276. ^
  1277. <sql-statement>
  1278. CREATE TABLE bigintp_10 PARTITION OF bigintp FOR VALUES IN (10);
  1279. </sql-statement>
  1280. -stdin-:<main>: Error: Parse Sql
  1281. -stdin-:<main>:1:1: Error: table inheritance not supported
  1282. CREATE TABLE bigintp_10 PARTITION OF bigintp FOR VALUES IN (10);
  1283. ^
  1284. <sql-statement>
  1285. -- fails due to overlap:
  1286. CREATE TABLE bigintp_10_2 PARTITION OF bigintp FOR VALUES IN ('10');
  1287. </sql-statement>
  1288. -stdin-:<main>: Error: Parse Sql
  1289. -stdin-:<main>:1:1: Error: table inheritance not supported
  1290. -- fails due to overlap:
  1291. ^
  1292. <sql-statement>
  1293. DROP TABLE bigintp;
  1294. </sql-statement>
  1295. <sql-statement>
  1296. CREATE TABLE range_parted (
  1297. a date
  1298. ) PARTITION BY RANGE (a);
  1299. </sql-statement>
  1300. -stdin-:<main>: Error: Parse Sql
  1301. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1302. CREATE TABLE range_parted (
  1303. ^
  1304. <sql-statement>
  1305. -- forbidden expressions for partition bounds with range partitioned table
  1306. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1307. FOR VALUES FROM (somename) TO ('2019-01-01');
  1308. </sql-statement>
  1309. -stdin-:<main>: Error: Parse Sql
  1310. -stdin-:<main>:1:1: Error: table inheritance not supported
  1311. -- forbidden expressions for partition bounds with range partitioned table
  1312. ^
  1313. <sql-statement>
  1314. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1315. FOR VALUES FROM (somename.somename) TO ('2019-01-01');
  1316. </sql-statement>
  1317. -stdin-:<main>: Error: Parse Sql
  1318. -stdin-:<main>:1:1: Error: table inheritance not supported
  1319. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1320. ^
  1321. <sql-statement>
  1322. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1323. FOR VALUES FROM (a) TO ('2019-01-01');
  1324. </sql-statement>
  1325. -stdin-:<main>: Error: Parse Sql
  1326. -stdin-:<main>:1:1: Error: table inheritance not supported
  1327. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1328. ^
  1329. <sql-statement>
  1330. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1331. FOR VALUES FROM (max(a)) TO ('2019-01-01');
  1332. </sql-statement>
  1333. -stdin-:<main>: Error: Parse Sql
  1334. -stdin-:<main>:1:1: Error: table inheritance not supported
  1335. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1336. ^
  1337. <sql-statement>
  1338. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1339. FOR VALUES FROM (max(somename)) TO ('2019-01-01');
  1340. </sql-statement>
  1341. -stdin-:<main>: Error: Parse Sql
  1342. -stdin-:<main>:1:1: Error: table inheritance not supported
  1343. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1344. ^
  1345. <sql-statement>
  1346. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1347. FOR VALUES FROM (max('2019-02-01'::date)) TO ('2019-01-01');
  1348. </sql-statement>
  1349. -stdin-:<main>: Error: Parse Sql
  1350. -stdin-:<main>:1:1: Error: table inheritance not supported
  1351. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1352. ^
  1353. <sql-statement>
  1354. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1355. FOR VALUES FROM ((select 1)) TO ('2019-01-01');
  1356. </sql-statement>
  1357. -stdin-:<main>: Error: Parse Sql
  1358. -stdin-:<main>:1:1: Error: table inheritance not supported
  1359. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1360. ^
  1361. <sql-statement>
  1362. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1363. FOR VALUES FROM (generate_series(1, 3)) TO ('2019-01-01');
  1364. </sql-statement>
  1365. -stdin-:<main>: Error: Parse Sql
  1366. -stdin-:<main>:1:1: Error: table inheritance not supported
  1367. CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
  1368. ^
  1369. <sql-statement>
  1370. -- trying to specify list for range partitioned table
  1371. CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES IN ('a');
  1372. </sql-statement>
  1373. -stdin-:<main>: Error: Parse Sql
  1374. -stdin-:<main>:1:1: Error: table inheritance not supported
  1375. -- trying to specify list for range partitioned table
  1376. ^
  1377. <sql-statement>
  1378. -- trying to specify modulus and remainder for range partitioned table
  1379. CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
  1380. </sql-statement>
  1381. -stdin-:<main>: Error: Parse Sql
  1382. -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1383. CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
  1384. ^
  1385. <sql-statement>
  1386. -- each of start and end bounds must have same number of values as the
  1387. -- length of the partition key
  1388. CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a', 1) TO ('z');
  1389. </sql-statement>
  1390. -stdin-:<main>: Error: Parse Sql
  1391. -stdin-:<main>:1:1: Error: table inheritance not supported
  1392. -- each of start and end bounds must have same number of values as the
  1393. ^
  1394. <sql-statement>
  1395. CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a') TO ('z', 1);
  1396. </sql-statement>
  1397. -stdin-:<main>: Error: Parse Sql
  1398. -stdin-:<main>:1:1: Error: table inheritance not supported
  1399. CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a') TO ('z', 1);
  1400. ^
  1401. <sql-statement>
  1402. -- cannot specify null values in range bounds
  1403. CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM (null) TO (maxvalue);
  1404. </sql-statement>
  1405. -stdin-:<main>: Error: Parse Sql
  1406. -stdin-:<main>:1:1: Error: table inheritance not supported
  1407. -- cannot specify null values in range bounds
  1408. ^
  1409. <sql-statement>
  1410. -- trying to specify modulus and remainder for range partitioned table
  1411. CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
  1412. </sql-statement>
  1413. -stdin-:<main>: Error: Parse Sql
  1414. -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1415. CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
  1416. ^
  1417. <sql-statement>
  1418. -- check partition bound syntax for the hash partition
  1419. CREATE TABLE hash_parted (
  1420. a int
  1421. ) PARTITION BY HASH (a);
  1422. </sql-statement>
  1423. -stdin-:<main>: Error: Parse Sql
  1424. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1425. -- check partition bound syntax for the hash partition
  1426. ^
  1427. <sql-statement>
  1428. CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 0);
  1429. </sql-statement>
  1430. -stdin-:<main>: Error: Parse Sql
  1431. -stdin-:<main>:1:65: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1432. CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 0);
  1433. ^
  1434. <sql-statement>
  1435. CREATE TABLE hpart_2 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 50, REMAINDER 1);
  1436. </sql-statement>
  1437. -stdin-:<main>: Error: Parse Sql
  1438. -stdin-:<main>:1:65: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1439. CREATE TABLE hpart_2 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 50, REMAINDER 1);
  1440. ^
  1441. <sql-statement>
  1442. CREATE TABLE hpart_3 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 200, REMAINDER 2);
  1443. </sql-statement>
  1444. -stdin-:<main>: Error: Parse Sql
  1445. -stdin-:<main>:1:65: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1446. CREATE TABLE hpart_3 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 200, REMAINDER 2);
  1447. ^
  1448. <sql-statement>
  1449. CREATE TABLE hpart_4 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 3);
  1450. </sql-statement>
  1451. -stdin-:<main>: Error: Parse Sql
  1452. -stdin-:<main>:1:65: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1453. CREATE TABLE hpart_4 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 3);
  1454. ^
  1455. <sql-statement>
  1456. -- modulus 25 is factor of modulus of 50 but 10 is not a factor of 25.
  1457. CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 25, REMAINDER 3);
  1458. </sql-statement>
  1459. -stdin-:<main>: Error: Parse Sql
  1460. -stdin-:<main>:2:66: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1461. CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 25, REMAINDER 3);
  1462. ^
  1463. <sql-statement>
  1464. -- previous modulus 50 is factor of 150 but this modulus is not a factor of next modulus 200.
  1465. CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 150, REMAINDER 3);
  1466. </sql-statement>
  1467. -stdin-:<main>: Error: Parse Sql
  1468. -stdin-:<main>:2:66: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1469. CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 150, REMAINDER 3);
  1470. ^
  1471. <sql-statement>
  1472. -- overlapping remainders
  1473. CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 100, REMAINDER 3);
  1474. </sql-statement>
  1475. -stdin-:<main>: Error: Parse Sql
  1476. -stdin-:<main>:2:66: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1477. CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 100, REMAINDER 3);
  1478. ^
  1479. <sql-statement>
  1480. -- trying to specify range for the hash partitioned table
  1481. CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES FROM ('a', 1) TO ('z');
  1482. </sql-statement>
  1483. -stdin-:<main>: Error: Parse Sql
  1484. -stdin-:<main>:1:1: Error: table inheritance not supported
  1485. -- trying to specify range for the hash partitioned table
  1486. ^
  1487. <sql-statement>
  1488. -- trying to specify list value for the hash partitioned table
  1489. CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES IN (1000);
  1490. </sql-statement>
  1491. -stdin-:<main>: Error: Parse Sql
  1492. -stdin-:<main>:1:1: Error: table inheritance not supported
  1493. -- trying to specify list value for the hash partitioned table
  1494. ^
  1495. <sql-statement>
  1496. -- trying to create default partition for the hash partitioned table
  1497. CREATE TABLE fail_default_part PARTITION OF hash_parted DEFAULT;
  1498. </sql-statement>
  1499. -stdin-:<main>: Error: Parse Sql
  1500. -stdin-:<main>:1:1: Error: table inheritance not supported
  1501. -- trying to create default partition for the hash partitioned table
  1502. ^
  1503. <sql-statement>
  1504. -- check if compatible with the specified parent
  1505. -- cannot create as partition of a non-partitioned table
  1506. CREATE TABLE unparted (
  1507. a int
  1508. );
  1509. </sql-statement>
  1510. <sql-statement>
  1511. CREATE TABLE fail_part PARTITION OF unparted FOR VALUES IN ('a');
  1512. </sql-statement>
  1513. -stdin-:<main>: Error: Parse Sql
  1514. -stdin-:<main>:1:1: Error: table inheritance not supported
  1515. CREATE TABLE fail_part PARTITION OF unparted FOR VALUES IN ('a');
  1516. ^
  1517. <sql-statement>
  1518. CREATE TABLE fail_part PARTITION OF unparted FOR VALUES WITH (MODULUS 2, REMAINDER 1);
  1519. </sql-statement>
  1520. -stdin-:<main>: Error: Parse Sql
  1521. -stdin-:<main>:1:64: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1522. CREATE TABLE fail_part PARTITION OF unparted FOR VALUES WITH (MODULUS 2, REMAINDER 1);
  1523. ^
  1524. <sql-statement>
  1525. DROP TABLE unparted;
  1526. </sql-statement>
  1527. <sql-statement>
  1528. -- cannot create a permanent rel as partition of a temp rel
  1529. CREATE TEMP TABLE temp_parted (
  1530. a int
  1531. ) PARTITION BY LIST (a);
  1532. </sql-statement>
  1533. -stdin-:<main>: Error: Parse Sql
  1534. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1535. -- cannot create a permanent rel as partition of a temp rel
  1536. ^
  1537. <sql-statement>
  1538. CREATE TABLE fail_part PARTITION OF temp_parted FOR VALUES IN ('a');
  1539. </sql-statement>
  1540. -stdin-:<main>: Error: Parse Sql
  1541. -stdin-:<main>:1:1: Error: table inheritance not supported
  1542. CREATE TABLE fail_part PARTITION OF temp_parted FOR VALUES IN ('a');
  1543. ^
  1544. <sql-statement>
  1545. DROP TABLE temp_parted;
  1546. </sql-statement>
  1547. <sql-statement>
  1548. -- check for partition bound overlap and other invalid specifications
  1549. CREATE TABLE list_parted2 (
  1550. a varchar
  1551. ) PARTITION BY LIST (a);
  1552. </sql-statement>
  1553. -stdin-:<main>: Error: Parse Sql
  1554. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1555. -- check for partition bound overlap and other invalid specifications
  1556. ^
  1557. <sql-statement>
  1558. CREATE TABLE part_null_z PARTITION OF list_parted2 FOR VALUES IN (null, 'z');
  1559. </sql-statement>
  1560. -stdin-:<main>: Error: Parse Sql
  1561. -stdin-:<main>:1:1: Error: table inheritance not supported
  1562. CREATE TABLE part_null_z PARTITION OF list_parted2 FOR VALUES IN (null, 'z');
  1563. ^
  1564. <sql-statement>
  1565. CREATE TABLE part_ab PARTITION OF list_parted2 FOR VALUES IN ('a', 'b');
  1566. </sql-statement>
  1567. -stdin-:<main>: Error: Parse Sql
  1568. -stdin-:<main>:1:1: Error: table inheritance not supported
  1569. CREATE TABLE part_ab PARTITION OF list_parted2 FOR VALUES IN ('a', 'b');
  1570. ^
  1571. <sql-statement>
  1572. CREATE TABLE list_parted2_def PARTITION OF list_parted2 DEFAULT;
  1573. </sql-statement>
  1574. -stdin-:<main>: Error: Parse Sql
  1575. -stdin-:<main>:1:1: Error: table inheritance not supported
  1576. CREATE TABLE list_parted2_def PARTITION OF list_parted2 DEFAULT;
  1577. ^
  1578. <sql-statement>
  1579. CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN (null);
  1580. </sql-statement>
  1581. -stdin-:<main>: Error: Parse Sql
  1582. -stdin-:<main>:1:1: Error: table inheritance not supported
  1583. CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN (null);
  1584. ^
  1585. <sql-statement>
  1586. CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('b', 'c');
  1587. </sql-statement>
  1588. -stdin-:<main>: Error: Parse Sql
  1589. -stdin-:<main>:1:1: Error: table inheritance not supported
  1590. CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('b', 'c');
  1591. ^
  1592. <sql-statement>
  1593. -- check default partition overlap
  1594. INSERT INTO list_parted2 VALUES('X');
  1595. </sql-statement>
  1596. -stdin-:<main>: Fatal: Table metadata loading
  1597. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted2
  1598. <sql-statement>
  1599. CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('W', 'X', 'Y');
  1600. </sql-statement>
  1601. -stdin-:<main>: Error: Parse Sql
  1602. -stdin-:<main>:1:1: Error: table inheritance not supported
  1603. CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('W', 'X', 'Y');
  1604. ^
  1605. <sql-statement>
  1606. CREATE TABLE range_parted2 (
  1607. a int
  1608. ) PARTITION BY RANGE (a);
  1609. </sql-statement>
  1610. -stdin-:<main>: Error: Parse Sql
  1611. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1612. CREATE TABLE range_parted2 (
  1613. ^
  1614. <sql-statement>
  1615. -- trying to create range partition with empty range
  1616. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (0);
  1617. </sql-statement>
  1618. -stdin-:<main>: Error: Parse Sql
  1619. -stdin-:<main>:1:1: Error: table inheritance not supported
  1620. -- trying to create range partition with empty range
  1621. ^
  1622. <sql-statement>
  1623. -- note that the range '[1, 1)' has no elements
  1624. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (1);
  1625. </sql-statement>
  1626. -stdin-:<main>: Error: Parse Sql
  1627. -stdin-:<main>:1:1: Error: table inheritance not supported
  1628. -- note that the range '[1, 1)' has no elements
  1629. ^
  1630. <sql-statement>
  1631. CREATE TABLE part0 PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (1);
  1632. </sql-statement>
  1633. -stdin-:<main>: Error: Parse Sql
  1634. -stdin-:<main>:1:1: Error: table inheritance not supported
  1635. CREATE TABLE part0 PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (1);
  1636. ^
  1637. <sql-statement>
  1638. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (2);
  1639. </sql-statement>
  1640. -stdin-:<main>: Error: Parse Sql
  1641. -stdin-:<main>:1:1: Error: table inheritance not supported
  1642. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (2);
  1643. ^
  1644. <sql-statement>
  1645. CREATE TABLE part1 PARTITION OF range_parted2 FOR VALUES FROM (1) TO (10);
  1646. </sql-statement>
  1647. -stdin-:<main>: Error: Parse Sql
  1648. -stdin-:<main>:1:1: Error: table inheritance not supported
  1649. CREATE TABLE part1 PARTITION OF range_parted2 FOR VALUES FROM (1) TO (10);
  1650. ^
  1651. <sql-statement>
  1652. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (-1) TO (1);
  1653. </sql-statement>
  1654. -stdin-:<main>: Error: Parse Sql
  1655. -stdin-:<main>:1:1: Error: table inheritance not supported
  1656. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (-1) TO (1);
  1657. ^
  1658. <sql-statement>
  1659. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (9) TO (maxvalue);
  1660. </sql-statement>
  1661. -stdin-:<main>: Error: Parse Sql
  1662. -stdin-:<main>:1:1: Error: table inheritance not supported
  1663. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (9) TO (maxvalue);
  1664. ^
  1665. <sql-statement>
  1666. CREATE TABLE part2 PARTITION OF range_parted2 FOR VALUES FROM (20) TO (30);
  1667. </sql-statement>
  1668. -stdin-:<main>: Error: Parse Sql
  1669. -stdin-:<main>:1:1: Error: table inheritance not supported
  1670. CREATE TABLE part2 PARTITION OF range_parted2 FOR VALUES FROM (20) TO (30);
  1671. ^
  1672. <sql-statement>
  1673. CREATE TABLE part3 PARTITION OF range_parted2 FOR VALUES FROM (30) TO (40);
  1674. </sql-statement>
  1675. -stdin-:<main>: Error: Parse Sql
  1676. -stdin-:<main>:1:1: Error: table inheritance not supported
  1677. CREATE TABLE part3 PARTITION OF range_parted2 FOR VALUES FROM (30) TO (40);
  1678. ^
  1679. <sql-statement>
  1680. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (30);
  1681. </sql-statement>
  1682. -stdin-:<main>: Error: Parse Sql
  1683. -stdin-:<main>:1:1: Error: table inheritance not supported
  1684. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (30);
  1685. ^
  1686. <sql-statement>
  1687. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (50);
  1688. </sql-statement>
  1689. -stdin-:<main>: Error: Parse Sql
  1690. -stdin-:<main>:1:1: Error: table inheritance not supported
  1691. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (50);
  1692. ^
  1693. <sql-statement>
  1694. -- Create a default partition for range partitioned table
  1695. CREATE TABLE range2_default PARTITION OF range_parted2 DEFAULT;
  1696. </sql-statement>
  1697. -stdin-:<main>: Error: Parse Sql
  1698. -stdin-:<main>:1:1: Error: table inheritance not supported
  1699. -- Create a default partition for range partitioned table
  1700. ^
  1701. <sql-statement>
  1702. -- More than one default partition is not allowed, so this should give error
  1703. CREATE TABLE fail_default_part PARTITION OF range_parted2 DEFAULT;
  1704. </sql-statement>
  1705. -stdin-:<main>: Error: Parse Sql
  1706. -stdin-:<main>:1:1: Error: table inheritance not supported
  1707. -- More than one default partition is not allowed, so this should give error
  1708. ^
  1709. <sql-statement>
  1710. -- Check if the range for default partitions overlap
  1711. INSERT INTO range_parted2 VALUES (85);
  1712. </sql-statement>
  1713. -stdin-:<main>: Fatal: Table metadata loading
  1714. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted2
  1715. <sql-statement>
  1716. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (80) TO (90);
  1717. </sql-statement>
  1718. -stdin-:<main>: Error: Parse Sql
  1719. -stdin-:<main>:1:1: Error: table inheritance not supported
  1720. CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (80) TO (90);
  1721. ^
  1722. <sql-statement>
  1723. CREATE TABLE part4 PARTITION OF range_parted2 FOR VALUES FROM (90) TO (100);
  1724. </sql-statement>
  1725. -stdin-:<main>: Error: Parse Sql
  1726. -stdin-:<main>:1:1: Error: table inheritance not supported
  1727. CREATE TABLE part4 PARTITION OF range_parted2 FOR VALUES FROM (90) TO (100);
  1728. ^
  1729. <sql-statement>
  1730. -- now check for multi-column range partition key
  1731. CREATE TABLE range_parted3 (
  1732. a int,
  1733. b int
  1734. ) PARTITION BY RANGE (a, (b+1));
  1735. </sql-statement>
  1736. -stdin-:<main>: Error: Parse Sql
  1737. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1738. -- now check for multi-column range partition key
  1739. ^
  1740. <sql-statement>
  1741. CREATE TABLE part00 PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, maxvalue);
  1742. </sql-statement>
  1743. -stdin-:<main>: Error: Parse Sql
  1744. -stdin-:<main>:1:1: Error: table inheritance not supported
  1745. CREATE TABLE part00 PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, maxvalue);
  1746. ^
  1747. <sql-statement>
  1748. CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, 1);
  1749. </sql-statement>
  1750. -stdin-:<main>: Error: Parse Sql
  1751. -stdin-:<main>:1:1: Error: table inheritance not supported
  1752. CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, 1);
  1753. ^
  1754. <sql-statement>
  1755. CREATE TABLE part10 PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, 1);
  1756. </sql-statement>
  1757. -stdin-:<main>: Error: Parse Sql
  1758. -stdin-:<main>:1:1: Error: table inheritance not supported
  1759. CREATE TABLE part10 PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, 1);
  1760. ^
  1761. <sql-statement>
  1762. CREATE TABLE part11 PARTITION OF range_parted3 FOR VALUES FROM (1, 1) TO (1, 10);
  1763. </sql-statement>
  1764. -stdin-:<main>: Error: Parse Sql
  1765. -stdin-:<main>:1:1: Error: table inheritance not supported
  1766. CREATE TABLE part11 PARTITION OF range_parted3 FOR VALUES FROM (1, 1) TO (1, 10);
  1767. ^
  1768. <sql-statement>
  1769. CREATE TABLE part12 PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, maxvalue);
  1770. </sql-statement>
  1771. -stdin-:<main>: Error: Parse Sql
  1772. -stdin-:<main>:1:1: Error: table inheritance not supported
  1773. CREATE TABLE part12 PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, maxvalue);
  1774. ^
  1775. <sql-statement>
  1776. CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, 20);
  1777. </sql-statement>
  1778. -stdin-:<main>: Error: Parse Sql
  1779. -stdin-:<main>:1:1: Error: table inheritance not supported
  1780. CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, 20);
  1781. ^
  1782. <sql-statement>
  1783. CREATE TABLE range3_default PARTITION OF range_parted3 DEFAULT;
  1784. </sql-statement>
  1785. -stdin-:<main>: Error: Parse Sql
  1786. -stdin-:<main>:1:1: Error: table inheritance not supported
  1787. CREATE TABLE range3_default PARTITION OF range_parted3 DEFAULT;
  1788. ^
  1789. <sql-statement>
  1790. -- cannot create a partition that says column b is allowed to range
  1791. -- from -infinity to +infinity, while there exist partitions that have
  1792. -- more specific ranges
  1793. CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, maxvalue);
  1794. </sql-statement>
  1795. -stdin-:<main>: Error: Parse Sql
  1796. -stdin-:<main>:1:1: Error: table inheritance not supported
  1797. -- cannot create a partition that says column b is allowed to range
  1798. ^
  1799. <sql-statement>
  1800. -- check for partition bound overlap and other invalid specifications for the hash partition
  1801. CREATE TABLE hash_parted2 (
  1802. a varchar
  1803. ) PARTITION BY HASH (a);
  1804. </sql-statement>
  1805. -stdin-:<main>: Error: Parse Sql
  1806. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1807. -- check for partition bound overlap and other invalid specifications for the hash partition
  1808. ^
  1809. <sql-statement>
  1810. CREATE TABLE h2part_1 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
  1811. </sql-statement>
  1812. -stdin-:<main>: Error: Parse Sql
  1813. -stdin-:<main>:1:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1814. CREATE TABLE h2part_1 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
  1815. ^
  1816. <sql-statement>
  1817. CREATE TABLE h2part_2 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 0);
  1818. </sql-statement>
  1819. -stdin-:<main>: Error: Parse Sql
  1820. -stdin-:<main>:1:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1821. CREATE TABLE h2part_2 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 0);
  1822. ^
  1823. <sql-statement>
  1824. CREATE TABLE h2part_3 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 4);
  1825. </sql-statement>
  1826. -stdin-:<main>: Error: Parse Sql
  1827. -stdin-:<main>:1:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1828. CREATE TABLE h2part_3 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 4);
  1829. ^
  1830. <sql-statement>
  1831. CREATE TABLE h2part_4 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 5);
  1832. </sql-statement>
  1833. -stdin-:<main>: Error: Parse Sql
  1834. -stdin-:<main>:1:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1835. CREATE TABLE h2part_4 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 5);
  1836. ^
  1837. <sql-statement>
  1838. -- overlap with part_4
  1839. CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 2, REMAINDER 1);
  1840. </sql-statement>
  1841. -stdin-:<main>: Error: Parse Sql
  1842. -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1843. CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 2, REMAINDER 1);
  1844. ^
  1845. <sql-statement>
  1846. -- modulus must be greater than zero
  1847. CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 0, REMAINDER 1);
  1848. </sql-statement>
  1849. -stdin-:<main>: Error: Parse Sql
  1850. -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1851. CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 0, REMAINDER 1);
  1852. ^
  1853. <sql-statement>
  1854. -- remainder must be greater than or equal to zero and less than modulus
  1855. CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 8);
  1856. </sql-statement>
  1857. -stdin-:<main>: Error: Parse Sql
  1858. -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
  1859. CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 8);
  1860. ^
  1861. <sql-statement>
  1862. -- check schema propagation from parent
  1863. CREATE TABLE parted (
  1864. a text,
  1865. b int NOT NULL DEFAULT 0,
  1866. CONSTRAINT check_a CHECK (length(a) > 0)
  1867. ) PARTITION BY LIST (a);
  1868. </sql-statement>
  1869. -stdin-:<main>: Error: Parse Sql
  1870. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1871. -- check schema propagation from parent
  1872. ^
  1873. <sql-statement>
  1874. CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
  1875. </sql-statement>
  1876. -stdin-:<main>: Error: Parse Sql
  1877. -stdin-:<main>:1:1: Error: table inheritance not supported
  1878. CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
  1879. ^
  1880. <sql-statement>
  1881. -- able to specify column default, column constraint, and table constraint
  1882. -- first check the "column specified more than once" error
  1883. CREATE TABLE part_b PARTITION OF parted (
  1884. b NOT NULL,
  1885. b DEFAULT 1,
  1886. b CHECK (b >= 0),
  1887. CONSTRAINT check_a CHECK (length(a) > 0)
  1888. ) FOR VALUES IN ('b');
  1889. </sql-statement>
  1890. -stdin-:<main>: Error: Parse Sql
  1891. -stdin-:<main>:1:1: Error: table inheritance not supported
  1892. -- able to specify column default, column constraint, and table constraint
  1893. ^
  1894. <sql-statement>
  1895. CREATE TABLE part_b PARTITION OF parted (
  1896. b NOT NULL DEFAULT 1,
  1897. CONSTRAINT check_a CHECK (length(a) > 0),
  1898. CONSTRAINT check_b CHECK (b >= 0)
  1899. ) FOR VALUES IN ('b');
  1900. </sql-statement>
  1901. -stdin-:<main>: Error: Parse Sql
  1902. -stdin-:<main>:1:1: Error: table inheritance not supported
  1903. CREATE TABLE part_b PARTITION OF parted (
  1904. ^
  1905. <sql-statement>
  1906. -- conislocal should be false for any merged constraints, true otherwise
  1907. SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass ORDER BY conislocal, coninhcount;
  1908. </sql-statement>
  1909. <sql-statement>
  1910. -- Once check_b is added to the parent, it should be made non-local for part_b
  1911. ALTER TABLE parted ADD CONSTRAINT check_b CHECK (b >= 0);
  1912. </sql-statement>
  1913. -stdin-:<main>: Error: Parse Sql
  1914. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1915. -- Once check_b is added to the parent, it should be made non-local for part_b
  1916. ^
  1917. <sql-statement>
  1918. SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
  1919. </sql-statement>
  1920. <sql-statement>
  1921. -- Neither check_a nor check_b are droppable from part_b
  1922. ALTER TABLE part_b DROP CONSTRAINT check_a;
  1923. </sql-statement>
  1924. -stdin-:<main>: Error: Parse Sql
  1925. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1926. -- Neither check_a nor check_b are droppable from part_b
  1927. ^
  1928. <sql-statement>
  1929. ALTER TABLE part_b DROP CONSTRAINT check_b;
  1930. </sql-statement>
  1931. -stdin-:<main>: Error: Parse Sql
  1932. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1933. ALTER TABLE part_b DROP CONSTRAINT check_b;
  1934. ^
  1935. <sql-statement>
  1936. -- And dropping it from parted should leave no trace of them on part_b, unlike
  1937. -- traditional inheritance where they will be left behind, because they would
  1938. -- be local constraints.
  1939. ALTER TABLE parted DROP CONSTRAINT check_a, DROP CONSTRAINT check_b;
  1940. </sql-statement>
  1941. -stdin-:<main>: Error: Parse Sql
  1942. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1943. -- And dropping it from parted should leave no trace of them on part_b, unlike
  1944. ^
  1945. <sql-statement>
  1946. SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
  1947. </sql-statement>
  1948. <sql-statement>
  1949. -- specify PARTITION BY for a partition
  1950. CREATE TABLE fail_part_col_not_found PARTITION OF parted FOR VALUES IN ('c') PARTITION BY RANGE (c);
  1951. </sql-statement>
  1952. -stdin-:<main>: Error: Parse Sql
  1953. -stdin-:<main>:1:1: Error: table inheritance not supported
  1954. -- specify PARTITION BY for a partition
  1955. ^
  1956. <sql-statement>
  1957. CREATE TABLE part_c PARTITION OF parted (b WITH OPTIONS NOT NULL DEFAULT 0) FOR VALUES IN ('c') PARTITION BY RANGE ((b));
  1958. </sql-statement>
  1959. -stdin-:<main>: Error: Parse Sql
  1960. -stdin-:<main>:1:1: Error: table inheritance not supported
  1961. CREATE TABLE part_c PARTITION OF parted (b WITH OPTIONS NOT NULL DEFAULT 0) FOR VALUES IN ('c') PARTITION BY RANGE ((b));
  1962. ^
  1963. <sql-statement>
  1964. -- create a level-2 partition
  1965. CREATE TABLE part_c_1_10 PARTITION OF part_c FOR VALUES FROM (1) TO (10);
  1966. </sql-statement>
  1967. -stdin-:<main>: Error: Parse Sql
  1968. -stdin-:<main>:1:1: Error: table inheritance not supported
  1969. -- create a level-2 partition
  1970. ^
  1971. <sql-statement>
  1972. -- check that NOT NULL and default value are inherited correctly
  1973. create table parted_notnull_inh_test (a int default 1, b int not null default 0) partition by list (a);
  1974. </sql-statement>
  1975. -stdin-:<main>: Error: Parse Sql
  1976. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  1977. -- check that NOT NULL and default value are inherited correctly
  1978. ^
  1979. <sql-statement>
  1980. create table parted_notnull_inh_test1 partition of parted_notnull_inh_test (a not null, b default 1) for values in (1);
  1981. </sql-statement>
  1982. -stdin-:<main>: Error: Parse Sql
  1983. -stdin-:<main>:1:1: Error: table inheritance not supported
  1984. create table parted_notnull_inh_test1 partition of parted_notnull_inh_test (a not null, b default 1) for values in (1);
  1985. ^
  1986. <sql-statement>
  1987. insert into parted_notnull_inh_test (b) values (null);
  1988. </sql-statement>
  1989. -stdin-:<main>: Fatal: Table metadata loading
  1990. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.parted_notnull_inh_test
  1991. <sql-statement>
  1992. -- note that while b's default is overriden, a's default is preserved
  1993. \d parted_notnull_inh_test1
  1994. </sql-statement>
  1995. Metacommand \d parted_notnull_inh_test1 is not supported
  1996. <sql-statement>
  1997. drop table parted_notnull_inh_test;
  1998. </sql-statement>
  1999. <sql-statement>
  2000. -- check that collations are assigned in partition bound expressions
  2001. create table parted_boolean_col (a bool, b text) partition by list(a);
  2002. </sql-statement>
  2003. -stdin-:<main>: Error: Parse Sql
  2004. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2005. -- check that collations are assigned in partition bound expressions
  2006. ^
  2007. <sql-statement>
  2008. create table parted_boolean_less partition of parted_boolean_col
  2009. for values in ('foo' < 'bar');
  2010. </sql-statement>
  2011. -stdin-:<main>: Error: Parse Sql
  2012. -stdin-:<main>:1:1: Error: table inheritance not supported
  2013. create table parted_boolean_less partition of parted_boolean_col
  2014. ^
  2015. <sql-statement>
  2016. create table parted_boolean_greater partition of parted_boolean_col
  2017. for values in ('foo' > 'bar');
  2018. </sql-statement>
  2019. -stdin-:<main>: Error: Parse Sql
  2020. -stdin-:<main>:1:1: Error: table inheritance not supported
  2021. create table parted_boolean_greater partition of parted_boolean_col
  2022. ^
  2023. <sql-statement>
  2024. drop table parted_boolean_col;
  2025. </sql-statement>
  2026. <sql-statement>
  2027. -- check for a conflicting COLLATE clause
  2028. create table parted_collate_must_match (a text collate "C", b text collate "C")
  2029. partition by range (a);
  2030. </sql-statement>
  2031. -stdin-:<main>: Error: Parse Sql
  2032. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2033. -- check for a conflicting COLLATE clause
  2034. ^
  2035. <sql-statement>
  2036. -- on the partition key
  2037. create table parted_collate_must_match1 partition of parted_collate_must_match
  2038. (a collate "POSIX") for values from ('a') to ('m');
  2039. </sql-statement>
  2040. -stdin-:<main>: Error: Parse Sql
  2041. -stdin-:<main>:1:1: Error: table inheritance not supported
  2042. -- on the partition key
  2043. ^
  2044. <sql-statement>
  2045. -- on another column
  2046. create table parted_collate_must_match2 partition of parted_collate_must_match
  2047. (b collate "POSIX") for values from ('m') to ('z');
  2048. </sql-statement>
  2049. -stdin-:<main>: Error: Parse Sql
  2050. -stdin-:<main>:1:1: Error: table inheritance not supported
  2051. -- on another column
  2052. ^
  2053. <sql-statement>
  2054. drop table parted_collate_must_match;
  2055. </sql-statement>
  2056. <sql-statement>
  2057. -- check that non-matching collations for partition bound
  2058. -- expressions are coerced to the right collation
  2059. create table test_part_coll_posix (a text) partition by range (a collate "POSIX");
  2060. </sql-statement>
  2061. -stdin-:<main>: Error: Parse Sql
  2062. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2063. -- check that non-matching collations for partition bound
  2064. ^
  2065. <sql-statement>
  2066. -- ok, collation is implicitly coerced
  2067. create table test_part_coll partition of test_part_coll_posix for values from ('a' collate "C") to ('g');
  2068. </sql-statement>
  2069. -stdin-:<main>: Error: Parse Sql
  2070. -stdin-:<main>:1:1: Error: table inheritance not supported
  2071. -- ok, collation is implicitly coerced
  2072. ^
  2073. <sql-statement>
  2074. -- ok
  2075. create table test_part_coll2 partition of test_part_coll_posix for values from ('g') to ('m');
  2076. </sql-statement>
  2077. -stdin-:<main>: Error: Parse Sql
  2078. -stdin-:<main>:1:1: Error: table inheritance not supported
  2079. -- ok
  2080. ^
  2081. <sql-statement>
  2082. -- ok, collation is implicitly coerced
  2083. create table test_part_coll_cast partition of test_part_coll_posix for values from (name 'm' collate "C") to ('s');
  2084. </sql-statement>
  2085. -stdin-:<main>: Error: Parse Sql
  2086. -stdin-:<main>:1:1: Error: table inheritance not supported
  2087. -- ok, collation is implicitly coerced
  2088. ^
  2089. <sql-statement>
  2090. -- ok; partition collation silently overrides the default collation of type 'name'
  2091. create table test_part_coll_cast2 partition of test_part_coll_posix for values from (name 's') to ('z');
  2092. </sql-statement>
  2093. -stdin-:<main>: Error: Parse Sql
  2094. -stdin-:<main>:1:1: Error: table inheritance not supported
  2095. -- ok; partition collation silently overrides the default collation of type 'name'
  2096. ^
  2097. <sql-statement>
  2098. drop table test_part_coll_posix;
  2099. </sql-statement>
  2100. <sql-statement>
  2101. -- Partition bound in describe output
  2102. \d+ part_b
  2103. </sql-statement>
  2104. Metacommand \d+ part_b is not supported
  2105. <sql-statement>
  2106. -- Both partition bound and partition key in describe output
  2107. \d+ part_c
  2108. </sql-statement>
  2109. Metacommand \d+ part_c is not supported
  2110. <sql-statement>
  2111. -- a level-2 partition's constraint will include the parent's expressions
  2112. \d+ part_c_1_10
  2113. </sql-statement>
  2114. Metacommand \d+ part_c_1_10 is not supported
  2115. <sql-statement>
  2116. -- Show partition count in the parent's describe output
  2117. -- Tempted to include \d+ output listing partitions with bound info but
  2118. -- output could vary depending on the order in which partition oids are
  2119. -- returned.
  2120. \d parted
  2121. </sql-statement>
  2122. Metacommand \d parted is not supported
  2123. <sql-statement>
  2124. \d hash_parted
  2125. </sql-statement>
  2126. Metacommand \d hash_parted is not supported
  2127. <sql-statement>
  2128. -- check that we get the expected partition constraints
  2129. CREATE TABLE range_parted4 (a int, b int, c int) PARTITION BY RANGE (abs(a), abs(b), c);
  2130. </sql-statement>
  2131. -stdin-:<main>: Error: Parse Sql
  2132. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2133. -- check that we get the expected partition constraints
  2134. ^
  2135. <sql-statement>
  2136. CREATE TABLE unbounded_range_part PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (MAXVALUE, MAXVALUE, MAXVALUE);
  2137. </sql-statement>
  2138. -stdin-:<main>: Error: Parse Sql
  2139. -stdin-:<main>:1:1: Error: table inheritance not supported
  2140. CREATE TABLE unbounded_range_part PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (MAXVALUE, MAXVALUE, MAXVALUE);
  2141. ^
  2142. <sql-statement>
  2143. \d+ unbounded_range_part
  2144. </sql-statement>
  2145. Metacommand \d+ unbounded_range_part is not supported
  2146. <sql-statement>
  2147. DROP TABLE unbounded_range_part;
  2148. </sql-statement>
  2149. <sql-statement>
  2150. CREATE TABLE range_parted4_1 PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (1, MAXVALUE, MAXVALUE);
  2151. </sql-statement>
  2152. -stdin-:<main>: Error: Parse Sql
  2153. -stdin-:<main>:1:1: Error: table inheritance not supported
  2154. CREATE TABLE range_parted4_1 PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (1, MAXVALUE, MAXVALUE);
  2155. ^
  2156. <sql-statement>
  2157. \d+ range_parted4_1
  2158. </sql-statement>
  2159. Metacommand \d+ range_parted4_1 is not supported
  2160. <sql-statement>
  2161. CREATE TABLE range_parted4_2 PARTITION OF range_parted4 FOR VALUES FROM (3, 4, 5) TO (6, 7, MAXVALUE);
  2162. </sql-statement>
  2163. -stdin-:<main>: Error: Parse Sql
  2164. -stdin-:<main>:1:1: Error: table inheritance not supported
  2165. CREATE TABLE range_parted4_2 PARTITION OF range_parted4 FOR VALUES FROM (3, 4, 5) TO (6, 7, MAXVALUE);
  2166. ^
  2167. <sql-statement>
  2168. \d+ range_parted4_2
  2169. </sql-statement>
  2170. Metacommand \d+ range_parted4_2 is not supported
  2171. <sql-statement>
  2172. CREATE TABLE range_parted4_3 PARTITION OF range_parted4 FOR VALUES FROM (6, 8, MINVALUE) TO (9, MAXVALUE, MAXVALUE);
  2173. </sql-statement>
  2174. -stdin-:<main>: Error: Parse Sql
  2175. -stdin-:<main>:1:1: Error: table inheritance not supported
  2176. CREATE TABLE range_parted4_3 PARTITION OF range_parted4 FOR VALUES FROM (6, 8, MINVALUE) TO (9, MAXVALUE, MAXVALUE);
  2177. ^
  2178. <sql-statement>
  2179. \d+ range_parted4_3
  2180. </sql-statement>
  2181. Metacommand \d+ range_parted4_3 is not supported
  2182. <sql-statement>
  2183. DROP TABLE range_parted4;
  2184. </sql-statement>
  2185. <sql-statement>
  2186. -- user-defined operator class in partition key
  2187. CREATE FUNCTION my_int4_sort(int4,int4) RETURNS int LANGUAGE sql
  2188. AS $$ SELECT CASE WHEN $1 = $2 THEN 0 WHEN $1 > $2 THEN 1 ELSE -1 END; $$;
  2189. </sql-statement>
  2190. -stdin-:<main>: Error: Parse Sql
  2191. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  2192. -- user-defined operator class in partition key
  2193. ^
  2194. <sql-statement>
  2195. CREATE OPERATOR CLASS test_int4_ops FOR TYPE int4 USING btree AS
  2196. OPERATOR 1 < (int4,int4), OPERATOR 2 <= (int4,int4),
  2197. OPERATOR 3 = (int4,int4), OPERATOR 4 >= (int4,int4),
  2198. OPERATOR 5 > (int4,int4), FUNCTION 1 my_int4_sort(int4,int4);
  2199. </sql-statement>
  2200. -stdin-:<main>: Error: Parse Sql
  2201. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 298
  2202. CREATE OPERATOR CLASS test_int4_ops FOR TYPE int4 USING btree AS
  2203. ^
  2204. <sql-statement>
  2205. CREATE TABLE partkey_t (a int4) PARTITION BY RANGE (a test_int4_ops);
  2206. </sql-statement>
  2207. -stdin-:<main>: Error: Parse Sql
  2208. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2209. CREATE TABLE partkey_t (a int4) PARTITION BY RANGE (a test_int4_ops);
  2210. ^
  2211. <sql-statement>
  2212. CREATE TABLE partkey_t_1 PARTITION OF partkey_t FOR VALUES FROM (0) TO (1000);
  2213. </sql-statement>
  2214. -stdin-:<main>: Error: Parse Sql
  2215. -stdin-:<main>:1:1: Error: table inheritance not supported
  2216. CREATE TABLE partkey_t_1 PARTITION OF partkey_t FOR VALUES FROM (0) TO (1000);
  2217. ^
  2218. <sql-statement>
  2219. INSERT INTO partkey_t VALUES (100);
  2220. </sql-statement>
  2221. -stdin-:<main>: Fatal: Table metadata loading
  2222. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.partkey_t
  2223. <sql-statement>
  2224. INSERT INTO partkey_t VALUES (200);
  2225. </sql-statement>
  2226. -stdin-:<main>: Fatal: Table metadata loading
  2227. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.partkey_t
  2228. <sql-statement>
  2229. -- cleanup
  2230. DROP TABLE parted, list_parted, range_parted, list_parted2, range_parted2, range_parted3;
  2231. </sql-statement>
  2232. <sql-statement>
  2233. DROP TABLE partkey_t, hash_parted, hash_parted2;
  2234. </sql-statement>
  2235. <sql-statement>
  2236. DROP OPERATOR CLASS test_int4_ops USING btree;
  2237. </sql-statement>
  2238. -stdin-:<main>: Error: Parse Sql
  2239. -stdin-:<main>:1:1: Error: Not supported object type for DROP
  2240. DROP OPERATOR CLASS test_int4_ops USING btree;
  2241. ^
  2242. <sql-statement>
  2243. DROP FUNCTION my_int4_sort(int4,int4);
  2244. </sql-statement>
  2245. -stdin-:<main>: Error: Parse Sql
  2246. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
  2247. DROP FUNCTION my_int4_sort(int4,int4);
  2248. ^
  2249. <sql-statement>
  2250. -- comments on partitioned tables columns
  2251. CREATE TABLE parted_col_comment (a int, b text) PARTITION BY LIST (a);
  2252. </sql-statement>
  2253. -stdin-:<main>: Error: Parse Sql
  2254. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2255. -- comments on partitioned tables columns
  2256. ^
  2257. <sql-statement>
  2258. COMMENT ON TABLE parted_col_comment IS 'Am partitioned table';
  2259. </sql-statement>
  2260. -stdin-:<main>: Error: Parse Sql
  2261. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
  2262. COMMENT ON TABLE parted_col_comment IS 'Am partitioned table';
  2263. ^
  2264. <sql-statement>
  2265. COMMENT ON COLUMN parted_col_comment.a IS 'Partition key';
  2266. </sql-statement>
  2267. -stdin-:<main>: Error: Parse Sql
  2268. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
  2269. COMMENT ON COLUMN parted_col_comment.a IS 'Partition key';
  2270. ^
  2271. <sql-statement>
  2272. SELECT obj_description('parted_col_comment'::regclass);
  2273. </sql-statement>
  2274. <sql-statement>
  2275. \d+ parted_col_comment
  2276. </sql-statement>
  2277. Metacommand \d+ parted_col_comment is not supported
  2278. <sql-statement>
  2279. DROP TABLE parted_col_comment;
  2280. </sql-statement>
  2281. <sql-statement>
  2282. -- list partitioning on array type column
  2283. CREATE TABLE arrlp (a int[]) PARTITION BY LIST (a);
  2284. </sql-statement>
  2285. -stdin-:<main>: Error: Parse Sql
  2286. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2287. -- list partitioning on array type column
  2288. ^
  2289. <sql-statement>
  2290. CREATE TABLE arrlp12 PARTITION OF arrlp FOR VALUES IN ('{1}', '{2}');
  2291. </sql-statement>
  2292. -stdin-:<main>: Error: Parse Sql
  2293. -stdin-:<main>:1:1: Error: table inheritance not supported
  2294. CREATE TABLE arrlp12 PARTITION OF arrlp FOR VALUES IN ('{1}', '{2}');
  2295. ^
  2296. <sql-statement>
  2297. \d+ arrlp12
  2298. </sql-statement>
  2299. Metacommand \d+ arrlp12 is not supported
  2300. <sql-statement>
  2301. DROP TABLE arrlp;
  2302. </sql-statement>
  2303. <sql-statement>
  2304. -- partition on boolean column
  2305. create table boolspart (a bool) partition by list (a);
  2306. </sql-statement>
  2307. -stdin-:<main>: Error: Parse Sql
  2308. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2309. -- partition on boolean column
  2310. ^
  2311. <sql-statement>
  2312. create table boolspart_t partition of boolspart for values in (true);
  2313. </sql-statement>
  2314. -stdin-:<main>: Error: Parse Sql
  2315. -stdin-:<main>:1:1: Error: table inheritance not supported
  2316. create table boolspart_t partition of boolspart for values in (true);
  2317. ^
  2318. <sql-statement>
  2319. create table boolspart_f partition of boolspart for values in (false);
  2320. </sql-statement>
  2321. -stdin-:<main>: Error: Parse Sql
  2322. -stdin-:<main>:1:1: Error: table inheritance not supported
  2323. create table boolspart_f partition of boolspart for values in (false);
  2324. ^
  2325. <sql-statement>
  2326. \d+ boolspart
  2327. </sql-statement>
  2328. Metacommand \d+ boolspart is not supported
  2329. <sql-statement>
  2330. drop table boolspart;
  2331. </sql-statement>
  2332. <sql-statement>
  2333. -- partitions mixing temporary and permanent relations
  2334. create table perm_parted (a int) partition by list (a);
  2335. </sql-statement>
  2336. -stdin-:<main>: Error: Parse Sql
  2337. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2338. -- partitions mixing temporary and permanent relations
  2339. ^
  2340. <sql-statement>
  2341. create temporary table temp_parted (a int) partition by list (a);
  2342. </sql-statement>
  2343. -stdin-:<main>: Error: Parse Sql
  2344. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2345. create temporary table temp_parted (a int) partition by list (a);
  2346. ^
  2347. <sql-statement>
  2348. create table perm_part partition of temp_parted default; -- error
  2349. </sql-statement>
  2350. -stdin-:<main>: Error: Parse Sql
  2351. -stdin-:<main>:1:1: Error: table inheritance not supported
  2352. create table perm_part partition of temp_parted default; -- error
  2353. ^
  2354. <sql-statement>
  2355. create temp table temp_part partition of perm_parted default; -- error
  2356. </sql-statement>
  2357. -stdin-:<main>: Error: Parse Sql
  2358. -stdin-:<main>:1:1: Error: table inheritance not supported
  2359. create temp table temp_part partition of perm_parted default; -- error
  2360. ^
  2361. <sql-statement>
  2362. create temp table temp_part partition of temp_parted default; -- ok
  2363. </sql-statement>
  2364. -stdin-:<main>: Error: Parse Sql
  2365. -stdin-:<main>:1:1: Error: table inheritance not supported
  2366. create temp table temp_part partition of temp_parted default; -- ok
  2367. ^
  2368. <sql-statement>
  2369. drop table perm_parted cascade;
  2370. </sql-statement>
  2371. -stdin-:<main>: Error: Parse Sql
  2372. -stdin-:<main>:1:1: Error: CASCADE is not implemented
  2373. drop table perm_parted cascade;
  2374. ^
  2375. <sql-statement>
  2376. drop table temp_parted cascade;
  2377. </sql-statement>
  2378. -stdin-:<main>: Error: Parse Sql
  2379. -stdin-:<main>:1:1: Error: CASCADE is not implemented
  2380. drop table temp_parted cascade;
  2381. ^
  2382. <sql-statement>
  2383. -- check that adding partitions to a table while it is being used is prevented
  2384. create table tab_part_create (a int) partition by list (a);
  2385. </sql-statement>
  2386. -stdin-:<main>: Error: Parse Sql
  2387. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2388. -- check that adding partitions to a table while it is being used is prevented
  2389. ^
  2390. <sql-statement>
  2391. create or replace function func_part_create() returns trigger
  2392. language plpgsql as $$
  2393. begin
  2394. execute 'create table tab_part_create_1 partition of tab_part_create for values in (1)';
  2395. return null;
  2396. end $$;
  2397. </sql-statement>
  2398. -stdin-:<main>: Error: Parse Sql
  2399. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  2400. create or replace function func_part_create() returns trigger
  2401. ^
  2402. <sql-statement>
  2403. create trigger trig_part_create before insert on tab_part_create
  2404. for each statement execute procedure func_part_create();
  2405. </sql-statement>
  2406. -stdin-:<main>: Error: Parse Sql
  2407. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
  2408. create trigger trig_part_create before insert on tab_part_create
  2409. ^
  2410. <sql-statement>
  2411. insert into tab_part_create values (1);
  2412. </sql-statement>
  2413. -stdin-:<main>: Fatal: Table metadata loading
  2414. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.tab_part_create
  2415. <sql-statement>
  2416. drop table tab_part_create;
  2417. </sql-statement>
  2418. <sql-statement>
  2419. drop function func_part_create();
  2420. </sql-statement>
  2421. -stdin-:<main>: Error: Parse Sql
  2422. -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
  2423. drop function func_part_create();
  2424. ^
  2425. <sql-statement>
  2426. -- test using a volatile expression as partition bound
  2427. create table volatile_partbound_test (partkey timestamp) partition by range (partkey);
  2428. </sql-statement>
  2429. -stdin-:<main>: Error: Parse Sql
  2430. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2431. -- test using a volatile expression as partition bound
  2432. ^
  2433. <sql-statement>
  2434. create table volatile_partbound_test1 partition of volatile_partbound_test for values from (minvalue) to (current_timestamp);
  2435. </sql-statement>
  2436. -stdin-:<main>: Error: Parse Sql
  2437. -stdin-:<main>:1:1: Error: table inheritance not supported
  2438. create table volatile_partbound_test1 partition of volatile_partbound_test for values from (minvalue) to (current_timestamp);
  2439. ^
  2440. <sql-statement>
  2441. create table volatile_partbound_test2 partition of volatile_partbound_test for values from (current_timestamp) to (maxvalue);
  2442. </sql-statement>
  2443. -stdin-:<main>: Error: Parse Sql
  2444. -stdin-:<main>:1:1: Error: table inheritance not supported
  2445. create table volatile_partbound_test2 partition of volatile_partbound_test for values from (current_timestamp) to (maxvalue);
  2446. ^
  2447. <sql-statement>
  2448. -- this should go into the partition volatile_partbound_test2
  2449. insert into volatile_partbound_test values (current_timestamp);
  2450. </sql-statement>
  2451. -stdin-:<main>: Fatal: Table metadata loading
  2452. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.volatile_partbound_test
  2453. <sql-statement>
  2454. select tableoid::regclass from volatile_partbound_test;
  2455. </sql-statement>
  2456. -stdin-:<main>: Fatal: Table metadata loading
  2457. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.volatile_partbound_test
  2458. <sql-statement>
  2459. drop table volatile_partbound_test;
  2460. </sql-statement>
  2461. <sql-statement>
  2462. -- test the case where a check constraint on default partition allows
  2463. -- to avoid scanning it when adding a new partition
  2464. create table defcheck (a int, b int) partition by list (b);
  2465. </sql-statement>
  2466. -stdin-:<main>: Error: Parse Sql
  2467. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2468. -- test the case where a check constraint on default partition allows
  2469. ^
  2470. <sql-statement>
  2471. create table defcheck_def (a int, c int, b int);
  2472. </sql-statement>
  2473. <sql-statement>
  2474. alter table defcheck_def drop c;
  2475. </sql-statement>
  2476. -stdin-:<main>: Error: Parse Sql
  2477. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2478. alter table defcheck_def drop c;
  2479. ^
  2480. <sql-statement>
  2481. alter table defcheck attach partition defcheck_def default;
  2482. </sql-statement>
  2483. -stdin-:<main>: Error: Parse Sql
  2484. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2485. alter table defcheck attach partition defcheck_def default;
  2486. ^
  2487. <sql-statement>
  2488. alter table defcheck_def add check (b <= 0 and b is not null);
  2489. </sql-statement>
  2490. -stdin-:<main>: Error: Parse Sql
  2491. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2492. alter table defcheck_def add check (b <= 0 and b is not null);
  2493. ^
  2494. <sql-statement>
  2495. create table defcheck_1 partition of defcheck for values in (1, null);
  2496. </sql-statement>
  2497. -stdin-:<main>: Error: Parse Sql
  2498. -stdin-:<main>:1:1: Error: table inheritance not supported
  2499. create table defcheck_1 partition of defcheck for values in (1, null);
  2500. ^
  2501. <sql-statement>
  2502. -- test that complex default partition constraints are enforced correctly
  2503. insert into defcheck_def values (0, 0);
  2504. </sql-statement>
  2505. <sql-statement>
  2506. create table defcheck_0 partition of defcheck for values in (0);
  2507. </sql-statement>
  2508. -stdin-:<main>: Error: Parse Sql
  2509. -stdin-:<main>:1:1: Error: table inheritance not supported
  2510. create table defcheck_0 partition of defcheck for values in (0);
  2511. ^
  2512. <sql-statement>
  2513. drop table defcheck;
  2514. </sql-statement>
  2515. <sql-statement>
  2516. -- tests of column drop with partition tables and indexes using
  2517. -- predicates and expressions.
  2518. create table part_column_drop (
  2519. useless_1 int,
  2520. id int,
  2521. useless_2 int,
  2522. d int,
  2523. b int,
  2524. useless_3 int
  2525. ) partition by range (id);
  2526. </sql-statement>
  2527. -stdin-:<main>: Error: Parse Sql
  2528. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  2529. -- tests of column drop with partition tables and indexes using
  2530. ^
  2531. <sql-statement>
  2532. alter table part_column_drop drop column useless_1;
  2533. </sql-statement>
  2534. -stdin-:<main>: Error: Parse Sql
  2535. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2536. alter table part_column_drop drop column useless_1;
  2537. ^
  2538. <sql-statement>
  2539. alter table part_column_drop drop column useless_2;
  2540. </sql-statement>
  2541. -stdin-:<main>: Error: Parse Sql
  2542. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2543. alter table part_column_drop drop column useless_2;
  2544. ^
  2545. <sql-statement>
  2546. alter table part_column_drop drop column useless_3;
  2547. </sql-statement>
  2548. -stdin-:<main>: Error: Parse Sql
  2549. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2550. alter table part_column_drop drop column useless_3;
  2551. ^
  2552. <sql-statement>
  2553. create index part_column_drop_b_pred on part_column_drop(b) where b = 1;
  2554. </sql-statement>
  2555. -stdin-:<main>: Error: Parse Sql
  2556. -stdin-:<main>:1:1: Error: partial index is not supported yet
  2557. create index part_column_drop_b_pred on part_column_drop(b) where b = 1;
  2558. ^
  2559. <sql-statement>
  2560. create index part_column_drop_b_expr on part_column_drop((b = 1));
  2561. </sql-statement>
  2562. -stdin-:<main>: Error: Parse Sql
  2563. -stdin-:<main>:1:1: Error: index expression is not supported yet
  2564. create index part_column_drop_b_expr on part_column_drop((b = 1));
  2565. ^
  2566. <sql-statement>
  2567. create index part_column_drop_d_pred on part_column_drop(d) where d = 2;
  2568. </sql-statement>
  2569. -stdin-:<main>: Error: Parse Sql
  2570. -stdin-:<main>:1:1: Error: partial index is not supported yet
  2571. create index part_column_drop_d_pred on part_column_drop(d) where d = 2;
  2572. ^
  2573. <sql-statement>
  2574. create index part_column_drop_d_expr on part_column_drop((d = 2));
  2575. </sql-statement>
  2576. -stdin-:<main>: Error: Parse Sql
  2577. -stdin-:<main>:1:1: Error: index expression is not supported yet
  2578. create index part_column_drop_d_expr on part_column_drop((d = 2));
  2579. ^
  2580. <sql-statement>
  2581. create table part_column_drop_1_10 partition of
  2582. part_column_drop for values from (1) to (10);
  2583. </sql-statement>
  2584. -stdin-:<main>: Error: Parse Sql
  2585. -stdin-:<main>:1:1: Error: table inheritance not supported
  2586. create table part_column_drop_1_10 partition of
  2587. ^
  2588. <sql-statement>
  2589. \d part_column_drop
  2590. </sql-statement>
  2591. Metacommand \d part_column_drop is not supported
  2592. <sql-statement>
  2593. \d part_column_drop_1_10
  2594. </sql-statement>
  2595. Metacommand \d part_column_drop_1_10 is not supported
  2596. <sql-statement>
  2597. drop table part_column_drop;
  2598. </sql-statement>