alter_table.err 118 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455
  1. Registering pre-existing tables
  2. onek
  3. tenk1
  4. stud_emp
  5. <sql-statement>
  6. --
  7. -- ALTER_TABLE
  8. --
  9. -- Clean up in case a prior regression run failed
  10. SET client_min_messages TO 'warning';
  11. </sql-statement>
  12. <sql-statement>
  13. DROP ROLE IF EXISTS regress_alter_table_user1;
  14. </sql-statement>
  15. -stdin-:<main>: Error: Parse Sql
  16. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 287
  17. DROP ROLE IF EXISTS regress_alter_table_user1;
  18. ^
  19. <sql-statement>
  20. RESET client_min_messages;
  21. </sql-statement>
  22. <sql-statement>
  23. CREATE USER regress_alter_table_user1;
  24. </sql-statement>
  25. -stdin-:<main>: Error: Parse Sql
  26. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 285
  27. CREATE USER regress_alter_table_user1;
  28. ^
  29. <sql-statement>
  30. --
  31. -- add attribute
  32. --
  33. CREATE TABLE attmp (initial int4);
  34. </sql-statement>
  35. <sql-statement>
  36. COMMENT ON TABLE attmp_wrong IS 'table comment';
  37. </sql-statement>
  38. -stdin-:<main>: Error: Parse Sql
  39. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
  40. COMMENT ON TABLE attmp_wrong IS 'table comment';
  41. ^
  42. <sql-statement>
  43. COMMENT ON TABLE attmp IS 'table comment';
  44. </sql-statement>
  45. -stdin-:<main>: Error: Parse Sql
  46. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
  47. COMMENT ON TABLE attmp IS 'table comment';
  48. ^
  49. <sql-statement>
  50. COMMENT ON TABLE attmp IS NULL;
  51. </sql-statement>
  52. -stdin-:<main>: Error: Parse Sql
  53. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
  54. COMMENT ON TABLE attmp IS NULL;
  55. ^
  56. <sql-statement>
  57. ALTER TABLE attmp ADD COLUMN xmin integer; -- fails
  58. </sql-statement>
  59. -stdin-:<main>: Error: Parse Sql
  60. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  61. ALTER TABLE attmp ADD COLUMN xmin integer; -- fails
  62. ^
  63. <sql-statement>
  64. ALTER TABLE attmp ADD COLUMN a int4 default 3;
  65. </sql-statement>
  66. -stdin-:<main>: Error: Parse Sql
  67. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  68. ALTER TABLE attmp ADD COLUMN a int4 default 3;
  69. ^
  70. <sql-statement>
  71. ALTER TABLE attmp ADD COLUMN b name;
  72. </sql-statement>
  73. -stdin-:<main>: Error: Parse Sql
  74. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  75. ALTER TABLE attmp ADD COLUMN b name;
  76. ^
  77. <sql-statement>
  78. ALTER TABLE attmp ADD COLUMN c text;
  79. </sql-statement>
  80. -stdin-:<main>: Error: Parse Sql
  81. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  82. ALTER TABLE attmp ADD COLUMN c text;
  83. ^
  84. <sql-statement>
  85. ALTER TABLE attmp ADD COLUMN d float8;
  86. </sql-statement>
  87. -stdin-:<main>: Error: Parse Sql
  88. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  89. ALTER TABLE attmp ADD COLUMN d float8;
  90. ^
  91. <sql-statement>
  92. ALTER TABLE attmp ADD COLUMN e float4;
  93. </sql-statement>
  94. -stdin-:<main>: Error: Parse Sql
  95. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  96. ALTER TABLE attmp ADD COLUMN e float4;
  97. ^
  98. <sql-statement>
  99. ALTER TABLE attmp ADD COLUMN f int2;
  100. </sql-statement>
  101. -stdin-:<main>: Error: Parse Sql
  102. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  103. ALTER TABLE attmp ADD COLUMN f int2;
  104. ^
  105. <sql-statement>
  106. ALTER TABLE attmp ADD COLUMN g polygon;
  107. </sql-statement>
  108. -stdin-:<main>: Error: Parse Sql
  109. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  110. ALTER TABLE attmp ADD COLUMN g polygon;
  111. ^
  112. <sql-statement>
  113. ALTER TABLE attmp ADD COLUMN i char;
  114. </sql-statement>
  115. -stdin-:<main>: Error: Parse Sql
  116. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  117. ALTER TABLE attmp ADD COLUMN i char;
  118. ^
  119. <sql-statement>
  120. ALTER TABLE attmp ADD COLUMN k int4;
  121. </sql-statement>
  122. -stdin-:<main>: Error: Parse Sql
  123. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  124. ALTER TABLE attmp ADD COLUMN k int4;
  125. ^
  126. <sql-statement>
  127. ALTER TABLE attmp ADD COLUMN l tid;
  128. </sql-statement>
  129. -stdin-:<main>: Error: Parse Sql
  130. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  131. ALTER TABLE attmp ADD COLUMN l tid;
  132. ^
  133. <sql-statement>
  134. ALTER TABLE attmp ADD COLUMN m xid;
  135. </sql-statement>
  136. -stdin-:<main>: Error: Parse Sql
  137. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  138. ALTER TABLE attmp ADD COLUMN m xid;
  139. ^
  140. <sql-statement>
  141. ALTER TABLE attmp ADD COLUMN n oidvector;
  142. </sql-statement>
  143. -stdin-:<main>: Error: Parse Sql
  144. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  145. ALTER TABLE attmp ADD COLUMN n oidvector;
  146. ^
  147. <sql-statement>
  148. --ALTER TABLE attmp ADD COLUMN o lock;
  149. ALTER TABLE attmp ADD COLUMN p boolean;
  150. </sql-statement>
  151. -stdin-:<main>: Error: Parse Sql
  152. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  153. --ALTER TABLE attmp ADD COLUMN o lock;
  154. ^
  155. <sql-statement>
  156. ALTER TABLE attmp ADD COLUMN q point;
  157. </sql-statement>
  158. -stdin-:<main>: Error: Parse Sql
  159. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  160. ALTER TABLE attmp ADD COLUMN q point;
  161. ^
  162. <sql-statement>
  163. ALTER TABLE attmp ADD COLUMN r lseg;
  164. </sql-statement>
  165. -stdin-:<main>: Error: Parse Sql
  166. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  167. ALTER TABLE attmp ADD COLUMN r lseg;
  168. ^
  169. <sql-statement>
  170. ALTER TABLE attmp ADD COLUMN s path;
  171. </sql-statement>
  172. -stdin-:<main>: Error: Parse Sql
  173. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  174. ALTER TABLE attmp ADD COLUMN s path;
  175. ^
  176. <sql-statement>
  177. ALTER TABLE attmp ADD COLUMN t box;
  178. </sql-statement>
  179. -stdin-:<main>: Error: Parse Sql
  180. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  181. ALTER TABLE attmp ADD COLUMN t box;
  182. ^
  183. <sql-statement>
  184. ALTER TABLE attmp ADD COLUMN v timestamp;
  185. </sql-statement>
  186. -stdin-:<main>: Error: Parse Sql
  187. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  188. ALTER TABLE attmp ADD COLUMN v timestamp;
  189. ^
  190. <sql-statement>
  191. ALTER TABLE attmp ADD COLUMN w interval;
  192. </sql-statement>
  193. -stdin-:<main>: Error: Parse Sql
  194. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  195. ALTER TABLE attmp ADD COLUMN w interval;
  196. ^
  197. <sql-statement>
  198. ALTER TABLE attmp ADD COLUMN x float8[];
  199. </sql-statement>
  200. -stdin-:<main>: Error: Parse Sql
  201. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  202. ALTER TABLE attmp ADD COLUMN x float8[];
  203. ^
  204. <sql-statement>
  205. ALTER TABLE attmp ADD COLUMN y float4[];
  206. </sql-statement>
  207. -stdin-:<main>: Error: Parse Sql
  208. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  209. ALTER TABLE attmp ADD COLUMN y float4[];
  210. ^
  211. <sql-statement>
  212. ALTER TABLE attmp ADD COLUMN z int2[];
  213. </sql-statement>
  214. -stdin-:<main>: Error: Parse Sql
  215. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  216. ALTER TABLE attmp ADD COLUMN z int2[];
  217. ^
  218. <sql-statement>
  219. INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
  220. v, w, x, y, z)
  221. VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
  222. 'c',
  223. 314159, '(1,1)', '512',
  224. '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
  225. '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
  226. 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
  227. </sql-statement>
  228. <sql-statement>
  229. SELECT * FROM attmp;
  230. </sql-statement>
  231. <sql-statement>
  232. DROP TABLE attmp;
  233. </sql-statement>
  234. <sql-statement>
  235. -- the wolf bug - schema mods caused inconsistent row descriptors
  236. CREATE TABLE attmp (
  237. initial int4
  238. );
  239. </sql-statement>
  240. <sql-statement>
  241. ALTER TABLE attmp ADD COLUMN a int4;
  242. </sql-statement>
  243. -stdin-:<main>: Error: Parse Sql
  244. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  245. ALTER TABLE attmp ADD COLUMN a int4;
  246. ^
  247. <sql-statement>
  248. ALTER TABLE attmp ADD COLUMN b name;
  249. </sql-statement>
  250. -stdin-:<main>: Error: Parse Sql
  251. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  252. ALTER TABLE attmp ADD COLUMN b name;
  253. ^
  254. <sql-statement>
  255. ALTER TABLE attmp ADD COLUMN c text;
  256. </sql-statement>
  257. -stdin-:<main>: Error: Parse Sql
  258. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  259. ALTER TABLE attmp ADD COLUMN c text;
  260. ^
  261. <sql-statement>
  262. ALTER TABLE attmp ADD COLUMN d float8;
  263. </sql-statement>
  264. -stdin-:<main>: Error: Parse Sql
  265. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  266. ALTER TABLE attmp ADD COLUMN d float8;
  267. ^
  268. <sql-statement>
  269. ALTER TABLE attmp ADD COLUMN e float4;
  270. </sql-statement>
  271. -stdin-:<main>: Error: Parse Sql
  272. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  273. ALTER TABLE attmp ADD COLUMN e float4;
  274. ^
  275. <sql-statement>
  276. ALTER TABLE attmp ADD COLUMN f int2;
  277. </sql-statement>
  278. -stdin-:<main>: Error: Parse Sql
  279. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  280. ALTER TABLE attmp ADD COLUMN f int2;
  281. ^
  282. <sql-statement>
  283. ALTER TABLE attmp ADD COLUMN g polygon;
  284. </sql-statement>
  285. -stdin-:<main>: Error: Parse Sql
  286. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  287. ALTER TABLE attmp ADD COLUMN g polygon;
  288. ^
  289. <sql-statement>
  290. ALTER TABLE attmp ADD COLUMN i char;
  291. </sql-statement>
  292. -stdin-:<main>: Error: Parse Sql
  293. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  294. ALTER TABLE attmp ADD COLUMN i char;
  295. ^
  296. <sql-statement>
  297. ALTER TABLE attmp ADD COLUMN k int4;
  298. </sql-statement>
  299. -stdin-:<main>: Error: Parse Sql
  300. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  301. ALTER TABLE attmp ADD COLUMN k int4;
  302. ^
  303. <sql-statement>
  304. ALTER TABLE attmp ADD COLUMN l tid;
  305. </sql-statement>
  306. -stdin-:<main>: Error: Parse Sql
  307. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  308. ALTER TABLE attmp ADD COLUMN l tid;
  309. ^
  310. <sql-statement>
  311. ALTER TABLE attmp ADD COLUMN m xid;
  312. </sql-statement>
  313. -stdin-:<main>: Error: Parse Sql
  314. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  315. ALTER TABLE attmp ADD COLUMN m xid;
  316. ^
  317. <sql-statement>
  318. ALTER TABLE attmp ADD COLUMN n oidvector;
  319. </sql-statement>
  320. -stdin-:<main>: Error: Parse Sql
  321. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  322. ALTER TABLE attmp ADD COLUMN n oidvector;
  323. ^
  324. <sql-statement>
  325. --ALTER TABLE attmp ADD COLUMN o lock;
  326. ALTER TABLE attmp ADD COLUMN p boolean;
  327. </sql-statement>
  328. -stdin-:<main>: Error: Parse Sql
  329. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  330. --ALTER TABLE attmp ADD COLUMN o lock;
  331. ^
  332. <sql-statement>
  333. ALTER TABLE attmp ADD COLUMN q point;
  334. </sql-statement>
  335. -stdin-:<main>: Error: Parse Sql
  336. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  337. ALTER TABLE attmp ADD COLUMN q point;
  338. ^
  339. <sql-statement>
  340. ALTER TABLE attmp ADD COLUMN r lseg;
  341. </sql-statement>
  342. -stdin-:<main>: Error: Parse Sql
  343. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  344. ALTER TABLE attmp ADD COLUMN r lseg;
  345. ^
  346. <sql-statement>
  347. ALTER TABLE attmp ADD COLUMN s path;
  348. </sql-statement>
  349. -stdin-:<main>: Error: Parse Sql
  350. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  351. ALTER TABLE attmp ADD COLUMN s path;
  352. ^
  353. <sql-statement>
  354. ALTER TABLE attmp ADD COLUMN t box;
  355. </sql-statement>
  356. -stdin-:<main>: Error: Parse Sql
  357. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  358. ALTER TABLE attmp ADD COLUMN t box;
  359. ^
  360. <sql-statement>
  361. ALTER TABLE attmp ADD COLUMN v timestamp;
  362. </sql-statement>
  363. -stdin-:<main>: Error: Parse Sql
  364. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  365. ALTER TABLE attmp ADD COLUMN v timestamp;
  366. ^
  367. <sql-statement>
  368. ALTER TABLE attmp ADD COLUMN w interval;
  369. </sql-statement>
  370. -stdin-:<main>: Error: Parse Sql
  371. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  372. ALTER TABLE attmp ADD COLUMN w interval;
  373. ^
  374. <sql-statement>
  375. ALTER TABLE attmp ADD COLUMN x float8[];
  376. </sql-statement>
  377. -stdin-:<main>: Error: Parse Sql
  378. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  379. ALTER TABLE attmp ADD COLUMN x float8[];
  380. ^
  381. <sql-statement>
  382. ALTER TABLE attmp ADD COLUMN y float4[];
  383. </sql-statement>
  384. -stdin-:<main>: Error: Parse Sql
  385. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  386. ALTER TABLE attmp ADD COLUMN y float4[];
  387. ^
  388. <sql-statement>
  389. ALTER TABLE attmp ADD COLUMN z int2[];
  390. </sql-statement>
  391. -stdin-:<main>: Error: Parse Sql
  392. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  393. ALTER TABLE attmp ADD COLUMN z int2[];
  394. ^
  395. <sql-statement>
  396. INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
  397. v, w, x, y, z)
  398. VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
  399. 'c',
  400. 314159, '(1,1)', '512',
  401. '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
  402. '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
  403. 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
  404. </sql-statement>
  405. <sql-statement>
  406. SELECT * FROM attmp;
  407. </sql-statement>
  408. <sql-statement>
  409. CREATE INDEX attmp_idx ON attmp (a, (d + e), b);
  410. </sql-statement>
  411. -stdin-:<main>: Error: Parse Sql
  412. -stdin-:<main>:1:1: Error: index expression is not supported yet
  413. CREATE INDEX attmp_idx ON attmp (a, (d + e), b);
  414. ^
  415. <sql-statement>
  416. ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
  417. </sql-statement>
  418. -stdin-:<main>: Error: Parse Sql
  419. -stdin-:<main>:1:37: Error: ERROR: column number must be in range from 1 to 32767
  420. ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
  421. ^
  422. <sql-statement>
  423. ALTER INDEX attmp_idx ALTER COLUMN 1 SET STATISTICS 1000;
  424. </sql-statement>
  425. -stdin-:<main>: Error: Parse Sql
  426. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  427. ALTER INDEX attmp_idx ALTER COLUMN 1 SET STATISTICS 1000;
  428. ^
  429. <sql-statement>
  430. ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS 1000;
  431. </sql-statement>
  432. -stdin-:<main>: Error: Parse Sql
  433. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  434. ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS 1000;
  435. ^
  436. <sql-statement>
  437. \d+ attmp_idx
  438. </sql-statement>
  439. Metacommand \d+ attmp_idx is not supported
  440. <sql-statement>
  441. ALTER INDEX attmp_idx ALTER COLUMN 3 SET STATISTICS 1000;
  442. </sql-statement>
  443. -stdin-:<main>: Error: Parse Sql
  444. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  445. ALTER INDEX attmp_idx ALTER COLUMN 3 SET STATISTICS 1000;
  446. ^
  447. <sql-statement>
  448. ALTER INDEX attmp_idx ALTER COLUMN 4 SET STATISTICS 1000;
  449. </sql-statement>
  450. -stdin-:<main>: Error: Parse Sql
  451. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  452. ALTER INDEX attmp_idx ALTER COLUMN 4 SET STATISTICS 1000;
  453. ^
  454. <sql-statement>
  455. ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS -1;
  456. </sql-statement>
  457. -stdin-:<main>: Error: Parse Sql
  458. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  459. ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS -1;
  460. ^
  461. <sql-statement>
  462. DROP TABLE attmp;
  463. </sql-statement>
  464. <sql-statement>
  465. -- fails with incorrect object type
  466. CREATE VIEW at_v1 AS SELECT 1 as a;
  467. </sql-statement>
  468. -stdin-:<main>: Error: Parse Sql
  469. -stdin-:<main>:1:1: Error: expected at least one target column
  470. -- fails with incorrect object type
  471. ^
  472. <sql-statement>
  473. ALTER TABLE at_v1 ALTER COLUMN a SET STATISTICS 0;
  474. </sql-statement>
  475. -stdin-:<main>: Error: Parse Sql
  476. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  477. ALTER TABLE at_v1 ALTER COLUMN a SET STATISTICS 0;
  478. ^
  479. <sql-statement>
  480. DROP VIEW at_v1;
  481. </sql-statement>
  482. -stdin-:<main>: Error: Parse Sql
  483. -stdin-:<main>:1:1: Error: View not found: 'at_v1'
  484. DROP VIEW at_v1;
  485. ^
  486. <sql-statement>
  487. --
  488. -- rename - check on both non-temp and temp tables
  489. --
  490. CREATE TABLE attmp (regtable int);
  491. </sql-statement>
  492. <sql-statement>
  493. CREATE TEMP TABLE attmp (attmptable int);
  494. </sql-statement>
  495. <sql-statement>
  496. ALTER TABLE attmp RENAME TO attmp_new;
  497. </sql-statement>
  498. -stdin-:<main>: Error: Parse Sql
  499. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  500. ALTER TABLE attmp RENAME TO attmp_new;
  501. ^
  502. <sql-statement>
  503. SELECT * FROM attmp;
  504. </sql-statement>
  505. <sql-statement>
  506. SELECT * FROM attmp_new;
  507. </sql-statement>
  508. -stdin-:<main>: Fatal: Table metadata loading
  509. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.attmp_new
  510. <sql-statement>
  511. ALTER TABLE attmp RENAME TO attmp_new2;
  512. </sql-statement>
  513. -stdin-:<main>: Error: Parse Sql
  514. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  515. ALTER TABLE attmp RENAME TO attmp_new2;
  516. ^
  517. <sql-statement>
  518. SELECT * FROM attmp; -- should fail
  519. </sql-statement>
  520. <sql-statement>
  521. SELECT * FROM attmp_new;
  522. </sql-statement>
  523. -stdin-:<main>: Fatal: Table metadata loading
  524. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.attmp_new
  525. <sql-statement>
  526. SELECT * FROM attmp_new2;
  527. </sql-statement>
  528. -stdin-:<main>: Fatal: Table metadata loading
  529. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.attmp_new2
  530. <sql-statement>
  531. DROP TABLE attmp_new;
  532. </sql-statement>
  533. <sql-statement>
  534. DROP TABLE attmp_new2;
  535. </sql-statement>
  536. <sql-statement>
  537. -- check rename of partitioned tables and indexes also
  538. CREATE TABLE part_attmp (a int primary key) partition by range (a);
  539. </sql-statement>
  540. -stdin-:<main>: Error: Parse Sql
  541. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  542. -- check rename of partitioned tables and indexes also
  543. ^
  544. <sql-statement>
  545. CREATE TABLE part_attmp1 PARTITION OF part_attmp FOR VALUES FROM (0) TO (100);
  546. </sql-statement>
  547. -stdin-:<main>: Error: Parse Sql
  548. -stdin-:<main>:1:1: Error: table inheritance not supported
  549. CREATE TABLE part_attmp1 PARTITION OF part_attmp FOR VALUES FROM (0) TO (100);
  550. ^
  551. <sql-statement>
  552. ALTER INDEX part_attmp_pkey RENAME TO part_attmp_index;
  553. </sql-statement>
  554. -stdin-:<main>: Error: Parse Sql
  555. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  556. ALTER INDEX part_attmp_pkey RENAME TO part_attmp_index;
  557. ^
  558. <sql-statement>
  559. ALTER INDEX part_attmp1_pkey RENAME TO part_attmp1_index;
  560. </sql-statement>
  561. -stdin-:<main>: Error: Parse Sql
  562. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  563. ALTER INDEX part_attmp1_pkey RENAME TO part_attmp1_index;
  564. ^
  565. <sql-statement>
  566. ALTER TABLE part_attmp RENAME TO part_at2tmp;
  567. </sql-statement>
  568. -stdin-:<main>: Error: Parse Sql
  569. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  570. ALTER TABLE part_attmp RENAME TO part_at2tmp;
  571. ^
  572. <sql-statement>
  573. ALTER TABLE part_attmp1 RENAME TO part_at2tmp1;
  574. </sql-statement>
  575. -stdin-:<main>: Error: Parse Sql
  576. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  577. ALTER TABLE part_attmp1 RENAME TO part_at2tmp1;
  578. ^
  579. <sql-statement>
  580. SET ROLE regress_alter_table_user1;
  581. </sql-statement>
  582. -stdin-:<main>: Error: Parse Sql
  583. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: role
  584. SET ROLE regress_alter_table_user1;
  585. ^
  586. <sql-statement>
  587. ALTER INDEX part_attmp_index RENAME TO fail;
  588. </sql-statement>
  589. -stdin-:<main>: Error: Parse Sql
  590. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  591. ALTER INDEX part_attmp_index RENAME TO fail;
  592. ^
  593. <sql-statement>
  594. ALTER INDEX part_attmp1_index RENAME TO fail;
  595. </sql-statement>
  596. -stdin-:<main>: Error: Parse Sql
  597. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  598. ALTER INDEX part_attmp1_index RENAME TO fail;
  599. ^
  600. <sql-statement>
  601. ALTER TABLE part_at2tmp RENAME TO fail;
  602. </sql-statement>
  603. -stdin-:<main>: Error: Parse Sql
  604. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  605. ALTER TABLE part_at2tmp RENAME TO fail;
  606. ^
  607. <sql-statement>
  608. ALTER TABLE part_at2tmp1 RENAME TO fail;
  609. </sql-statement>
  610. -stdin-:<main>: Error: Parse Sql
  611. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  612. ALTER TABLE part_at2tmp1 RENAME TO fail;
  613. ^
  614. <sql-statement>
  615. RESET ROLE;
  616. </sql-statement>
  617. -stdin-:<main>: Error: Parse Sql
  618. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
  619. RESET ROLE;
  620. ^
  621. <sql-statement>
  622. DROP TABLE part_at2tmp;
  623. </sql-statement>
  624. <sql-statement>
  625. --
  626. -- check renaming to a table's array type's autogenerated name
  627. -- (the array type's name should get out of the way)
  628. --
  629. CREATE TABLE attmp_array (id int);
  630. </sql-statement>
  631. <sql-statement>
  632. CREATE TABLE attmp_array2 (id int);
  633. </sql-statement>
  634. <sql-statement>
  635. SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
  636. </sql-statement>
  637. -stdin-:<main>: Fatal: Execution
  638. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  639. SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
  640. ^
  641. -stdin-:<main>:1:1: Fatal: ERROR: type "attmp_array[]" does not exist
  642. SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
  643. ^
  644. <sql-statement>
  645. SELECT typname FROM pg_type WHERE oid = 'attmp_array2[]'::regtype;
  646. </sql-statement>
  647. -stdin-:<main>: Fatal: Execution
  648. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  649. SELECT typname FROM pg_type WHERE oid = 'attmp_array2[]'::regtype;
  650. ^
  651. -stdin-:<main>:1:1: Fatal: ERROR: type "attmp_array2[]" does not exist
  652. SELECT typname FROM pg_type WHERE oid = 'attmp_array2[]'::regtype;
  653. ^
  654. <sql-statement>
  655. ALTER TABLE attmp_array2 RENAME TO _attmp_array;
  656. </sql-statement>
  657. -stdin-:<main>: Error: Parse Sql
  658. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  659. ALTER TABLE attmp_array2 RENAME TO _attmp_array;
  660. ^
  661. <sql-statement>
  662. SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
  663. </sql-statement>
  664. -stdin-:<main>: Fatal: Execution
  665. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  666. SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
  667. ^
  668. -stdin-:<main>:1:1: Fatal: ERROR: type "attmp_array[]" does not exist
  669. SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
  670. ^
  671. <sql-statement>
  672. SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
  673. </sql-statement>
  674. -stdin-:<main>: Fatal: Execution
  675. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  676. SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
  677. ^
  678. -stdin-:<main>:1:1: Fatal: ERROR: type "_attmp_array[]" does not exist
  679. SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
  680. ^
  681. <sql-statement>
  682. DROP TABLE _attmp_array;
  683. </sql-statement>
  684. <sql-statement>
  685. DROP TABLE attmp_array;
  686. </sql-statement>
  687. <sql-statement>
  688. -- renaming to table's own array type's name is an interesting corner case
  689. CREATE TABLE attmp_array (id int);
  690. </sql-statement>
  691. <sql-statement>
  692. SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
  693. </sql-statement>
  694. -stdin-:<main>: Fatal: Execution
  695. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  696. SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
  697. ^
  698. -stdin-:<main>:1:1: Fatal: ERROR: type "attmp_array[]" does not exist
  699. SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
  700. ^
  701. <sql-statement>
  702. ALTER TABLE attmp_array RENAME TO _attmp_array;
  703. </sql-statement>
  704. -stdin-:<main>: Error: Parse Sql
  705. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  706. ALTER TABLE attmp_array RENAME TO _attmp_array;
  707. ^
  708. <sql-statement>
  709. SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
  710. </sql-statement>
  711. -stdin-:<main>: Fatal: Execution
  712. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  713. SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
  714. ^
  715. -stdin-:<main>:1:1: Fatal: ERROR: type "_attmp_array[]" does not exist
  716. SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
  717. ^
  718. <sql-statement>
  719. DROP TABLE _attmp_array;
  720. </sql-statement>
  721. <sql-statement>
  722. -- ALTER TABLE ... RENAME on non-table relations
  723. -- renaming indexes (FIXME: this should probably test the index's functionality)
  724. ALTER INDEX IF EXISTS __onek_unique1 RENAME TO attmp_onek_unique1;
  725. </sql-statement>
  726. -stdin-:<main>: Error: Parse Sql
  727. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  728. -- ALTER TABLE ... RENAME on non-table relations
  729. ^
  730. <sql-statement>
  731. ALTER INDEX IF EXISTS __attmp_onek_unique1 RENAME TO onek_unique1;
  732. </sql-statement>
  733. -stdin-:<main>: Error: Parse Sql
  734. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  735. ALTER INDEX IF EXISTS __attmp_onek_unique1 RENAME TO onek_unique1;
  736. ^
  737. <sql-statement>
  738. ALTER INDEX onek_unique1 RENAME TO attmp_onek_unique1;
  739. </sql-statement>
  740. -stdin-:<main>: Error: Parse Sql
  741. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  742. ALTER INDEX onek_unique1 RENAME TO attmp_onek_unique1;
  743. ^
  744. <sql-statement>
  745. ALTER INDEX attmp_onek_unique1 RENAME TO onek_unique1;
  746. </sql-statement>
  747. -stdin-:<main>: Error: Parse Sql
  748. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  749. ALTER INDEX attmp_onek_unique1 RENAME TO onek_unique1;
  750. ^
  751. <sql-statement>
  752. SET ROLE regress_alter_table_user1;
  753. </sql-statement>
  754. -stdin-:<main>: Error: Parse Sql
  755. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: role
  756. SET ROLE regress_alter_table_user1;
  757. ^
  758. <sql-statement>
  759. ALTER INDEX onek_unique1 RENAME TO fail; -- permission denied
  760. </sql-statement>
  761. -stdin-:<main>: Error: Parse Sql
  762. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  763. ALTER INDEX onek_unique1 RENAME TO fail; -- permission denied
  764. ^
  765. <sql-statement>
  766. RESET ROLE;
  767. </sql-statement>
  768. -stdin-:<main>: Error: Parse Sql
  769. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
  770. RESET ROLE;
  771. ^
  772. <sql-statement>
  773. -- rename statements with mismatching statement and object types
  774. CREATE TABLE alter_idx_rename_test (a INT);
  775. </sql-statement>
  776. <sql-statement>
  777. CREATE INDEX alter_idx_rename_test_idx ON alter_idx_rename_test (a);
  778. </sql-statement>
  779. <sql-statement>
  780. CREATE TABLE alter_idx_rename_test_parted (a INT) PARTITION BY LIST (a);
  781. </sql-statement>
  782. -stdin-:<main>: Error: Parse Sql
  783. -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
  784. CREATE TABLE alter_idx_rename_test_parted (a INT) PARTITION BY LIST (a);
  785. ^
  786. <sql-statement>
  787. CREATE INDEX alter_idx_rename_test_parted_idx ON alter_idx_rename_test_parted (a);
  788. </sql-statement>
  789. <sql-statement>
  790. BEGIN;
  791. </sql-statement>
  792. <sql-statement>
  793. ALTER INDEX alter_idx_rename_test RENAME TO alter_idx_rename_test_2;
  794. </sql-statement>
  795. -stdin-:<main>: Error: Parse Sql
  796. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  797. ALTER INDEX alter_idx_rename_test RENAME TO alter_idx_rename_test_2;
  798. ^
  799. <sql-statement>
  800. ALTER INDEX alter_idx_rename_test_parted RENAME TO alter_idx_rename_test_parted_2;
  801. </sql-statement>
  802. -stdin-:<main>: Error: Parse Sql
  803. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  804. ALTER INDEX alter_idx_rename_test_parted RENAME TO alter_idx_rename_test_parted_2;
  805. ^
  806. <sql-statement>
  807. SELECT relation::regclass, mode FROM pg_locks
  808. WHERE pid = pg_backend_pid() AND locktype = 'relation'
  809. AND relation::regclass::text LIKE 'alter\_idx%'
  810. ORDER BY relation::regclass::text COLLATE "C";
  811. </sql-statement>
  812. -stdin-:<main>: Error: Parse Sql
  813. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 365
  814. SELECT relation::regclass, mode FROM pg_locks
  815. ^
  816. <sql-statement>
  817. COMMIT;
  818. </sql-statement>
  819. <sql-statement>
  820. BEGIN;
  821. </sql-statement>
  822. <sql-statement>
  823. ALTER INDEX alter_idx_rename_test_idx RENAME TO alter_idx_rename_test_idx_2;
  824. </sql-statement>
  825. -stdin-:<main>: Error: Parse Sql
  826. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  827. ALTER INDEX alter_idx_rename_test_idx RENAME TO alter_idx_rename_test_idx_2;
  828. ^
  829. <sql-statement>
  830. ALTER INDEX alter_idx_rename_test_parted_idx RENAME TO alter_idx_rename_test_parted_idx_2;
  831. </sql-statement>
  832. -stdin-:<main>: Error: Parse Sql
  833. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  834. ALTER INDEX alter_idx_rename_test_parted_idx RENAME TO alter_idx_rename_test_parted_idx_2;
  835. ^
  836. <sql-statement>
  837. SELECT relation::regclass, mode FROM pg_locks
  838. WHERE pid = pg_backend_pid() AND locktype = 'relation'
  839. AND relation::regclass::text LIKE 'alter\_idx%'
  840. ORDER BY relation::regclass::text COLLATE "C";
  841. </sql-statement>
  842. -stdin-:<main>: Error: Parse Sql
  843. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 365
  844. SELECT relation::regclass, mode FROM pg_locks
  845. ^
  846. <sql-statement>
  847. COMMIT;
  848. </sql-statement>
  849. <sql-statement>
  850. BEGIN;
  851. </sql-statement>
  852. <sql-statement>
  853. ALTER TABLE alter_idx_rename_test_idx_2 RENAME TO alter_idx_rename_test_idx_3;
  854. </sql-statement>
  855. -stdin-:<main>: Error: Parse Sql
  856. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  857. ALTER TABLE alter_idx_rename_test_idx_2 RENAME TO alter_idx_rename_test_idx_3;
  858. ^
  859. <sql-statement>
  860. ALTER TABLE alter_idx_rename_test_parted_idx_2 RENAME TO alter_idx_rename_test_parted_idx_3;
  861. </sql-statement>
  862. -stdin-:<main>: Error: Parse Sql
  863. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  864. ALTER TABLE alter_idx_rename_test_parted_idx_2 RENAME TO alter_idx_rename_test_parted_idx_3;
  865. ^
  866. <sql-statement>
  867. SELECT relation::regclass, mode FROM pg_locks
  868. WHERE pid = pg_backend_pid() AND locktype = 'relation'
  869. AND relation::regclass::text LIKE 'alter\_idx%'
  870. ORDER BY relation::regclass::text COLLATE "C";
  871. </sql-statement>
  872. -stdin-:<main>: Error: Parse Sql
  873. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 365
  874. SELECT relation::regclass, mode FROM pg_locks
  875. ^
  876. <sql-statement>
  877. COMMIT;
  878. </sql-statement>
  879. <sql-statement>
  880. DROP TABLE alter_idx_rename_test_2;
  881. </sql-statement>
  882. <sql-statement>
  883. -- renaming views
  884. CREATE VIEW attmp_view (unique1) AS SELECT unique1 FROM tenk1;
  885. </sql-statement>
  886. -stdin-:<main>: Error: Parse Sql
  887. -stdin-:<main>: Error: Not all views have been dropped
  888. <sql-statement>
  889. ALTER TABLE attmp_view RENAME TO attmp_view_new;
  890. </sql-statement>
  891. -stdin-:<main>: Error: Parse Sql
  892. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  893. ALTER TABLE attmp_view RENAME TO attmp_view_new;
  894. ^
  895. <sql-statement>
  896. SET ROLE regress_alter_table_user1;
  897. </sql-statement>
  898. -stdin-:<main>: Error: Parse Sql
  899. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: role
  900. SET ROLE regress_alter_table_user1;
  901. ^
  902. <sql-statement>
  903. ALTER VIEW attmp_view_new RENAME TO fail; -- permission denied
  904. </sql-statement>
  905. -stdin-:<main>: Error: Parse Sql
  906. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  907. ALTER VIEW attmp_view_new RENAME TO fail; -- permission denied
  908. ^
  909. <sql-statement>
  910. RESET ROLE;
  911. </sql-statement>
  912. -stdin-:<main>: Error: Parse Sql
  913. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
  914. RESET ROLE;
  915. ^
  916. <sql-statement>
  917. -- hack to ensure we get an indexscan here
  918. set enable_seqscan to off;
  919. </sql-statement>
  920. -stdin-:<main>: Error: Parse Sql
  921. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
  922. -- hack to ensure we get an indexscan here
  923. ^
  924. <sql-statement>
  925. set enable_bitmapscan to off;
  926. </sql-statement>
  927. -stdin-:<main>: Error: Parse Sql
  928. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_bitmapscan
  929. set enable_bitmapscan to off;
  930. ^
  931. <sql-statement>
  932. -- 5 values, sorted
  933. SELECT unique1 FROM tenk1 WHERE unique1 < 5;
  934. </sql-statement>
  935. <sql-statement>
  936. reset enable_seqscan;
  937. </sql-statement>
  938. -stdin-:<main>: Error: Parse Sql
  939. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
  940. reset enable_seqscan;
  941. ^
  942. <sql-statement>
  943. reset enable_bitmapscan;
  944. </sql-statement>
  945. -stdin-:<main>: Error: Parse Sql
  946. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
  947. reset enable_bitmapscan;
  948. ^
  949. <sql-statement>
  950. DROP VIEW attmp_view_new;
  951. </sql-statement>
  952. -stdin-:<main>: Error: Parse Sql
  953. -stdin-:<main>:1:1: Error: View not found: 'attmp_view_new'
  954. DROP VIEW attmp_view_new;
  955. ^
  956. <sql-statement>
  957. -- toast-like relation name
  958. alter table stud_emp rename to pg_toast_stud_emp;
  959. </sql-statement>
  960. -stdin-:<main>: Error: Parse Sql
  961. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  962. -- toast-like relation name
  963. ^
  964. <sql-statement>
  965. alter table pg_toast_stud_emp rename to stud_emp;
  966. </sql-statement>
  967. -stdin-:<main>: Error: Parse Sql
  968. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  969. alter table pg_toast_stud_emp rename to stud_emp;
  970. ^
  971. <sql-statement>
  972. -- renaming index should rename constraint as well
  973. ALTER TABLE onek ADD CONSTRAINT onek_unique1_constraint UNIQUE (unique1);
  974. </sql-statement>
  975. -stdin-:<main>: Error: Parse Sql
  976. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  977. -- renaming index should rename constraint as well
  978. ^
  979. <sql-statement>
  980. ALTER INDEX onek_unique1_constraint RENAME TO onek_unique1_constraint_foo;
  981. </sql-statement>
  982. -stdin-:<main>: Error: Parse Sql
  983. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  984. ALTER INDEX onek_unique1_constraint RENAME TO onek_unique1_constraint_foo;
  985. ^
  986. <sql-statement>
  987. ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
  988. </sql-statement>
  989. -stdin-:<main>: Error: Parse Sql
  990. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  991. ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
  992. ^
  993. <sql-statement>
  994. -- renaming constraint
  995. ALTER TABLE onek ADD CONSTRAINT onek_check_constraint CHECK (unique1 >= 0);
  996. </sql-statement>
  997. -stdin-:<main>: Error: Parse Sql
  998. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  999. -- renaming constraint
  1000. ^
  1001. <sql-statement>
  1002. ALTER TABLE onek RENAME CONSTRAINT onek_check_constraint TO onek_check_constraint_foo;
  1003. </sql-statement>
  1004. -stdin-:<main>: Error: Parse Sql
  1005. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1006. ALTER TABLE onek RENAME CONSTRAINT onek_check_constraint TO onek_check_constraint_foo;
  1007. ^
  1008. <sql-statement>
  1009. ALTER TABLE onek DROP CONSTRAINT onek_check_constraint_foo;
  1010. </sql-statement>
  1011. -stdin-:<main>: Error: Parse Sql
  1012. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1013. ALTER TABLE onek DROP CONSTRAINT onek_check_constraint_foo;
  1014. ^
  1015. <sql-statement>
  1016. -- renaming constraint should rename index as well
  1017. ALTER TABLE onek ADD CONSTRAINT onek_unique1_constraint UNIQUE (unique1);
  1018. </sql-statement>
  1019. -stdin-:<main>: Error: Parse Sql
  1020. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1021. -- renaming constraint should rename index as well
  1022. ^
  1023. <sql-statement>
  1024. DROP INDEX onek_unique1_constraint; -- to see whether it's there
  1025. </sql-statement>
  1026. -stdin-:<main>: Error: Pre type annotation
  1027. -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
  1028. DROP INDEX onek_unique1_constraint; -- to see whether it's there
  1029. ^
  1030. <sql-statement>
  1031. ALTER TABLE onek RENAME CONSTRAINT onek_unique1_constraint TO onek_unique1_constraint_foo;
  1032. </sql-statement>
  1033. -stdin-:<main>: Error: Parse Sql
  1034. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1035. ALTER TABLE onek RENAME CONSTRAINT onek_unique1_constraint TO onek_unique1_constraint_foo;
  1036. ^
  1037. <sql-statement>
  1038. DROP INDEX onek_unique1_constraint_foo; -- to see whether it's there
  1039. </sql-statement>
  1040. -stdin-:<main>: Error: Pre type annotation
  1041. -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
  1042. DROP INDEX onek_unique1_constraint_foo; -- to see whether it's there
  1043. ^
  1044. <sql-statement>
  1045. ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
  1046. </sql-statement>
  1047. -stdin-:<main>: Error: Parse Sql
  1048. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1049. ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
  1050. ^
  1051. <sql-statement>
  1052. -- renaming constraints vs. inheritance
  1053. CREATE TABLE constraint_rename_test (a int CONSTRAINT con1 CHECK (a > 0), b int, c int);
  1054. </sql-statement>
  1055. -stdin-:<main>: Error: Parse Sql
  1056. -stdin-:<main>:1:1: Error: column constraint not supported
  1057. -- renaming constraints vs. inheritance
  1058. ^
  1059. <sql-statement>
  1060. \d constraint_rename_test
  1061. </sql-statement>
  1062. Metacommand \d constraint_rename_test is not supported
  1063. <sql-statement>
  1064. CREATE TABLE constraint_rename_test2 (a int CONSTRAINT con1 CHECK (a > 0), d int) INHERITS (constraint_rename_test);
  1065. </sql-statement>
  1066. -stdin-:<main>: Error: Parse Sql
  1067. -stdin-:<main>:1:1: Error: table inheritance not supported
  1068. CREATE TABLE constraint_rename_test2 (a int CONSTRAINT con1 CHECK (a > 0), d int) INHERITS (constraint_rename_test);
  1069. ^
  1070. <sql-statement>
  1071. \d constraint_rename_test2
  1072. </sql-statement>
  1073. Metacommand \d constraint_rename_test2 is not supported
  1074. <sql-statement>
  1075. ALTER TABLE constraint_rename_test2 RENAME CONSTRAINT con1 TO con1foo; -- fail
  1076. </sql-statement>
  1077. -stdin-:<main>: Error: Parse Sql
  1078. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1079. ALTER TABLE constraint_rename_test2 RENAME CONSTRAINT con1 TO con1foo; -- fail
  1080. ^
  1081. <sql-statement>
  1082. ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- fail
  1083. </sql-statement>
  1084. -stdin-:<main>: Error: Parse Sql
  1085. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1086. ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- fail
  1087. ^
  1088. <sql-statement>
  1089. ALTER TABLE constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- ok
  1090. </sql-statement>
  1091. -stdin-:<main>: Error: Parse Sql
  1092. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1093. ALTER TABLE constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- ok
  1094. ^
  1095. <sql-statement>
  1096. \d constraint_rename_test
  1097. </sql-statement>
  1098. Metacommand \d constraint_rename_test is not supported
  1099. <sql-statement>
  1100. \d constraint_rename_test2
  1101. </sql-statement>
  1102. Metacommand \d constraint_rename_test2 is not supported
  1103. <sql-statement>
  1104. ALTER TABLE constraint_rename_test ADD CONSTRAINT con2 CHECK (b > 0) NO INHERIT;
  1105. </sql-statement>
  1106. -stdin-:<main>: Error: Parse Sql
  1107. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1108. ALTER TABLE constraint_rename_test ADD CONSTRAINT con2 CHECK (b > 0) NO INHERIT;
  1109. ^
  1110. <sql-statement>
  1111. ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con2 TO con2foo; -- ok
  1112. </sql-statement>
  1113. -stdin-:<main>: Error: Parse Sql
  1114. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1115. ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con2 TO con2foo; -- ok
  1116. ^
  1117. <sql-statement>
  1118. ALTER TABLE constraint_rename_test RENAME CONSTRAINT con2foo TO con2bar; -- ok
  1119. </sql-statement>
  1120. -stdin-:<main>: Error: Parse Sql
  1121. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1122. ALTER TABLE constraint_rename_test RENAME CONSTRAINT con2foo TO con2bar; -- ok
  1123. ^
  1124. <sql-statement>
  1125. \d constraint_rename_test
  1126. </sql-statement>
  1127. Metacommand \d constraint_rename_test is not supported
  1128. <sql-statement>
  1129. \d constraint_rename_test2
  1130. </sql-statement>
  1131. Metacommand \d constraint_rename_test2 is not supported
  1132. <sql-statement>
  1133. ALTER TABLE constraint_rename_test ADD CONSTRAINT con3 PRIMARY KEY (a);
  1134. </sql-statement>
  1135. -stdin-:<main>: Error: Parse Sql
  1136. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1137. ALTER TABLE constraint_rename_test ADD CONSTRAINT con3 PRIMARY KEY (a);
  1138. ^
  1139. <sql-statement>
  1140. ALTER TABLE constraint_rename_test RENAME CONSTRAINT con3 TO con3foo; -- ok
  1141. </sql-statement>
  1142. -stdin-:<main>: Error: Parse Sql
  1143. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1144. ALTER TABLE constraint_rename_test RENAME CONSTRAINT con3 TO con3foo; -- ok
  1145. ^
  1146. <sql-statement>
  1147. \d constraint_rename_test
  1148. </sql-statement>
  1149. Metacommand \d constraint_rename_test is not supported
  1150. <sql-statement>
  1151. \d constraint_rename_test2
  1152. </sql-statement>
  1153. Metacommand \d constraint_rename_test2 is not supported
  1154. <sql-statement>
  1155. DROP TABLE constraint_rename_test2;
  1156. </sql-statement>
  1157. <sql-statement>
  1158. DROP TABLE constraint_rename_test;
  1159. </sql-statement>
  1160. <sql-statement>
  1161. ALTER TABLE IF EXISTS constraint_not_exist RENAME CONSTRAINT con3 TO con3foo; -- ok
  1162. </sql-statement>
  1163. -stdin-:<main>: Error: Parse Sql
  1164. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1165. ALTER TABLE IF EXISTS constraint_not_exist RENAME CONSTRAINT con3 TO con3foo; -- ok
  1166. ^
  1167. <sql-statement>
  1168. ALTER TABLE IF EXISTS constraint_rename_test ADD CONSTRAINT con4 UNIQUE (a);
  1169. </sql-statement>
  1170. -stdin-:<main>: Error: Parse Sql
  1171. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1172. ALTER TABLE IF EXISTS constraint_rename_test ADD CONSTRAINT con4 UNIQUE (a);
  1173. ^
  1174. <sql-statement>
  1175. -- renaming constraints with cache reset of target relation
  1176. CREATE TABLE constraint_rename_cache (a int,
  1177. CONSTRAINT chk_a CHECK (a > 0),
  1178. PRIMARY KEY (a));
  1179. </sql-statement>
  1180. -stdin-:<main>: Error: Parse Sql
  1181. -stdin-:<main>:1:1: Error: table constraint not supported
  1182. -- renaming constraints with cache reset of target relation
  1183. ^
  1184. <sql-statement>
  1185. ALTER TABLE constraint_rename_cache
  1186. RENAME CONSTRAINT chk_a TO chk_a_new;
  1187. </sql-statement>
  1188. -stdin-:<main>: Error: Parse Sql
  1189. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1190. ALTER TABLE constraint_rename_cache
  1191. ^
  1192. <sql-statement>
  1193. ALTER TABLE constraint_rename_cache
  1194. RENAME CONSTRAINT constraint_rename_cache_pkey TO constraint_rename_pkey_new;
  1195. </sql-statement>
  1196. -stdin-:<main>: Error: Parse Sql
  1197. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  1198. ALTER TABLE constraint_rename_cache
  1199. ^
  1200. <sql-statement>
  1201. CREATE TABLE like_constraint_rename_cache
  1202. (LIKE constraint_rename_cache INCLUDING ALL);
  1203. </sql-statement>
  1204. -stdin-:<main>: Error: Parse Sql
  1205. -stdin-:<main>:1:1: Error: CreateStmt: alternative is not implemented yet : 389
  1206. CREATE TABLE like_constraint_rename_cache
  1207. ^
  1208. <sql-statement>
  1209. \d like_constraint_rename_cache
  1210. </sql-statement>
  1211. Metacommand \d like_constraint_rename_cache is not supported
  1212. <sql-statement>
  1213. DROP TABLE constraint_rename_cache;
  1214. </sql-statement>
  1215. <sql-statement>
  1216. DROP TABLE like_constraint_rename_cache;
  1217. </sql-statement>
  1218. <sql-statement>
  1219. -- FOREIGN KEY CONSTRAINT adding TEST
  1220. CREATE TABLE attmp2 (a int primary key);
  1221. </sql-statement>
  1222. <sql-statement>
  1223. CREATE TABLE attmp3 (a int, b int);
  1224. </sql-statement>
  1225. <sql-statement>
  1226. CREATE TABLE attmp4 (a int, b int, unique(a,b));
  1227. </sql-statement>
  1228. <sql-statement>
  1229. CREATE TABLE attmp5 (a int, b int);
  1230. </sql-statement>
  1231. <sql-statement>
  1232. -- Insert rows into attmp2 (pktable)
  1233. INSERT INTO attmp2 values (1);
  1234. </sql-statement>
  1235. <sql-statement>
  1236. INSERT INTO attmp2 values (2);
  1237. </sql-statement>
  1238. <sql-statement>
  1239. INSERT INTO attmp2 values (3);
  1240. </sql-statement>
  1241. <sql-statement>
  1242. INSERT INTO attmp2 values (4);
  1243. </sql-statement>
  1244. <sql-statement>
  1245. -- Insert rows into attmp3
  1246. INSERT INTO attmp3 values (1,10);
  1247. </sql-statement>
  1248. <sql-statement>
  1249. INSERT INTO attmp3 values (1,20);
  1250. </sql-statement>
  1251. <sql-statement>
  1252. INSERT INTO attmp3 values (5,50);
  1253. </sql-statement>
  1254. <sql-statement>
  1255. -- Try (and fail) to add constraint due to invalid source columns
  1256. ALTER TABLE attmp3 add constraint attmpconstr foreign key(c) references attmp2 match full;
  1257. </sql-statement>
  1258. -stdin-:<main>: Error: Parse Sql
  1259. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1260. -- Try (and fail) to add constraint due to invalid source columns
  1261. ^
  1262. <sql-statement>
  1263. -- Try (and fail) to add constraint due to invalid destination columns explicitly given
  1264. ALTER TABLE attmp3 add constraint attmpconstr foreign key(a) references attmp2(b) match full;
  1265. </sql-statement>
  1266. -stdin-:<main>: Error: Parse Sql
  1267. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1268. -- Try (and fail) to add constraint due to invalid destination columns explicitly given
  1269. ^
  1270. <sql-statement>
  1271. -- Try (and fail) to add constraint due to invalid data
  1272. ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full;
  1273. </sql-statement>
  1274. -stdin-:<main>: Error: Parse Sql
  1275. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1276. -- Try (and fail) to add constraint due to invalid data
  1277. ^
  1278. <sql-statement>
  1279. -- Delete failing row
  1280. DELETE FROM attmp3 where a=5;
  1281. </sql-statement>
  1282. -stdin-:<main>: Fatal: Pre type annotation
  1283. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  1284. <sql-statement>
  1285. -- Try (and succeed)
  1286. ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full;
  1287. </sql-statement>
  1288. -stdin-:<main>: Error: Parse Sql
  1289. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1290. -- Try (and succeed)
  1291. ^
  1292. <sql-statement>
  1293. ALTER TABLE attmp3 drop constraint attmpconstr;
  1294. </sql-statement>
  1295. -stdin-:<main>: Error: Parse Sql
  1296. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1297. ALTER TABLE attmp3 drop constraint attmpconstr;
  1298. ^
  1299. <sql-statement>
  1300. INSERT INTO attmp3 values (5,50);
  1301. </sql-statement>
  1302. <sql-statement>
  1303. -- Try NOT VALID and then VALIDATE CONSTRAINT, but fails. Delete failure then re-validate
  1304. ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full NOT VALID;
  1305. </sql-statement>
  1306. -stdin-:<main>: Error: Parse Sql
  1307. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1308. -- Try NOT VALID and then VALIDATE CONSTRAINT, but fails. Delete failure then re-validate
  1309. ^
  1310. <sql-statement>
  1311. ALTER TABLE attmp3 validate constraint attmpconstr;
  1312. </sql-statement>
  1313. -stdin-:<main>: Error: Parse Sql
  1314. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1315. ALTER TABLE attmp3 validate constraint attmpconstr;
  1316. ^
  1317. <sql-statement>
  1318. -- Delete failing row
  1319. DELETE FROM attmp3 where a=5;
  1320. </sql-statement>
  1321. -stdin-:<main>: Fatal: Pre type annotation
  1322. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  1323. <sql-statement>
  1324. -- Try (and succeed) and repeat to show it works on already valid constraint
  1325. ALTER TABLE attmp3 validate constraint attmpconstr;
  1326. </sql-statement>
  1327. -stdin-:<main>: Error: Parse Sql
  1328. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1329. -- Try (and succeed) and repeat to show it works on already valid constraint
  1330. ^
  1331. <sql-statement>
  1332. ALTER TABLE attmp3 validate constraint attmpconstr;
  1333. </sql-statement>
  1334. -stdin-:<main>: Error: Parse Sql
  1335. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1336. ALTER TABLE attmp3 validate constraint attmpconstr;
  1337. ^
  1338. <sql-statement>
  1339. -- Try a non-verified CHECK constraint
  1340. ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10); -- fail
  1341. </sql-statement>
  1342. -stdin-:<main>: Error: Parse Sql
  1343. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1344. -- Try a non-verified CHECK constraint
  1345. ^
  1346. <sql-statement>
  1347. ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10) NOT VALID; -- succeeds
  1348. </sql-statement>
  1349. -stdin-:<main>: Error: Parse Sql
  1350. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1351. ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10) NOT VALID; -- succeeds
  1352. ^
  1353. <sql-statement>
  1354. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- fails
  1355. </sql-statement>
  1356. -stdin-:<main>: Error: Parse Sql
  1357. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1358. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- fails
  1359. ^
  1360. <sql-statement>
  1361. DELETE FROM attmp3 WHERE NOT b > 10;
  1362. </sql-statement>
  1363. -stdin-:<main>: Fatal: Pre type annotation
  1364. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  1365. <sql-statement>
  1366. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
  1367. </sql-statement>
  1368. -stdin-:<main>: Error: Parse Sql
  1369. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1370. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
  1371. ^
  1372. <sql-statement>
  1373. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
  1374. </sql-statement>
  1375. -stdin-:<main>: Error: Parse Sql
  1376. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1377. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
  1378. ^
  1379. <sql-statement>
  1380. -- Test inherited NOT VALID CHECK constraints
  1381. select * from attmp3;
  1382. </sql-statement>
  1383. <sql-statement>
  1384. CREATE TABLE attmp6 () INHERITS (attmp3);
  1385. </sql-statement>
  1386. -stdin-:<main>: Error: Parse Sql
  1387. -stdin-:<main>:1:1: Error: table inheritance not supported
  1388. CREATE TABLE attmp6 () INHERITS (attmp3);
  1389. ^
  1390. <sql-statement>
  1391. CREATE TABLE attmp7 () INHERITS (attmp3);
  1392. </sql-statement>
  1393. -stdin-:<main>: Error: Parse Sql
  1394. -stdin-:<main>:1:1: Error: table inheritance not supported
  1395. CREATE TABLE attmp7 () INHERITS (attmp3);
  1396. ^
  1397. <sql-statement>
  1398. INSERT INTO attmp6 VALUES (6, 30), (7, 16);
  1399. </sql-statement>
  1400. -stdin-:<main>: Fatal: Table metadata loading
  1401. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.attmp6
  1402. <sql-statement>
  1403. ALTER TABLE attmp3 ADD CONSTRAINT b_le_20 CHECK (b <= 20) NOT VALID;
  1404. </sql-statement>
  1405. -stdin-:<main>: Error: Parse Sql
  1406. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1407. ALTER TABLE attmp3 ADD CONSTRAINT b_le_20 CHECK (b <= 20) NOT VALID;
  1408. ^
  1409. <sql-statement>
  1410. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- fails
  1411. </sql-statement>
  1412. -stdin-:<main>: Error: Parse Sql
  1413. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1414. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- fails
  1415. ^
  1416. <sql-statement>
  1417. DELETE FROM attmp6 WHERE b > 20;
  1418. </sql-statement>
  1419. -stdin-:<main>: Fatal: Pre type annotation
  1420. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  1421. <sql-statement>
  1422. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- succeeds
  1423. </sql-statement>
  1424. -stdin-:<main>: Error: Parse Sql
  1425. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1426. ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- succeeds
  1427. ^
  1428. <sql-statement>
  1429. -- An already validated constraint must not be revalidated
  1430. CREATE FUNCTION boo(int) RETURNS int IMMUTABLE STRICT LANGUAGE plpgsql AS $$ BEGIN RAISE NOTICE 'boo: %', $1; RETURN $1; END; $$;
  1431. </sql-statement>
  1432. -stdin-:<main>: Error: Parse Sql
  1433. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  1434. -- An already validated constraint must not be revalidated
  1435. ^
  1436. <sql-statement>
  1437. INSERT INTO attmp7 VALUES (8, 18);
  1438. </sql-statement>
  1439. -stdin-:<main>: Fatal: Table metadata loading
  1440. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.attmp7
  1441. <sql-statement>
  1442. ALTER TABLE attmp7 ADD CONSTRAINT identity CHECK (b = boo(b));
  1443. </sql-statement>
  1444. -stdin-:<main>: Error: Parse Sql
  1445. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1446. ALTER TABLE attmp7 ADD CONSTRAINT identity CHECK (b = boo(b));
  1447. ^
  1448. <sql-statement>
  1449. ALTER TABLE attmp3 ADD CONSTRAINT IDENTITY check (b = boo(b)) NOT VALID;
  1450. </sql-statement>
  1451. -stdin-:<main>: Error: Parse Sql
  1452. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1453. ALTER TABLE attmp3 ADD CONSTRAINT IDENTITY check (b = boo(b)) NOT VALID;
  1454. ^
  1455. <sql-statement>
  1456. ALTER TABLE attmp3 VALIDATE CONSTRAINT identity;
  1457. </sql-statement>
  1458. -stdin-:<main>: Error: Parse Sql
  1459. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1460. ALTER TABLE attmp3 VALIDATE CONSTRAINT identity;
  1461. ^
  1462. <sql-statement>
  1463. -- A NO INHERIT constraint should not be looked for in children during VALIDATE CONSTRAINT
  1464. create table parent_noinh_convalid (a int);
  1465. </sql-statement>
  1466. <sql-statement>
  1467. create table child_noinh_convalid () inherits (parent_noinh_convalid);
  1468. </sql-statement>
  1469. -stdin-:<main>: Error: Parse Sql
  1470. -stdin-:<main>:1:1: Error: table inheritance not supported
  1471. create table child_noinh_convalid () inherits (parent_noinh_convalid);
  1472. ^
  1473. <sql-statement>
  1474. insert into parent_noinh_convalid values (1);
  1475. </sql-statement>
  1476. <sql-statement>
  1477. insert into child_noinh_convalid values (1);
  1478. </sql-statement>
  1479. -stdin-:<main>: Fatal: Table metadata loading
  1480. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.child_noinh_convalid
  1481. <sql-statement>
  1482. alter table parent_noinh_convalid add constraint check_a_is_2 check (a = 2) no inherit not valid;
  1483. </sql-statement>
  1484. -stdin-:<main>: Error: Parse Sql
  1485. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1486. alter table parent_noinh_convalid add constraint check_a_is_2 check (a = 2) no inherit not valid;
  1487. ^
  1488. <sql-statement>
  1489. -- fail, because of the row in parent
  1490. alter table parent_noinh_convalid validate constraint check_a_is_2;
  1491. </sql-statement>
  1492. -stdin-:<main>: Error: Parse Sql
  1493. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1494. -- fail, because of the row in parent
  1495. ^
  1496. <sql-statement>
  1497. delete from only parent_noinh_convalid;
  1498. </sql-statement>
  1499. -stdin-:<main>: Fatal: Pre type annotation
  1500. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  1501. <sql-statement>
  1502. -- ok (parent itself contains no violating rows)
  1503. alter table parent_noinh_convalid validate constraint check_a_is_2;
  1504. </sql-statement>
  1505. -stdin-:<main>: Error: Parse Sql
  1506. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1507. -- ok (parent itself contains no violating rows)
  1508. ^
  1509. <sql-statement>
  1510. select convalidated from pg_constraint where conrelid = 'parent_noinh_convalid'::regclass and conname = 'check_a_is_2';
  1511. </sql-statement>
  1512. <sql-statement>
  1513. -- cleanup
  1514. drop table parent_noinh_convalid, child_noinh_convalid;
  1515. </sql-statement>
  1516. <sql-statement>
  1517. -- Try (and fail) to create constraint from attmp5(a) to attmp4(a) - unique constraint on
  1518. -- attmp4 is a,b
  1519. ALTER TABLE attmp5 add constraint attmpconstr foreign key(a) references attmp4(a) match full;
  1520. </sql-statement>
  1521. -stdin-:<main>: Error: Parse Sql
  1522. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1523. -- Try (and fail) to create constraint from attmp5(a) to attmp4(a) - unique constraint on
  1524. ^
  1525. <sql-statement>
  1526. DROP TABLE attmp7;
  1527. </sql-statement>
  1528. <sql-statement>
  1529. DROP TABLE attmp6;
  1530. </sql-statement>
  1531. <sql-statement>
  1532. DROP TABLE attmp5;
  1533. </sql-statement>
  1534. <sql-statement>
  1535. DROP TABLE attmp4;
  1536. </sql-statement>
  1537. <sql-statement>
  1538. DROP TABLE attmp3;
  1539. </sql-statement>
  1540. <sql-statement>
  1541. DROP TABLE attmp2;
  1542. </sql-statement>
  1543. <sql-statement>
  1544. -- NOT VALID with plan invalidation -- ensure we don't use a constraint for
  1545. -- exclusion until validated
  1546. set constraint_exclusion TO 'partition';
  1547. </sql-statement>
  1548. -stdin-:<main>: Error: Parse Sql
  1549. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: constraint_exclusion
  1550. -- NOT VALID with plan invalidation -- ensure we don't use a constraint for
  1551. ^
  1552. <sql-statement>
  1553. create table nv_parent (d date, check (false) no inherit not valid);
  1554. </sql-statement>
  1555. -stdin-:<main>: Error: Parse Sql
  1556. -stdin-:<main>:1:1: Error: table constraint not supported
  1557. create table nv_parent (d date, check (false) no inherit not valid);
  1558. ^
  1559. <sql-statement>
  1560. -- not valid constraint added at creation time should automatically become valid
  1561. \d nv_parent
  1562. </sql-statement>
  1563. Metacommand \d nv_parent is not supported
  1564. <sql-statement>
  1565. create table nv_child_2010 () inherits (nv_parent);
  1566. </sql-statement>
  1567. -stdin-:<main>: Error: Parse Sql
  1568. -stdin-:<main>:1:1: Error: table inheritance not supported
  1569. create table nv_child_2010 () inherits (nv_parent);
  1570. ^
  1571. <sql-statement>
  1572. create table nv_child_2011 () inherits (nv_parent);
  1573. </sql-statement>
  1574. -stdin-:<main>: Error: Parse Sql
  1575. -stdin-:<main>:1:1: Error: table inheritance not supported
  1576. create table nv_child_2011 () inherits (nv_parent);
  1577. ^
  1578. <sql-statement>
  1579. alter table nv_child_2010 add check (d between '2010-01-01'::date and '2010-12-31'::date) not valid;
  1580. </sql-statement>
  1581. -stdin-:<main>: Error: Parse Sql
  1582. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1583. alter table nv_child_2010 add check (d between '2010-01-01'::date and '2010-12-31'::date) not valid;
  1584. ^
  1585. <sql-statement>
  1586. alter table nv_child_2011 add check (d between '2011-01-01'::date and '2011-12-31'::date) not valid;
  1587. </sql-statement>
  1588. -stdin-:<main>: Error: Parse Sql
  1589. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1590. alter table nv_child_2011 add check (d between '2011-01-01'::date and '2011-12-31'::date) not valid;
  1591. ^
  1592. <sql-statement>
  1593. explain (costs off) select * from nv_parent where d between '2011-08-01' and '2011-08-31';
  1594. </sql-statement>
  1595. -stdin-:<main>: Error: Parse Sql
  1596. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  1597. explain (costs off) select * from nv_parent where d between '2011-08-01' and '2011-08-31';
  1598. ^
  1599. <sql-statement>
  1600. create table nv_child_2009 (check (d between '2009-01-01'::date and '2009-12-31'::date)) inherits (nv_parent);
  1601. </sql-statement>
  1602. -stdin-:<main>: Error: Parse Sql
  1603. -stdin-:<main>:1:1: Error: table inheritance not supported
  1604. create table nv_child_2009 (check (d between '2009-01-01'::date and '2009-12-31'::date)) inherits (nv_parent);
  1605. ^
  1606. <sql-statement>
  1607. explain (costs off) select * from nv_parent where d between '2011-08-01'::date and '2011-08-31'::date;
  1608. </sql-statement>
  1609. -stdin-:<main>: Error: Parse Sql
  1610. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  1611. explain (costs off) select * from nv_parent where d between '2011-08-01'::date and '2011-08-31'::date;
  1612. ^
  1613. <sql-statement>
  1614. explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
  1615. </sql-statement>
  1616. -stdin-:<main>: Error: Parse Sql
  1617. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  1618. explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
  1619. ^
  1620. <sql-statement>
  1621. -- after validation, the constraint should be used
  1622. alter table nv_child_2011 VALIDATE CONSTRAINT nv_child_2011_d_check;
  1623. </sql-statement>
  1624. -stdin-:<main>: Error: Parse Sql
  1625. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1626. -- after validation, the constraint should be used
  1627. ^
  1628. <sql-statement>
  1629. explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
  1630. </sql-statement>
  1631. -stdin-:<main>: Error: Parse Sql
  1632. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  1633. explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
  1634. ^
  1635. <sql-statement>
  1636. -- add an inherited NOT VALID constraint
  1637. alter table nv_parent add check (d between '2001-01-01'::date and '2099-12-31'::date) not valid;
  1638. </sql-statement>
  1639. -stdin-:<main>: Error: Parse Sql
  1640. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1641. -- add an inherited NOT VALID constraint
  1642. ^
  1643. <sql-statement>
  1644. \d nv_child_2009
  1645. </sql-statement>
  1646. Metacommand \d nv_child_2009 is not supported
  1647. <sql-statement>
  1648. -- we leave nv_parent and children around to help test pg_dump logic
  1649. -- Foreign key adding test with mixed types
  1650. -- Note: these tables are TEMP to avoid name conflicts when this test
  1651. -- is run in parallel with foreign_key.sql.
  1652. CREATE TEMP TABLE PKTABLE (ptest1 int PRIMARY KEY);
  1653. </sql-statement>
  1654. <sql-statement>
  1655. INSERT INTO PKTABLE VALUES(42);
  1656. </sql-statement>
  1657. <sql-statement>
  1658. CREATE TEMP TABLE FKTABLE (ftest1 inet);
  1659. </sql-statement>
  1660. <sql-statement>
  1661. -- This next should fail, because int=inet does not exist
  1662. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
  1663. </sql-statement>
  1664. -stdin-:<main>: Error: Parse Sql
  1665. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1666. -- This next should fail, because int=inet does not exist
  1667. ^
  1668. <sql-statement>
  1669. -- This should also fail for the same reason, but here we
  1670. -- give the column name
  1671. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1);
  1672. </sql-statement>
  1673. -stdin-:<main>: Error: Parse Sql
  1674. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1675. -- This should also fail for the same reason, but here we
  1676. ^
  1677. <sql-statement>
  1678. DROP TABLE FKTABLE;
  1679. </sql-statement>
  1680. <sql-statement>
  1681. -- This should succeed, even though they are different types,
  1682. -- because int=int8 exists and is a member of the integer opfamily
  1683. CREATE TEMP TABLE FKTABLE (ftest1 int8);
  1684. </sql-statement>
  1685. <sql-statement>
  1686. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
  1687. </sql-statement>
  1688. -stdin-:<main>: Error: Parse Sql
  1689. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1690. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
  1691. ^
  1692. <sql-statement>
  1693. -- Check it actually works
  1694. INSERT INTO FKTABLE VALUES(42); -- should succeed
  1695. </sql-statement>
  1696. <sql-statement>
  1697. INSERT INTO FKTABLE VALUES(43); -- should fail
  1698. </sql-statement>
  1699. <sql-statement>
  1700. DROP TABLE FKTABLE;
  1701. </sql-statement>
  1702. <sql-statement>
  1703. -- This should fail, because we'd have to cast numeric to int which is
  1704. -- not an implicit coercion (or use numeric=numeric, but that's not part
  1705. -- of the integer opfamily)
  1706. CREATE TEMP TABLE FKTABLE (ftest1 numeric);
  1707. </sql-statement>
  1708. <sql-statement>
  1709. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
  1710. </sql-statement>
  1711. -stdin-:<main>: Error: Parse Sql
  1712. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1713. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
  1714. ^
  1715. <sql-statement>
  1716. DROP TABLE FKTABLE;
  1717. </sql-statement>
  1718. <sql-statement>
  1719. DROP TABLE PKTABLE;
  1720. </sql-statement>
  1721. <sql-statement>
  1722. -- On the other hand, this should work because int implicitly promotes to
  1723. -- numeric, and we allow promotion on the FK side
  1724. CREATE TEMP TABLE PKTABLE (ptest1 numeric PRIMARY KEY);
  1725. </sql-statement>
  1726. <sql-statement>
  1727. INSERT INTO PKTABLE VALUES(42);
  1728. </sql-statement>
  1729. <sql-statement>
  1730. CREATE TEMP TABLE FKTABLE (ftest1 int);
  1731. </sql-statement>
  1732. <sql-statement>
  1733. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
  1734. </sql-statement>
  1735. -stdin-:<main>: Error: Parse Sql
  1736. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1737. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
  1738. ^
  1739. <sql-statement>
  1740. -- Check it actually works
  1741. INSERT INTO FKTABLE VALUES(42); -- should succeed
  1742. </sql-statement>
  1743. <sql-statement>
  1744. INSERT INTO FKTABLE VALUES(43); -- should fail
  1745. </sql-statement>
  1746. <sql-statement>
  1747. DROP TABLE FKTABLE;
  1748. </sql-statement>
  1749. <sql-statement>
  1750. DROP TABLE PKTABLE;
  1751. </sql-statement>
  1752. <sql-statement>
  1753. CREATE TEMP TABLE PKTABLE (ptest1 int, ptest2 inet,
  1754. PRIMARY KEY(ptest1, ptest2));
  1755. </sql-statement>
  1756. <sql-statement>
  1757. -- This should fail, because we just chose really odd types
  1758. CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
  1759. </sql-statement>
  1760. <sql-statement>
  1761. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable;
  1762. </sql-statement>
  1763. -stdin-:<main>: Error: Parse Sql
  1764. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1765. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable;
  1766. ^
  1767. <sql-statement>
  1768. DROP TABLE FKTABLE;
  1769. </sql-statement>
  1770. <sql-statement>
  1771. -- Again, so should this...
  1772. CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
  1773. </sql-statement>
  1774. <sql-statement>
  1775. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
  1776. references pktable(ptest1, ptest2);
  1777. </sql-statement>
  1778. -stdin-:<main>: Error: Parse Sql
  1779. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1780. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
  1781. ^
  1782. <sql-statement>
  1783. DROP TABLE FKTABLE;
  1784. </sql-statement>
  1785. <sql-statement>
  1786. -- This fails because we mixed up the column ordering
  1787. CREATE TEMP TABLE FKTABLE (ftest1 int, ftest2 inet);
  1788. </sql-statement>
  1789. <sql-statement>
  1790. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
  1791. references pktable(ptest2, ptest1);
  1792. </sql-statement>
  1793. -stdin-:<main>: Error: Parse Sql
  1794. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1795. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
  1796. ^
  1797. <sql-statement>
  1798. -- As does this...
  1799. ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest2, ftest1)
  1800. references pktable(ptest1, ptest2);
  1801. </sql-statement>
  1802. -stdin-:<main>: Error: Parse Sql
  1803. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1804. -- As does this...
  1805. ^
  1806. <sql-statement>
  1807. DROP TABLE FKTABLE;
  1808. </sql-statement>
  1809. <sql-statement>
  1810. DROP TABLE PKTABLE;
  1811. </sql-statement>
  1812. <sql-statement>
  1813. -- Test that ALTER CONSTRAINT updates trigger deferrability properly
  1814. CREATE TEMP TABLE PKTABLE (ptest1 int primary key);
  1815. </sql-statement>
  1816. <sql-statement>
  1817. CREATE TEMP TABLE FKTABLE (ftest1 int);
  1818. </sql-statement>
  1819. <sql-statement>
  1820. ALTER TABLE FKTABLE ADD CONSTRAINT fknd FOREIGN KEY(ftest1) REFERENCES pktable
  1821. ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
  1822. </sql-statement>
  1823. -stdin-:<main>: Error: Parse Sql
  1824. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1825. ALTER TABLE FKTABLE ADD CONSTRAINT fknd FOREIGN KEY(ftest1) REFERENCES pktable
  1826. ^
  1827. <sql-statement>
  1828. ALTER TABLE FKTABLE ADD CONSTRAINT fkdd FOREIGN KEY(ftest1) REFERENCES pktable
  1829. ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED;
  1830. </sql-statement>
  1831. -stdin-:<main>: Error: Parse Sql
  1832. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1833. ALTER TABLE FKTABLE ADD CONSTRAINT fkdd FOREIGN KEY(ftest1) REFERENCES pktable
  1834. ^
  1835. <sql-statement>
  1836. ALTER TABLE FKTABLE ADD CONSTRAINT fkdi FOREIGN KEY(ftest1) REFERENCES pktable
  1837. ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY IMMEDIATE;
  1838. </sql-statement>
  1839. -stdin-:<main>: Error: Parse Sql
  1840. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1841. ALTER TABLE FKTABLE ADD CONSTRAINT fkdi FOREIGN KEY(ftest1) REFERENCES pktable
  1842. ^
  1843. <sql-statement>
  1844. ALTER TABLE FKTABLE ADD CONSTRAINT fknd2 FOREIGN KEY(ftest1) REFERENCES pktable
  1845. ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED;
  1846. </sql-statement>
  1847. -stdin-:<main>: Error: Parse Sql
  1848. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1849. ALTER TABLE FKTABLE ADD CONSTRAINT fknd2 FOREIGN KEY(ftest1) REFERENCES pktable
  1850. ^
  1851. <sql-statement>
  1852. ALTER TABLE FKTABLE ALTER CONSTRAINT fknd2 NOT DEFERRABLE;
  1853. </sql-statement>
  1854. -stdin-:<main>: Error: Parse Sql
  1855. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1856. ALTER TABLE FKTABLE ALTER CONSTRAINT fknd2 NOT DEFERRABLE;
  1857. ^
  1858. <sql-statement>
  1859. ALTER TABLE FKTABLE ADD CONSTRAINT fkdd2 FOREIGN KEY(ftest1) REFERENCES pktable
  1860. ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
  1861. </sql-statement>
  1862. -stdin-:<main>: Error: Parse Sql
  1863. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1864. ALTER TABLE FKTABLE ADD CONSTRAINT fkdd2 FOREIGN KEY(ftest1) REFERENCES pktable
  1865. ^
  1866. <sql-statement>
  1867. ALTER TABLE FKTABLE ALTER CONSTRAINT fkdd2 DEFERRABLE INITIALLY DEFERRED;
  1868. </sql-statement>
  1869. -stdin-:<main>: Error: Parse Sql
  1870. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1871. ALTER TABLE FKTABLE ALTER CONSTRAINT fkdd2 DEFERRABLE INITIALLY DEFERRED;
  1872. ^
  1873. <sql-statement>
  1874. ALTER TABLE FKTABLE ADD CONSTRAINT fkdi2 FOREIGN KEY(ftest1) REFERENCES pktable
  1875. ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
  1876. </sql-statement>
  1877. -stdin-:<main>: Error: Parse Sql
  1878. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1879. ALTER TABLE FKTABLE ADD CONSTRAINT fkdi2 FOREIGN KEY(ftest1) REFERENCES pktable
  1880. ^
  1881. <sql-statement>
  1882. ALTER TABLE FKTABLE ALTER CONSTRAINT fkdi2 DEFERRABLE INITIALLY IMMEDIATE;
  1883. </sql-statement>
  1884. -stdin-:<main>: Error: Parse Sql
  1885. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1886. ALTER TABLE FKTABLE ALTER CONSTRAINT fkdi2 DEFERRABLE INITIALLY IMMEDIATE;
  1887. ^
  1888. <sql-statement>
  1889. SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
  1890. FROM pg_trigger JOIN pg_constraint con ON con.oid = tgconstraint
  1891. WHERE tgrelid = 'pktable'::regclass
  1892. ORDER BY 1,2,3;
  1893. </sql-statement>
  1894. -stdin-:<main>: Error: Type annotation
  1895. -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: Sort
  1896. SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
  1897. ^
  1898. -stdin-:<main>:1:1: Error: Expected comparable type, but got: Tuple<pgname,pgregproc,pgint2>
  1899. SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
  1900. ^
  1901. <sql-statement>
  1902. SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
  1903. FROM pg_trigger JOIN pg_constraint con ON con.oid = tgconstraint
  1904. WHERE tgrelid = 'fktable'::regclass
  1905. ORDER BY 1,2,3;
  1906. </sql-statement>
  1907. -stdin-:<main>: Error: Type annotation
  1908. -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: Sort
  1909. SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
  1910. ^
  1911. -stdin-:<main>:1:1: Error: Expected comparable type, but got: Tuple<pgname,pgregproc,pgint2>
  1912. SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
  1913. ^
  1914. <sql-statement>
  1915. -- temp tables should go away by themselves, need not drop them.
  1916. -- test check constraint adding
  1917. create table atacc1 ( test int );
  1918. </sql-statement>
  1919. <sql-statement>
  1920. -- add a check constraint
  1921. alter table atacc1 add constraint atacc_test1 check (test>3);
  1922. </sql-statement>
  1923. -stdin-:<main>: Error: Parse Sql
  1924. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1925. -- add a check constraint
  1926. ^
  1927. <sql-statement>
  1928. -- should fail
  1929. insert into atacc1 (test) values (2);
  1930. </sql-statement>
  1931. <sql-statement>
  1932. -- should succeed
  1933. insert into atacc1 (test) values (4);
  1934. </sql-statement>
  1935. <sql-statement>
  1936. drop table atacc1;
  1937. </sql-statement>
  1938. <sql-statement>
  1939. -- let's do one where the check fails when added
  1940. create table atacc1 ( test int );
  1941. </sql-statement>
  1942. <sql-statement>
  1943. -- insert a soon to be failing row
  1944. insert into atacc1 (test) values (2);
  1945. </sql-statement>
  1946. <sql-statement>
  1947. -- add a check constraint (fails)
  1948. alter table atacc1 add constraint atacc_test1 check (test>3);
  1949. </sql-statement>
  1950. -stdin-:<main>: Error: Parse Sql
  1951. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1952. -- add a check constraint (fails)
  1953. ^
  1954. <sql-statement>
  1955. insert into atacc1 (test) values (4);
  1956. </sql-statement>
  1957. <sql-statement>
  1958. drop table atacc1;
  1959. </sql-statement>
  1960. <sql-statement>
  1961. -- let's do one where the check fails because the column doesn't exist
  1962. create table atacc1 ( test int );
  1963. </sql-statement>
  1964. <sql-statement>
  1965. -- add a check constraint (fails)
  1966. alter table atacc1 add constraint atacc_test1 check (test1>3);
  1967. </sql-statement>
  1968. -stdin-:<main>: Error: Parse Sql
  1969. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1970. -- add a check constraint (fails)
  1971. ^
  1972. <sql-statement>
  1973. drop table atacc1;
  1974. </sql-statement>
  1975. <sql-statement>
  1976. -- something a little more complicated
  1977. create table atacc1 ( test int, test2 int, test3 int);
  1978. </sql-statement>
  1979. <sql-statement>
  1980. -- add a check constraint (fails)
  1981. alter table atacc1 add constraint atacc_test1 check (test+test2<test3*4);
  1982. </sql-statement>
  1983. -stdin-:<main>: Error: Parse Sql
  1984. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  1985. -- add a check constraint (fails)
  1986. ^
  1987. <sql-statement>
  1988. -- should fail
  1989. insert into atacc1 (test,test2,test3) values (4,4,2);
  1990. </sql-statement>
  1991. <sql-statement>
  1992. -- should succeed
  1993. insert into atacc1 (test,test2,test3) values (4,4,5);
  1994. </sql-statement>
  1995. <sql-statement>
  1996. drop table atacc1;
  1997. </sql-statement>
  1998. <sql-statement>
  1999. -- lets do some naming tests
  2000. create table atacc1 (test int check (test>3), test2 int);
  2001. </sql-statement>
  2002. -stdin-:<main>: Error: Parse Sql
  2003. -stdin-:<main>:1:1: Error: column constraint not supported
  2004. -- lets do some naming tests
  2005. ^
  2006. <sql-statement>
  2007. alter table atacc1 add check (test2>test);
  2008. </sql-statement>
  2009. -stdin-:<main>: Error: Parse Sql
  2010. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2011. alter table atacc1 add check (test2>test);
  2012. ^
  2013. <sql-statement>
  2014. -- should fail for $2
  2015. insert into atacc1 (test2, test) values (3, 4);
  2016. </sql-statement>
  2017. -stdin-:<main>: Fatal: Table metadata loading
  2018. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.atacc1
  2019. <sql-statement>
  2020. drop table atacc1;
  2021. </sql-statement>
  2022. <sql-statement>
  2023. -- inheritance related tests
  2024. create table atacc1 (test int);
  2025. </sql-statement>
  2026. <sql-statement>
  2027. create table atacc2 (test2 int);
  2028. </sql-statement>
  2029. <sql-statement>
  2030. create table atacc3 (test3 int) inherits (atacc1, atacc2);
  2031. </sql-statement>
  2032. -stdin-:<main>: Error: Parse Sql
  2033. -stdin-:<main>:1:1: Error: table inheritance not supported
  2034. create table atacc3 (test3 int) inherits (atacc1, atacc2);
  2035. ^
  2036. <sql-statement>
  2037. alter table atacc2 add constraint foo check (test2>0);
  2038. </sql-statement>
  2039. -stdin-:<main>: Error: Parse Sql
  2040. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2041. alter table atacc2 add constraint foo check (test2>0);
  2042. ^
  2043. <sql-statement>
  2044. -- fail and then succeed on atacc2
  2045. insert into atacc2 (test2) values (-3);
  2046. </sql-statement>
  2047. <sql-statement>
  2048. insert into atacc2 (test2) values (3);
  2049. </sql-statement>
  2050. <sql-statement>
  2051. -- fail and then succeed on atacc3
  2052. insert into atacc3 (test2) values (-3);
  2053. </sql-statement>
  2054. -stdin-:<main>: Fatal: Table metadata loading
  2055. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.atacc3
  2056. <sql-statement>
  2057. insert into atacc3 (test2) values (3);
  2058. </sql-statement>
  2059. -stdin-:<main>: Fatal: Table metadata loading
  2060. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.atacc3
  2061. <sql-statement>
  2062. drop table atacc3;
  2063. </sql-statement>
  2064. <sql-statement>
  2065. drop table atacc2;
  2066. </sql-statement>
  2067. <sql-statement>
  2068. drop table atacc1;
  2069. </sql-statement>
  2070. <sql-statement>
  2071. -- same things with one created with INHERIT
  2072. create table atacc1 (test int);
  2073. </sql-statement>
  2074. <sql-statement>
  2075. create table atacc2 (test2 int);
  2076. </sql-statement>
  2077. <sql-statement>
  2078. create table atacc3 (test3 int) inherits (atacc1, atacc2);
  2079. </sql-statement>
  2080. -stdin-:<main>: Error: Parse Sql
  2081. -stdin-:<main>:1:1: Error: table inheritance not supported
  2082. create table atacc3 (test3 int) inherits (atacc1, atacc2);
  2083. ^
  2084. <sql-statement>
  2085. alter table atacc3 no inherit atacc2;
  2086. </sql-statement>
  2087. -stdin-:<main>: Error: Parse Sql
  2088. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2089. alter table atacc3 no inherit atacc2;
  2090. ^
  2091. <sql-statement>
  2092. -- fail
  2093. alter table atacc3 no inherit atacc2;
  2094. </sql-statement>
  2095. -stdin-:<main>: Error: Parse Sql
  2096. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2097. -- fail
  2098. ^
  2099. <sql-statement>
  2100. -- make sure it really isn't a child
  2101. insert into atacc3 (test2) values (3);
  2102. </sql-statement>
  2103. -stdin-:<main>: Fatal: Table metadata loading
  2104. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.atacc3
  2105. <sql-statement>
  2106. select test2 from atacc2;
  2107. </sql-statement>
  2108. <sql-statement>
  2109. -- fail due to missing constraint
  2110. alter table atacc2 add constraint foo check (test2>0);
  2111. </sql-statement>
  2112. -stdin-:<main>: Error: Parse Sql
  2113. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2114. -- fail due to missing constraint
  2115. ^
  2116. <sql-statement>
  2117. alter table atacc3 inherit atacc2;
  2118. </sql-statement>
  2119. -stdin-:<main>: Error: Parse Sql
  2120. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2121. alter table atacc3 inherit atacc2;
  2122. ^
  2123. <sql-statement>
  2124. -- fail due to missing column
  2125. alter table atacc3 rename test2 to testx;
  2126. </sql-statement>
  2127. -stdin-:<main>: Error: Parse Sql
  2128. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
  2129. -- fail due to missing column
  2130. ^
  2131. <sql-statement>
  2132. alter table atacc3 inherit atacc2;
  2133. </sql-statement>
  2134. -stdin-:<main>: Error: Parse Sql
  2135. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2136. alter table atacc3 inherit atacc2;
  2137. ^
  2138. <sql-statement>
  2139. -- fail due to mismatched data type
  2140. alter table atacc3 add test2 bool;
  2141. </sql-statement>
  2142. -stdin-:<main>: Error: Parse Sql
  2143. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2144. -- fail due to mismatched data type
  2145. ^
  2146. <sql-statement>
  2147. alter table atacc3 inherit atacc2;
  2148. </sql-statement>
  2149. -stdin-:<main>: Error: Parse Sql
  2150. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2151. alter table atacc3 inherit atacc2;
  2152. ^
  2153. <sql-statement>
  2154. alter table atacc3 drop test2;
  2155. </sql-statement>
  2156. -stdin-:<main>: Error: Parse Sql
  2157. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2158. alter table atacc3 drop test2;
  2159. ^
  2160. <sql-statement>
  2161. -- succeed
  2162. alter table atacc3 add test2 int;
  2163. </sql-statement>
  2164. -stdin-:<main>: Error: Parse Sql
  2165. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2166. -- succeed
  2167. ^
  2168. <sql-statement>
  2169. update atacc3 set test2 = 4 where test2 is null;
  2170. </sql-statement>
  2171. -stdin-:<main>: Fatal: Pre type annotation
  2172. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  2173. <sql-statement>
  2174. alter table atacc3 add constraint foo check (test2>0);
  2175. </sql-statement>
  2176. -stdin-:<main>: Error: Parse Sql
  2177. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2178. alter table atacc3 add constraint foo check (test2>0);
  2179. ^
  2180. <sql-statement>
  2181. alter table atacc3 inherit atacc2;
  2182. </sql-statement>
  2183. -stdin-:<main>: Error: Parse Sql
  2184. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2185. alter table atacc3 inherit atacc2;
  2186. ^
  2187. <sql-statement>
  2188. -- fail due to duplicates and circular inheritance
  2189. alter table atacc3 inherit atacc2;
  2190. </sql-statement>
  2191. -stdin-:<main>: Error: Parse Sql
  2192. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2193. -- fail due to duplicates and circular inheritance
  2194. ^
  2195. <sql-statement>
  2196. alter table atacc2 inherit atacc3;
  2197. </sql-statement>
  2198. -stdin-:<main>: Error: Parse Sql
  2199. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2200. alter table atacc2 inherit atacc3;
  2201. ^
  2202. <sql-statement>
  2203. alter table atacc2 inherit atacc2;
  2204. </sql-statement>
  2205. -stdin-:<main>: Error: Parse Sql
  2206. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2207. alter table atacc2 inherit atacc2;
  2208. ^
  2209. <sql-statement>
  2210. -- test that we really are a child now (should see 4 not 3 and cascade should go through)
  2211. select test2 from atacc2;
  2212. </sql-statement>
  2213. <sql-statement>
  2214. drop table atacc2 cascade;
  2215. </sql-statement>
  2216. -stdin-:<main>: Error: Parse Sql
  2217. -stdin-:<main>:1:1: Error: CASCADE is not implemented
  2218. drop table atacc2 cascade;
  2219. ^
  2220. <sql-statement>
  2221. drop table atacc1;
  2222. </sql-statement>
  2223. <sql-statement>
  2224. -- adding only to a parent is allowed as of 9.2
  2225. create table atacc1 (test int);
  2226. </sql-statement>
  2227. <sql-statement>
  2228. create table atacc2 (test2 int) inherits (atacc1);
  2229. </sql-statement>
  2230. -stdin-:<main>: Error: Parse Sql
  2231. -stdin-:<main>:1:1: Error: table inheritance not supported
  2232. create table atacc2 (test2 int) inherits (atacc1);
  2233. ^
  2234. <sql-statement>
  2235. -- ok:
  2236. alter table atacc1 add constraint foo check (test>0) no inherit;
  2237. </sql-statement>
  2238. -stdin-:<main>: Error: Parse Sql
  2239. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2240. -- ok:
  2241. ^
  2242. <sql-statement>
  2243. -- check constraint is not there on child
  2244. insert into atacc2 (test) values (-3);
  2245. </sql-statement>
  2246. <sql-statement>
  2247. -- check constraint is there on parent
  2248. insert into atacc1 (test) values (-3);
  2249. </sql-statement>
  2250. <sql-statement>
  2251. insert into atacc1 (test) values (3);
  2252. </sql-statement>
  2253. <sql-statement>
  2254. -- fail, violating row:
  2255. alter table atacc2 add constraint foo check (test>0) no inherit;
  2256. </sql-statement>
  2257. -stdin-:<main>: Error: Parse Sql
  2258. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2259. -- fail, violating row:
  2260. ^
  2261. <sql-statement>
  2262. drop table atacc2;
  2263. </sql-statement>
  2264. <sql-statement>
  2265. drop table atacc1;
  2266. </sql-statement>
  2267. <sql-statement>
  2268. -- test unique constraint adding
  2269. create table atacc1 ( test int ) ;
  2270. </sql-statement>
  2271. <sql-statement>
  2272. -- add a unique constraint
  2273. alter table atacc1 add constraint atacc_test1 unique (test);
  2274. </sql-statement>
  2275. -stdin-:<main>: Error: Parse Sql
  2276. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2277. -- add a unique constraint
  2278. ^
  2279. <sql-statement>
  2280. -- insert first value
  2281. insert into atacc1 (test) values (2);
  2282. </sql-statement>
  2283. <sql-statement>
  2284. -- should fail
  2285. insert into atacc1 (test) values (2);
  2286. </sql-statement>
  2287. <sql-statement>
  2288. -- should succeed
  2289. insert into atacc1 (test) values (4);
  2290. </sql-statement>
  2291. <sql-statement>
  2292. -- try to create duplicates via alter table using - should fail
  2293. alter table atacc1 alter column test type integer using 0;
  2294. </sql-statement>
  2295. -stdin-:<main>: Error: Parse Sql
  2296. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2297. -- try to create duplicates via alter table using - should fail
  2298. ^
  2299. <sql-statement>
  2300. drop table atacc1;
  2301. </sql-statement>
  2302. <sql-statement>
  2303. -- let's do one where the unique constraint fails when added
  2304. create table atacc1 ( test int );
  2305. </sql-statement>
  2306. <sql-statement>
  2307. -- insert soon to be failing rows
  2308. insert into atacc1 (test) values (2);
  2309. </sql-statement>
  2310. <sql-statement>
  2311. insert into atacc1 (test) values (2);
  2312. </sql-statement>
  2313. <sql-statement>
  2314. -- add a unique constraint (fails)
  2315. alter table atacc1 add constraint atacc_test1 unique (test);
  2316. </sql-statement>
  2317. -stdin-:<main>: Error: Parse Sql
  2318. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2319. -- add a unique constraint (fails)
  2320. ^
  2321. <sql-statement>
  2322. insert into atacc1 (test) values (3);
  2323. </sql-statement>
  2324. <sql-statement>
  2325. drop table atacc1;
  2326. </sql-statement>
  2327. <sql-statement>
  2328. -- let's do one where the unique constraint fails
  2329. -- because the column doesn't exist
  2330. create table atacc1 ( test int );
  2331. </sql-statement>
  2332. <sql-statement>
  2333. -- add a unique constraint (fails)
  2334. alter table atacc1 add constraint atacc_test1 unique (test1);
  2335. </sql-statement>
  2336. -stdin-:<main>: Error: Parse Sql
  2337. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2338. -- add a unique constraint (fails)
  2339. ^
  2340. <sql-statement>
  2341. drop table atacc1;
  2342. </sql-statement>
  2343. <sql-statement>
  2344. -- something a little more complicated
  2345. create table atacc1 ( test int, test2 int);
  2346. </sql-statement>
  2347. <sql-statement>
  2348. -- add a unique constraint
  2349. alter table atacc1 add constraint atacc_test1 unique (test, test2);
  2350. </sql-statement>
  2351. -stdin-:<main>: Error: Parse Sql
  2352. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2353. -- add a unique constraint
  2354. ^
  2355. <sql-statement>
  2356. -- insert initial value
  2357. insert into atacc1 (test,test2) values (4,4);
  2358. </sql-statement>
  2359. <sql-statement>
  2360. -- should fail
  2361. insert into atacc1 (test,test2) values (4,4);
  2362. </sql-statement>
  2363. <sql-statement>
  2364. -- should all succeed
  2365. insert into atacc1 (test,test2) values (4,5);
  2366. </sql-statement>
  2367. <sql-statement>
  2368. insert into atacc1 (test,test2) values (5,4);
  2369. </sql-statement>
  2370. <sql-statement>
  2371. insert into atacc1 (test,test2) values (5,5);
  2372. </sql-statement>
  2373. <sql-statement>
  2374. drop table atacc1;
  2375. </sql-statement>
  2376. <sql-statement>
  2377. -- lets do some naming tests
  2378. create table atacc1 (test int, test2 int, unique(test));
  2379. </sql-statement>
  2380. <sql-statement>
  2381. alter table atacc1 add unique (test2);
  2382. </sql-statement>
  2383. -stdin-:<main>: Error: Parse Sql
  2384. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2385. alter table atacc1 add unique (test2);
  2386. ^
  2387. <sql-statement>
  2388. -- should fail for @@ second one @@
  2389. insert into atacc1 (test2, test) values (3, 3);
  2390. </sql-statement>
  2391. <sql-statement>
  2392. insert into atacc1 (test2, test) values (2, 3);
  2393. </sql-statement>
  2394. <sql-statement>
  2395. drop table atacc1;
  2396. </sql-statement>
  2397. <sql-statement>
  2398. -- test primary key constraint adding
  2399. create table atacc1 ( id serial, test int) ;
  2400. </sql-statement>
  2401. <sql-statement>
  2402. -- add a primary key constraint
  2403. alter table atacc1 add constraint atacc_test1 primary key (test);
  2404. </sql-statement>
  2405. -stdin-:<main>: Error: Parse Sql
  2406. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2407. -- add a primary key constraint
  2408. ^
  2409. <sql-statement>
  2410. -- insert first value
  2411. insert into atacc1 (test) values (2);
  2412. </sql-statement>
  2413. <sql-statement>
  2414. -- should fail
  2415. insert into atacc1 (test) values (2);
  2416. </sql-statement>
  2417. <sql-statement>
  2418. -- should succeed
  2419. insert into atacc1 (test) values (4);
  2420. </sql-statement>
  2421. <sql-statement>
  2422. -- inserting NULL should fail
  2423. insert into atacc1 (test) values(NULL);
  2424. </sql-statement>
  2425. <sql-statement>
  2426. -- try adding a second primary key (should fail)
  2427. alter table atacc1 add constraint atacc_oid1 primary key(id);
  2428. </sql-statement>
  2429. -stdin-:<main>: Error: Parse Sql
  2430. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2431. -- try adding a second primary key (should fail)
  2432. ^
  2433. <sql-statement>
  2434. -- drop first primary key constraint
  2435. alter table atacc1 drop constraint atacc_test1 restrict;
  2436. </sql-statement>
  2437. -stdin-:<main>: Error: Parse Sql
  2438. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2439. -- drop first primary key constraint
  2440. ^
  2441. <sql-statement>
  2442. -- try adding a primary key on oid (should succeed)
  2443. alter table atacc1 add constraint atacc_oid1 primary key(id);
  2444. </sql-statement>
  2445. -stdin-:<main>: Error: Parse Sql
  2446. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2447. -- try adding a primary key on oid (should succeed)
  2448. ^
  2449. <sql-statement>
  2450. drop table atacc1;
  2451. </sql-statement>
  2452. <sql-statement>
  2453. -- let's do one where the primary key constraint fails when added
  2454. create table atacc1 ( test int );
  2455. </sql-statement>
  2456. <sql-statement>
  2457. -- insert soon to be failing rows
  2458. insert into atacc1 (test) values (2);
  2459. </sql-statement>
  2460. <sql-statement>
  2461. insert into atacc1 (test) values (2);
  2462. </sql-statement>
  2463. <sql-statement>
  2464. -- add a primary key (fails)
  2465. alter table atacc1 add constraint atacc_test1 primary key (test);
  2466. </sql-statement>
  2467. -stdin-:<main>: Error: Parse Sql
  2468. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2469. -- add a primary key (fails)
  2470. ^
  2471. <sql-statement>
  2472. insert into atacc1 (test) values (3);
  2473. </sql-statement>
  2474. <sql-statement>
  2475. drop table atacc1;
  2476. </sql-statement>
  2477. <sql-statement>
  2478. -- let's do another one where the primary key constraint fails when added
  2479. create table atacc1 ( test int );
  2480. </sql-statement>
  2481. <sql-statement>
  2482. -- insert soon to be failing row
  2483. insert into atacc1 (test) values (NULL);
  2484. </sql-statement>
  2485. <sql-statement>
  2486. -- add a primary key (fails)
  2487. alter table atacc1 add constraint atacc_test1 primary key (test);
  2488. </sql-statement>
  2489. -stdin-:<main>: Error: Parse Sql
  2490. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2491. -- add a primary key (fails)
  2492. ^
  2493. <sql-statement>
  2494. insert into atacc1 (test) values (3);
  2495. </sql-statement>
  2496. <sql-statement>
  2497. drop table atacc1;
  2498. </sql-statement>
  2499. <sql-statement>
  2500. -- let's do one where the primary key constraint fails
  2501. -- because the column doesn't exist
  2502. create table atacc1 ( test int );
  2503. </sql-statement>
  2504. <sql-statement>
  2505. -- add a primary key constraint (fails)
  2506. alter table atacc1 add constraint atacc_test1 primary key (test1);
  2507. </sql-statement>
  2508. -stdin-:<main>: Error: Parse Sql
  2509. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2510. -- add a primary key constraint (fails)
  2511. ^
  2512. <sql-statement>
  2513. drop table atacc1;
  2514. </sql-statement>
  2515. <sql-statement>
  2516. -- adding a new column as primary key to a non-empty table.
  2517. -- should fail unless the column has a non-null default value.
  2518. create table atacc1 ( test int );
  2519. </sql-statement>
  2520. <sql-statement>
  2521. insert into atacc1 (test) values (0);
  2522. </sql-statement>
  2523. <sql-statement>
  2524. -- add a primary key column without a default (fails).
  2525. alter table atacc1 add column test2 int primary key;
  2526. </sql-statement>
  2527. -stdin-:<main>: Error: Parse Sql
  2528. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2529. -- add a primary key column without a default (fails).
  2530. ^
  2531. <sql-statement>
  2532. -- now add a primary key column with a default (succeeds).
  2533. alter table atacc1 add column test2 int default 0 primary key;
  2534. </sql-statement>
  2535. -stdin-:<main>: Error: Parse Sql
  2536. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2537. -- now add a primary key column with a default (succeeds).
  2538. ^
  2539. <sql-statement>
  2540. drop table atacc1;
  2541. </sql-statement>
  2542. <sql-statement>
  2543. -- this combination used to have order-of-execution problems (bug #15580)
  2544. create table atacc1 (a int);
  2545. </sql-statement>
  2546. <sql-statement>
  2547. insert into atacc1 values(1);
  2548. </sql-statement>
  2549. <sql-statement>
  2550. alter table atacc1
  2551. add column b float8 not null default random(),
  2552. add primary key(a);
  2553. </sql-statement>
  2554. -stdin-:<main>: Error: Parse Sql
  2555. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2556. alter table atacc1
  2557. ^
  2558. <sql-statement>
  2559. drop table atacc1;
  2560. </sql-statement>
  2561. <sql-statement>
  2562. -- additionally, we've seen issues with foreign key validation not being
  2563. -- properly delayed until after a table rewrite. Check that works ok.
  2564. create table atacc1 (a int primary key);
  2565. </sql-statement>
  2566. <sql-statement>
  2567. alter table atacc1 add constraint atacc1_fkey foreign key (a) references atacc1 (a) not valid;
  2568. </sql-statement>
  2569. -stdin-:<main>: Error: Parse Sql
  2570. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2571. alter table atacc1 add constraint atacc1_fkey foreign key (a) references atacc1 (a) not valid;
  2572. ^
  2573. <sql-statement>
  2574. alter table atacc1 validate constraint atacc1_fkey, alter a type bigint;
  2575. </sql-statement>
  2576. -stdin-:<main>: Error: Parse Sql
  2577. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2578. alter table atacc1 validate constraint atacc1_fkey, alter a type bigint;
  2579. ^
  2580. <sql-statement>
  2581. drop table atacc1;
  2582. </sql-statement>
  2583. <sql-statement>
  2584. -- we've also seen issues with check constraints being validated at the wrong
  2585. -- time when there's a pending table rewrite.
  2586. create table atacc1 (a bigint, b int);
  2587. </sql-statement>
  2588. <sql-statement>
  2589. insert into atacc1 values(1,1);
  2590. </sql-statement>
  2591. <sql-statement>
  2592. alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
  2593. </sql-statement>
  2594. -stdin-:<main>: Error: Parse Sql
  2595. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2596. alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
  2597. ^
  2598. <sql-statement>
  2599. alter table atacc1 validate constraint atacc1_chk, alter a type int;
  2600. </sql-statement>
  2601. -stdin-:<main>: Error: Parse Sql
  2602. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2603. alter table atacc1 validate constraint atacc1_chk, alter a type int;
  2604. ^
  2605. <sql-statement>
  2606. drop table atacc1;
  2607. </sql-statement>
  2608. <sql-statement>
  2609. -- same as above, but ensure the constraint violation is detected
  2610. create table atacc1 (a bigint, b int);
  2611. </sql-statement>
  2612. <sql-statement>
  2613. insert into atacc1 values(1,2);
  2614. </sql-statement>
  2615. <sql-statement>
  2616. alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
  2617. </sql-statement>
  2618. -stdin-:<main>: Error: Parse Sql
  2619. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2620. alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
  2621. ^
  2622. <sql-statement>
  2623. alter table atacc1 validate constraint atacc1_chk, alter a type int;
  2624. </sql-statement>
  2625. -stdin-:<main>: Error: Parse Sql
  2626. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2627. alter table atacc1 validate constraint atacc1_chk, alter a type int;
  2628. ^
  2629. <sql-statement>
  2630. drop table atacc1;
  2631. </sql-statement>
  2632. <sql-statement>
  2633. -- something a little more complicated
  2634. create table atacc1 ( test int, test2 int);
  2635. </sql-statement>
  2636. <sql-statement>
  2637. -- add a primary key constraint
  2638. alter table atacc1 add constraint atacc_test1 primary key (test, test2);
  2639. </sql-statement>
  2640. -stdin-:<main>: Error: Parse Sql
  2641. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2642. -- add a primary key constraint
  2643. ^
  2644. <sql-statement>
  2645. -- try adding a second primary key - should fail
  2646. alter table atacc1 add constraint atacc_test2 primary key (test);
  2647. </sql-statement>
  2648. -stdin-:<main>: Error: Parse Sql
  2649. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2650. -- try adding a second primary key - should fail
  2651. ^
  2652. <sql-statement>
  2653. -- insert initial value
  2654. insert into atacc1 (test,test2) values (4,4);
  2655. </sql-statement>
  2656. <sql-statement>
  2657. -- should fail
  2658. insert into atacc1 (test,test2) values (4,4);
  2659. </sql-statement>
  2660. <sql-statement>
  2661. insert into atacc1 (test,test2) values (NULL,3);
  2662. </sql-statement>
  2663. <sql-statement>
  2664. insert into atacc1 (test,test2) values (3, NULL);
  2665. </sql-statement>
  2666. <sql-statement>
  2667. insert into atacc1 (test,test2) values (NULL,NULL);
  2668. </sql-statement>
  2669. <sql-statement>
  2670. -- should all succeed
  2671. insert into atacc1 (test,test2) values (4,5);
  2672. </sql-statement>
  2673. <sql-statement>
  2674. insert into atacc1 (test,test2) values (5,4);
  2675. </sql-statement>
  2676. <sql-statement>
  2677. insert into atacc1 (test,test2) values (5,5);
  2678. </sql-statement>
  2679. <sql-statement>
  2680. drop table atacc1;
  2681. </sql-statement>
  2682. <sql-statement>
  2683. -- lets do some naming tests
  2684. create table atacc1 (test int, test2 int, primary key(test));
  2685. </sql-statement>
  2686. <sql-statement>
  2687. -- only first should succeed
  2688. insert into atacc1 (test2, test) values (3, 3);
  2689. </sql-statement>
  2690. <sql-statement>
  2691. insert into atacc1 (test2, test) values (2, 3);
  2692. </sql-statement>
  2693. <sql-statement>
  2694. insert into atacc1 (test2, test) values (1, NULL);
  2695. </sql-statement>
  2696. <sql-statement>
  2697. drop table atacc1;
  2698. </sql-statement>
  2699. <sql-statement>
  2700. -- alter table / alter column [set/drop] not null tests
  2701. -- try altering system catalogs, should fail
  2702. alter table pg_class alter column relname drop not null;
  2703. </sql-statement>
  2704. -stdin-:<main>: Error: Parse Sql
  2705. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2706. -- alter table / alter column [set/drop] not null tests
  2707. ^
  2708. <sql-statement>
  2709. alter table pg_class alter relname set not null;
  2710. </sql-statement>
  2711. -stdin-:<main>: Error: Parse Sql
  2712. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2713. alter table pg_class alter relname set not null;
  2714. ^
  2715. <sql-statement>
  2716. -- try altering non-existent table, should fail
  2717. alter table non_existent alter column bar set not null;
  2718. </sql-statement>
  2719. -stdin-:<main>: Error: Parse Sql
  2720. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2721. -- try altering non-existent table, should fail
  2722. ^
  2723. <sql-statement>
  2724. alter table non_existent alter column bar drop not null;
  2725. </sql-statement>
  2726. -stdin-:<main>: Error: Parse Sql
  2727. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2728. alter table non_existent alter column bar drop not null;
  2729. ^
  2730. <sql-statement>
  2731. -- test setting columns to null and not null and vice versa
  2732. -- test checking for null values and primary key
  2733. create table atacc1 (test int not null);
  2734. </sql-statement>
  2735. <sql-statement>
  2736. alter table atacc1 add constraint "atacc1_pkey" primary key (test);
  2737. </sql-statement>
  2738. -stdin-:<main>: Error: Parse Sql
  2739. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2740. alter table atacc1 add constraint "atacc1_pkey" primary key (test);
  2741. ^
  2742. <sql-statement>
  2743. alter table atacc1 alter column test drop not null;
  2744. </sql-statement>
  2745. -stdin-:<main>: Error: Parse Sql
  2746. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2747. alter table atacc1 alter column test drop not null;
  2748. ^
  2749. <sql-statement>
  2750. alter table atacc1 drop constraint "atacc1_pkey";
  2751. </sql-statement>
  2752. -stdin-:<main>: Error: Parse Sql
  2753. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2754. alter table atacc1 drop constraint "atacc1_pkey";
  2755. ^
  2756. <sql-statement>
  2757. alter table atacc1 alter column test drop not null;
  2758. </sql-statement>
  2759. -stdin-:<main>: Error: Parse Sql
  2760. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2761. alter table atacc1 alter column test drop not null;
  2762. ^
  2763. <sql-statement>
  2764. insert into atacc1 values (null);
  2765. </sql-statement>
  2766. <sql-statement>
  2767. alter table atacc1 alter test set not null;
  2768. </sql-statement>
  2769. -stdin-:<main>: Error: Parse Sql
  2770. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2771. alter table atacc1 alter test set not null;
  2772. ^
  2773. <sql-statement>
  2774. delete from atacc1;
  2775. </sql-statement>
  2776. -stdin-:<main>: Fatal: Pre type annotation
  2777. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  2778. <sql-statement>
  2779. alter table atacc1 alter test set not null;
  2780. </sql-statement>
  2781. -stdin-:<main>: Error: Parse Sql
  2782. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2783. alter table atacc1 alter test set not null;
  2784. ^
  2785. <sql-statement>
  2786. -- try altering a non-existent column, should fail
  2787. alter table atacc1 alter bar set not null;
  2788. </sql-statement>
  2789. -stdin-:<main>: Error: Parse Sql
  2790. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2791. -- try altering a non-existent column, should fail
  2792. ^
  2793. <sql-statement>
  2794. alter table atacc1 alter bar drop not null;
  2795. </sql-statement>
  2796. -stdin-:<main>: Error: Parse Sql
  2797. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2798. alter table atacc1 alter bar drop not null;
  2799. ^
  2800. <sql-statement>
  2801. -- try creating a view and altering that, should fail
  2802. create view myview as select * from atacc1;
  2803. </sql-statement>
  2804. -stdin-:<main>: Error: Parse Sql
  2805. -stdin-:<main>:1:1: Error: expected at least one target column
  2806. -- try creating a view and altering that, should fail
  2807. ^
  2808. <sql-statement>
  2809. alter table myview alter column test drop not null;
  2810. </sql-statement>
  2811. -stdin-:<main>: Error: Parse Sql
  2812. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2813. alter table myview alter column test drop not null;
  2814. ^
  2815. <sql-statement>
  2816. alter table myview alter column test set not null;
  2817. </sql-statement>
  2818. -stdin-:<main>: Error: Parse Sql
  2819. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2820. alter table myview alter column test set not null;
  2821. ^
  2822. <sql-statement>
  2823. drop view myview;
  2824. </sql-statement>
  2825. -stdin-:<main>: Error: Parse Sql
  2826. -stdin-:<main>:1:1: Error: View not found: 'myview'
  2827. drop view myview;
  2828. ^
  2829. <sql-statement>
  2830. drop table atacc1;
  2831. </sql-statement>
  2832. <sql-statement>
  2833. -- set not null verified by constraints
  2834. create table atacc1 (test_a int, test_b int);
  2835. </sql-statement>
  2836. <sql-statement>
  2837. insert into atacc1 values (null, 1);
  2838. </sql-statement>
  2839. <sql-statement>
  2840. -- constraint not cover all values, should fail
  2841. alter table atacc1 add constraint atacc1_constr_or check(test_a is not null or test_b < 10);
  2842. </sql-statement>
  2843. -stdin-:<main>: Error: Parse Sql
  2844. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2845. -- constraint not cover all values, should fail
  2846. ^
  2847. <sql-statement>
  2848. alter table atacc1 alter test_a set not null;
  2849. </sql-statement>
  2850. -stdin-:<main>: Error: Parse Sql
  2851. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2852. alter table atacc1 alter test_a set not null;
  2853. ^
  2854. <sql-statement>
  2855. alter table atacc1 drop constraint atacc1_constr_or;
  2856. </sql-statement>
  2857. -stdin-:<main>: Error: Parse Sql
  2858. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2859. alter table atacc1 drop constraint atacc1_constr_or;
  2860. ^
  2861. <sql-statement>
  2862. -- not valid constraint, should fail
  2863. alter table atacc1 add constraint atacc1_constr_invalid check(test_a is not null) not valid;
  2864. </sql-statement>
  2865. -stdin-:<main>: Error: Parse Sql
  2866. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2867. -- not valid constraint, should fail
  2868. ^
  2869. <sql-statement>
  2870. alter table atacc1 alter test_a set not null;
  2871. </sql-statement>
  2872. -stdin-:<main>: Error: Parse Sql
  2873. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2874. alter table atacc1 alter test_a set not null;
  2875. ^
  2876. <sql-statement>
  2877. alter table atacc1 drop constraint atacc1_constr_invalid;
  2878. </sql-statement>
  2879. -stdin-:<main>: Error: Parse Sql
  2880. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2881. alter table atacc1 drop constraint atacc1_constr_invalid;
  2882. ^
  2883. <sql-statement>
  2884. -- with valid constraint
  2885. update atacc1 set test_a = 1;
  2886. </sql-statement>
  2887. -stdin-:<main>: Fatal: Pre type annotation
  2888. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  2889. <sql-statement>
  2890. alter table atacc1 add constraint atacc1_constr_a_valid check(test_a is not null);
  2891. </sql-statement>
  2892. -stdin-:<main>: Error: Parse Sql
  2893. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2894. alter table atacc1 add constraint atacc1_constr_a_valid check(test_a is not null);
  2895. ^
  2896. <sql-statement>
  2897. alter table atacc1 alter test_a set not null;
  2898. </sql-statement>
  2899. -stdin-:<main>: Error: Parse Sql
  2900. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2901. alter table atacc1 alter test_a set not null;
  2902. ^
  2903. <sql-statement>
  2904. delete from atacc1;
  2905. </sql-statement>
  2906. -stdin-:<main>: Fatal: Pre type annotation
  2907. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  2908. <sql-statement>
  2909. insert into atacc1 values (2, null);
  2910. </sql-statement>
  2911. <sql-statement>
  2912. alter table atacc1 alter test_a drop not null;
  2913. </sql-statement>
  2914. -stdin-:<main>: Error: Parse Sql
  2915. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2916. alter table atacc1 alter test_a drop not null;
  2917. ^
  2918. <sql-statement>
  2919. -- test multiple set not null at same time
  2920. -- test_a checked by atacc1_constr_a_valid, test_b should fail by table scan
  2921. alter table atacc1 alter test_a set not null, alter test_b set not null;
  2922. </sql-statement>
  2923. -stdin-:<main>: Error: Parse Sql
  2924. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2925. -- test multiple set not null at same time
  2926. ^
  2927. <sql-statement>
  2928. -- commands order has no importance
  2929. alter table atacc1 alter test_b set not null, alter test_a set not null;
  2930. </sql-statement>
  2931. -stdin-:<main>: Error: Parse Sql
  2932. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2933. -- commands order has no importance
  2934. ^
  2935. <sql-statement>
  2936. -- valid one by table scan, one by check constraints
  2937. update atacc1 set test_b = 1;
  2938. </sql-statement>
  2939. -stdin-:<main>: Fatal: Pre type annotation
  2940. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  2941. <sql-statement>
  2942. alter table atacc1 alter test_b set not null, alter test_a set not null;
  2943. </sql-statement>
  2944. -stdin-:<main>: Error: Parse Sql
  2945. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2946. alter table atacc1 alter test_b set not null, alter test_a set not null;
  2947. ^
  2948. <sql-statement>
  2949. alter table atacc1 alter test_a drop not null, alter test_b drop not null;
  2950. </sql-statement>
  2951. -stdin-:<main>: Error: Parse Sql
  2952. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2953. alter table atacc1 alter test_a drop not null, alter test_b drop not null;
  2954. ^
  2955. <sql-statement>
  2956. -- both column has check constraints
  2957. alter table atacc1 add constraint atacc1_constr_b_valid check(test_b is not null);
  2958. </sql-statement>
  2959. -stdin-:<main>: Error: Parse Sql
  2960. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2961. -- both column has check constraints
  2962. ^
  2963. <sql-statement>
  2964. alter table atacc1 alter test_b set not null, alter test_a set not null;
  2965. </sql-statement>
  2966. -stdin-:<main>: Error: Parse Sql
  2967. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2968. alter table atacc1 alter test_b set not null, alter test_a set not null;
  2969. ^
  2970. <sql-statement>
  2971. drop table atacc1;
  2972. </sql-statement>
  2973. <sql-statement>
  2974. -- test inheritance
  2975. create table parent (a int);
  2976. </sql-statement>
  2977. <sql-statement>
  2978. create table child (b varchar(255)) inherits (parent);
  2979. </sql-statement>
  2980. -stdin-:<main>: Error: Parse Sql
  2981. -stdin-:<main>:1:1: Error: table inheritance not supported
  2982. create table child (b varchar(255)) inherits (parent);
  2983. ^
  2984. <sql-statement>
  2985. alter table parent alter a set not null;
  2986. </sql-statement>
  2987. -stdin-:<main>: Error: Parse Sql
  2988. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  2989. alter table parent alter a set not null;
  2990. ^
  2991. <sql-statement>
  2992. insert into parent values (NULL);
  2993. </sql-statement>
  2994. <sql-statement>
  2995. insert into child (a, b) values (NULL, 'foo');
  2996. </sql-statement>
  2997. -stdin-:<main>: Fatal: Table metadata loading
  2998. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.child
  2999. <sql-statement>
  3000. alter table parent alter a drop not null;
  3001. </sql-statement>
  3002. -stdin-:<main>: Error: Parse Sql
  3003. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  3004. alter table parent alter a drop not null;
  3005. ^
  3006. <sql-statement>
  3007. insert into parent values (NULL);
  3008. </sql-statement>
  3009. <sql-statement>
  3010. insert into child (a, b) values (NULL, 'foo');
  3011. </sql-statement>
  3012. -stdin-:<main>: Fatal: Table metadata loading
  3013. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.child
  3014. <sql-statement>
  3015. alter table only parent alter a set not null;
  3016. </sql-statement>
  3017. -stdin-:<main>: Error: Parse Sql
  3018. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  3019. alter table only parent alter a set not null;
  3020. ^
  3021. <sql-statement>
  3022. alter table child alter a set not null;
  3023. </sql-statement>
  3024. -stdin-:<main>: Error: Parse Sql
  3025. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  3026. alter table child alter a set not null;
  3027. ^
  3028. <sql-statement>
  3029. delete from parent;
  3030. </sql-statement>
  3031. -stdin-:<main>: Fatal: Pre type annotation
  3032. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  3033. <sql-statement>
  3034. alter table only parent alter a set not null;
  3035. </sql-statement>
  3036. -stdin-:<main>: Error: Parse Sql
  3037. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  3038. alter table only parent alter a set not null;
  3039. ^
  3040. <sql-statement>
  3041. insert into parent values (NULL);
  3042. </sql-statement>
  3043. <sql-statement>
  3044. alter table child alter a set not null;
  3045. </sql-statement>
  3046. -stdin-:<main>: Error: Parse Sql
  3047. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  3048. alter table child alter a set not null;
  3049. ^
  3050. <sql-statement>
  3051. insert into child (a, b) values (NULL, 'foo');
  3052. </sql-statement>
  3053. -stdin-:<main>: Fatal: Table metadata loading
  3054. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.child
  3055. <sql-statement>
  3056. delete from child;
  3057. </sql-statement>
  3058. -stdin-:<main>: Fatal: Pre type annotation
  3059. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  3060. <sql-statement>
  3061. alter table child alter a set not null;
  3062. </sql-statement>
  3063. -stdin-:<main>: Error: Parse Sql
  3064. -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
  3065. alter table child alter a set not null;
  3066. ^
  3067. <sql-statement>
  3068. insert into child (a, b) values (NULL, 'foo');
  3069. </sql-statement>
  3070. -stdin-:<main>: Fatal: Table metadata loading
  3071. -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.child
  3072. <sql-statement>
  3073. drop table child;
  3074. </sql-statement>
  3075. <sql-statement>
  3076. drop table parent;
  3077. </sql-statement>
  3078. <sql-statement>
  3079. -- test setting and removing default values
  3080. create table def_test (
  3081. c1 int4 default 5,
  3082. c2 text default 'initial_default'
  3083. );
  3084. </sql-statement>
  3085. <sql-statement>
  3086. insert into def_test default values;
  3087. </sql-statement>
  3088. -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'.
  3089. <sql-statement>
  3090. alter table def_test alter column c1 drop default;
  3091. </sql-statement>
  3092. NSQLTranslationPG::TConverter::ParseAlterTableStmt(AlterTableStmt const*) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:2904:0
  3093. NSQLTranslationPG::TConverter::ParseRawStmt(RawStmt const*) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:510:0
  3094. NSQLTranslationPG::TConverter::ParseResult(List const*, TMaybe<unsigned int, NMaybe::TPolicyUndefinedExcept>) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:393:0
  3095. NSQLTranslationPG::TConverter::OnResult(List const*) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:351:0
  3096. NYql::PGParse(TBasicString<char, std::__y1::char_traits<char>> const&, NYql::IPGParseEvents&) at /-S/ydb/library/yql/parser/pg_wrapper/parser.cpp:217:0
  3097. NSQLTranslationPG::PGToYql(TBasicString<char, std::__y1::char_traits<char>> const&, NSQLTranslation::TTranslationSettings const&, NYql::TStmtParseInfo*) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:5109:0
  3098. NSQLTranslation::SqlToYql(TBasicString<char, std::__y1::char_traits<char>> const&, NSQLTranslation::TTranslationSettings const&, TVector<NYql::TWarningRule, std::__y1::allocator<NYql::TWarningRule>>*, NYql::TStmtParseInfo*) at /-S/ydb/library/yql/sql/sql.cpp:38:0
  3099. NYql::TProgram::ParseSql(NSQLTranslation::TTranslationSettings const&) at /-S/ydb/library/yql/core/facade/yql_facade.cpp:658:0
  3100. Main(int, char**) at /-S/ydb/library/yql/tools/pgrun/pgrun.cpp:1239:0
  3101. main at /-S/ydb/library/yql/tools/pgrun/pgrun.cpp:1341:0
  3102. __libc_start_call_main at ../sysdeps/nptl/libc_start_call_main.h:58:0
  3103. __libc_start_main_impl at ../csu/libc-start.c:392:0
  3104. ??? at ???:0:0