4 -- bad in postquel, but ok in postsql
20 -- missing relation name
22 ERROR: syntax error at or near ";"
26 select * from nonesuch;
27 ERROR: relation "nonesuch" does not exist
28 -- missing target list
29 select from pg_database;
30 ERROR: syntax error at or near "from"
31 LINE 1: select from pg_database;
33 -- bad name in target list
34 select nonesuch from pg_database;
35 ERROR: column "nonesuch" does not exist
36 LINE 1: select nonesuch from pg_database;
38 -- bad attribute name on lhs of operator
39 select * from pg_database where nonesuch = pg_database.datname;
40 ERROR: column "nonesuch" does not exist
41 LINE 1: select * from pg_database where nonesuch = pg_database.datna...
43 -- bad attribute name on rhs of operator
44 select * from pg_database where pg_database.datname = nonesuch;
45 ERROR: column "nonesuch" does not exist
46 LINE 1: ...ect * from pg_database where pg_database.datname = nonesuch;
48 -- bad select distinct on syntax, distinct attribute missing
49 select distinct on (foobar) from pg_database;
50 ERROR: syntax error at or near "from"
51 LINE 1: select distinct on (foobar) from pg_database;
53 -- bad select distinct on syntax, distinct attribute not in target list
54 select distinct on (foobar) * from pg_database;
55 ERROR: column "foobar" does not exist
56 LINE 1: select distinct on (foobar) * from pg_database;
61 -- missing relation name (this had better not wildcard!)
63 ERROR: syntax error at or near ";"
68 ERROR: relation "nonesuch" does not exist
72 -- missing relation name (this had better not wildcard!)
74 ERROR: syntax error at or near ";"
79 ERROR: table "nonesuch" does not exist
84 -- missing relation name
86 ERROR: syntax error at or near ";"
87 LINE 1: alter table rename;
90 alter table nonesuch rename to newnonesuch;
91 ERROR: relation "nonesuch" does not exist
93 alter table nonesuch rename to stud_emp;
94 ERROR: relation "nonesuch" does not exist
96 alter table stud_emp rename to aggtest;
97 ERROR: relation "aggtest" already exists
99 alter table stud_emp rename to stud_emp;
100 ERROR: relation "stud_emp" already exists
101 -- attribute renaming
103 alter table nonesuchrel rename column nonesuchatt to newnonesuchatt;
104 ERROR: relation "nonesuchrel" does not exist
106 alter table emp rename column nonesuchatt to newnonesuchatt;
107 ERROR: column "nonesuchatt" does not exist
109 alter table emp rename column salary to manager;
110 ERROR: column "manager" of relation "stud_emp" already exists
112 alter table emp rename column salary to oid;
113 ERROR: column "oid" of relation "stud_emp" already exists
119 NOTICE: there is no transaction in progress
122 WARNING: there is no transaction in progress
125 -- sfunc/finalfunc type disagreement
126 create aggregate newavg2 (sfunc = int4pl,
131 ERROR: function int2um(integer) does not exist
133 create aggregate newcnt1 (sfunc = int4inc,
136 ERROR: aggregate input type must be specified
140 -- missing index name
142 ERROR: syntax error at or near ";"
147 ERROR: syntax error at or near "314159"
148 LINE 1: drop index 314159;
152 ERROR: index "nonesuch" does not exist
156 -- missing aggregate name
158 ERROR: syntax error at or near ";"
159 LINE 1: drop aggregate;
161 -- missing aggregate type
162 drop aggregate newcnt1;
163 ERROR: syntax error at or near ";"
164 LINE 1: drop aggregate newcnt1;
166 -- bad aggregate name
167 drop aggregate 314159 (int);
168 ERROR: syntax error at or near "314159"
169 LINE 1: drop aggregate 314159 (int);
171 -- bad aggregate type
172 drop aggregate newcnt (nonesuch);
173 ERROR: type "nonesuch" does not exist
175 drop aggregate nonesuch (int4);
176 ERROR: aggregate nonesuch(integer) does not exist
177 -- no such aggregate for type
178 drop aggregate newcnt (float4);
179 ERROR: aggregate newcnt(real) does not exist
183 -- missing function name
185 ERROR: syntax error at or near "("
186 LINE 1: drop function ();
189 drop function 314159();
190 ERROR: syntax error at or near "314159"
191 LINE 1: drop function 314159();
194 drop function nonesuch();
195 ERROR: function nonesuch() does not exist
201 ERROR: syntax error at or near ";"
206 ERROR: syntax error at or near "314159"
207 LINE 1: drop type 314159;
211 ERROR: type "nonesuch" does not exist
215 -- missing everything
217 ERROR: syntax error at or near ";"
218 LINE 1: drop operator;
221 drop operator equals;
222 ERROR: syntax error at or near ";"
223 LINE 1: drop operator equals;
227 ERROR: syntax error at or near ";"
228 LINE 1: drop operator ===;
230 -- missing parentheses
231 drop operator int4, int4;
232 ERROR: syntax error at or near ","
233 LINE 1: drop operator int4, int4;
235 -- missing operator name
236 drop operator (int4, int4);
237 ERROR: syntax error at or near "("
238 LINE 1: drop operator (int4, int4);
240 -- missing type list contents
241 drop operator === ();
242 ERROR: syntax error at or near ")"
243 LINE 1: drop operator === ();
246 drop operator === (int4);
247 ERROR: missing argument
248 HINT: Use NONE to denote the missing argument of a unary operator.
249 -- no such operator by that name
250 drop operator === (int4, int4);
251 ERROR: operator does not exist: integer === integer
253 drop operator = (nonesuch);
254 ERROR: missing argument
255 HINT: Use NONE to denote the missing argument of a unary operator.
257 drop operator = ( , int4);
258 ERROR: syntax error at or near ","
259 LINE 1: drop operator = ( , int4);
262 drop operator = (nonesuch, int4);
263 ERROR: type "nonesuch" does not exist
265 drop operator = (int4, nonesuch);
266 ERROR: type "nonesuch" does not exist
268 drop operator = (int4, );
269 ERROR: syntax error at or near ")"
270 LINE 1: drop operator = (int4, );
277 ERROR: syntax error at or near ";"
282 ERROR: syntax error at or near "314159"
283 LINE 1: drop rule 314159;
286 drop rule nonesuch on noplace;
287 ERROR: relation "noplace" does not exist
288 -- these postquel variants are no longer supported
289 drop tuple rule nonesuch;
290 ERROR: syntax error at or near "tuple"
291 LINE 1: drop tuple rule nonesuch;
293 drop instance rule nonesuch on noplace;
294 ERROR: syntax error at or near "instance"
295 LINE 1: drop instance rule nonesuch on noplace;
297 drop rewrite rule nonesuch;
298 ERROR: syntax error at or near "rewrite"
299 LINE 1: drop rewrite rule nonesuch;
302 -- Check that division-by-zero is properly caught.
305 ERROR: division by zero
307 ERROR: division by zero
309 ERROR: division by zero
311 ERROR: division by zero
313 ERROR: division by zero
315 ERROR: division by zero
317 ERROR: division by zero
319 ERROR: division by zero
321 ERROR: division by zero
323 ERROR: division by zero
325 ERROR: division by zero
327 -- Test psql's reporting of syntax error location
330 ERROR: syntax error at or near "xxx"
334 ERROR: syntax error at or near "foo"
338 ERROR: syntax error at or near ";"
339 LINE 1: CREATE TABLE ;
343 ERROR: syntax error at end of input
346 INSERT INTO foo VALUES(123) foo;
347 ERROR: syntax error at or near "foo"
348 LINE 1: INSERT INTO foo VALUES(123) foo;
352 ERROR: syntax error at or near "123"
353 LINE 1: INSERT INTO 123
358 ERROR: syntax error at or near "123"
359 LINE 2: VALUES(123) 123
363 (id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY,
365 id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
366 ERROR: syntax error at or near "NUL"
367 LINE 3: id3 INTEGER NOT NUL,
369 -- long line to be truncated on the left
370 CREATE TABLE foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
371 id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
372 ERROR: syntax error at or near "NUL"
373 LINE 1: ...T NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
375 -- long line to be truncated on the right
377 id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL, id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY);
378 ERROR: syntax error at or near "NUL"
379 LINE 2: id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQ...
381 -- long line to be truncated both ways
382 CREATE TABLE foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
383 ERROR: syntax error at or near "NUL"
384 LINE 1: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
386 -- long line to be truncated on the left, many lines
390 foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
400 ERROR: syntax error at or near "NUL"
401 LINE 4: ...T NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
403 -- long line to be truncated on the right, many lines
408 id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL, id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY)
410 ERROR: syntax error at or near "NUL"
411 LINE 5: id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQ...
413 -- long line to be truncated both ways, many lines
420 UNIQUE NOT NULL, idx INT4 UNIQUE NOT NULL, idy INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL,
421 idz INT4 UNIQUE NOT NULL,
422 idv INT4 UNIQUE NOT NULL);
423 ERROR: syntax error at or near "NUL"
424 LINE 7: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
426 -- more than 10 lines...
442 idx INT4 UNIQUE NOT NULL, idy INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL,
443 idz INT4 UNIQUE NOT NULL,
449 ERROR: syntax error at or near "NUL"
450 LINE 16: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
452 -- Check that stack depth detection mechanism works and
453 -- max_stack_depth is not set too high
454 create function infinite_recurse() returns int as
455 'select infinite_recurse()' language sql;
457 select infinite_recurse();
458 ERROR: stack depth limit exceeded