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 LINE 1: select * from nonesuch;
30 -- missing target list
31 select from pg_database;
32 ERROR: syntax error at or near "from"
33 LINE 1: select from pg_database;
35 -- bad name in target list
36 select nonesuch from pg_database;
37 ERROR: column "nonesuch" does not exist
38 LINE 1: select nonesuch from pg_database;
40 -- bad attribute name on lhs of operator
41 select * from pg_database where nonesuch = pg_database.datname;
42 ERROR: column "nonesuch" does not exist
43 LINE 1: select * from pg_database where nonesuch = pg_database.datna...
45 -- bad attribute name on rhs of operator
46 select * from pg_database where pg_database.datname = nonesuch;
47 ERROR: column "nonesuch" does not exist
48 LINE 1: ...ect * from pg_database where pg_database.datname = nonesuch;
50 -- bad select distinct on syntax, distinct attribute missing
51 select distinct on (foobar) from pg_database;
52 ERROR: syntax error at or near "from"
53 LINE 1: select distinct on (foobar) from pg_database;
55 -- bad select distinct on syntax, distinct attribute not in target list
56 select distinct on (foobar) * from pg_database;
57 ERROR: column "foobar" does not exist
58 LINE 1: select distinct on (foobar) * from pg_database;
63 -- missing relation name (this had better not wildcard!)
65 ERROR: syntax error at or near ";"
70 ERROR: relation "nonesuch" does not exist
71 LINE 1: delete from nonesuch;
76 -- missing relation name (this had better not wildcard!)
78 ERROR: syntax error at or near ";"
83 ERROR: table "nonesuch" does not exist
88 -- missing relation name
90 ERROR: syntax error at or near ";"
91 LINE 1: alter table rename;
94 alter table nonesuch rename to newnonesuch;
95 ERROR: relation "nonesuch" does not exist
97 alter table nonesuch rename to stud_emp;
98 ERROR: relation "nonesuch" does not exist
100 alter table stud_emp rename to aggtest;
101 ERROR: relation "aggtest" already exists
103 alter table stud_emp rename to stud_emp;
104 ERROR: relation "stud_emp" already exists
105 -- attribute renaming
107 alter table nonesuchrel rename column nonesuchatt to newnonesuchatt;
108 ERROR: relation "nonesuchrel" does not exist
110 alter table emp rename column nonesuchatt to newnonesuchatt;
111 ERROR: column "nonesuchatt" does not exist
113 alter table emp rename column salary to manager;
114 ERROR: column "manager" of relation "stud_emp" already exists
116 alter table emp rename column salary to oid;
117 ERROR: column "oid" of relation "stud_emp" already exists
123 NOTICE: there is no transaction in progress
126 WARNING: there is no transaction in progress
129 -- sfunc/finalfunc type disagreement
130 create aggregate newavg2 (sfunc = int4pl,
135 ERROR: function int2um(integer) does not exist
137 create aggregate newcnt1 (sfunc = int4inc,
140 ERROR: aggregate input type must be specified
144 -- missing index name
146 ERROR: syntax error at or near ";"
151 ERROR: syntax error at or near "314159"
152 LINE 1: drop index 314159;
156 ERROR: index "nonesuch" does not exist
160 -- missing aggregate name
162 ERROR: syntax error at or near ";"
163 LINE 1: drop aggregate;
165 -- missing aggregate type
166 drop aggregate newcnt1;
167 ERROR: syntax error at or near ";"
168 LINE 1: drop aggregate newcnt1;
170 -- bad aggregate name
171 drop aggregate 314159 (int);
172 ERROR: syntax error at or near "314159"
173 LINE 1: drop aggregate 314159 (int);
175 -- bad aggregate type
176 drop aggregate newcnt (nonesuch);
177 ERROR: type "nonesuch" does not exist
179 drop aggregate nonesuch (int4);
180 ERROR: aggregate nonesuch(integer) does not exist
181 -- no such aggregate for type
182 drop aggregate newcnt (float4);
183 ERROR: aggregate newcnt(real) does not exist
187 -- missing function name
189 ERROR: syntax error at or near "("
190 LINE 1: drop function ();
193 drop function 314159();
194 ERROR: syntax error at or near "314159"
195 LINE 1: drop function 314159();
198 drop function nonesuch();
199 ERROR: function nonesuch() does not exist
205 ERROR: syntax error at or near ";"
210 ERROR: syntax error at or near "314159"
211 LINE 1: drop type 314159;
215 ERROR: type "nonesuch" does not exist
219 -- missing everything
221 ERROR: syntax error at or near ";"
222 LINE 1: drop operator;
225 drop operator equals;
226 ERROR: syntax error at or near ";"
227 LINE 1: drop operator equals;
231 ERROR: syntax error at or near ";"
232 LINE 1: drop operator ===;
234 -- missing parentheses
235 drop operator int4, int4;
236 ERROR: syntax error at or near ","
237 LINE 1: drop operator int4, int4;
239 -- missing operator name
240 drop operator (int4, int4);
241 ERROR: syntax error at or near "("
242 LINE 1: drop operator (int4, int4);
244 -- missing type list contents
245 drop operator === ();
246 ERROR: syntax error at or near ")"
247 LINE 1: drop operator === ();
250 drop operator === (int4);
251 ERROR: missing argument
252 LINE 1: drop operator === (int4);
254 HINT: Use NONE to denote the missing argument of a unary operator.
255 -- no such operator by that name
256 drop operator === (int4, int4);
257 ERROR: operator does not exist: integer === integer
259 drop operator = (nonesuch);
260 ERROR: missing argument
261 LINE 1: drop operator = (nonesuch);
263 HINT: Use NONE to denote the missing argument of a unary operator.
265 drop operator = ( , int4);
266 ERROR: syntax error at or near ","
267 LINE 1: drop operator = ( , int4);
270 drop operator = (nonesuch, int4);
271 ERROR: type "nonesuch" does not exist
273 drop operator = (int4, nonesuch);
274 ERROR: type "nonesuch" does not exist
276 drop operator = (int4, );
277 ERROR: syntax error at or near ")"
278 LINE 1: drop operator = (int4, );
285 ERROR: syntax error at or near ";"
290 ERROR: syntax error at or near "314159"
291 LINE 1: drop rule 314159;
294 drop rule nonesuch on noplace;
295 ERROR: relation "noplace" does not exist
296 -- these postquel variants are no longer supported
297 drop tuple rule nonesuch;
298 ERROR: syntax error at or near "tuple"
299 LINE 1: drop tuple rule nonesuch;
301 drop instance rule nonesuch on noplace;
302 ERROR: syntax error at or near "instance"
303 LINE 1: drop instance rule nonesuch on noplace;
305 drop rewrite rule nonesuch;
306 ERROR: syntax error at or near "rewrite"
307 LINE 1: drop rewrite rule nonesuch;
310 -- Check that division-by-zero is properly caught.
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 ERROR: division by zero
329 ERROR: division by zero
331 ERROR: division by zero
333 ERROR: division by zero
335 -- Test psql's reporting of syntax error location
338 ERROR: syntax error at or near "xxx"
342 ERROR: syntax error at or near "foo"
346 ERROR: syntax error at or near ";"
347 LINE 1: CREATE TABLE ;
351 ERROR: syntax error at end of input
354 INSERT INTO foo VALUES(123) foo;
355 ERROR: syntax error at or near "foo"
356 LINE 1: INSERT INTO foo VALUES(123) foo;
360 ERROR: syntax error at or near "123"
361 LINE 1: INSERT INTO 123
366 ERROR: syntax error at or near "123"
367 LINE 2: VALUES(123) 123
371 (id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY,
373 id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
374 ERROR: syntax error at or near "NUL"
375 LINE 3: id3 INTEGER NOT NUL,
377 -- long line to be truncated on the left
378 CREATE TABLE foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
379 id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
380 ERROR: syntax error at or near "NUL"
381 LINE 1: ...T NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
383 -- long line to be truncated on the right
385 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);
386 ERROR: syntax error at or near "NUL"
387 LINE 2: id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQ...
389 -- long line to be truncated both ways
390 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);
391 ERROR: syntax error at or near "NUL"
392 LINE 1: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
394 -- long line to be truncated on the left, many lines
398 foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
408 ERROR: syntax error at or near "NUL"
409 LINE 4: ...T NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
411 -- long line to be truncated on the right, many lines
416 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)
418 ERROR: syntax error at or near "NUL"
419 LINE 5: id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQ...
421 -- long line to be truncated both ways, many lines
428 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,
429 idz INT4 UNIQUE NOT NULL,
430 idv INT4 UNIQUE NOT NULL);
431 ERROR: syntax error at or near "NUL"
432 LINE 7: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
434 -- more than 10 lines...
450 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,
451 idz INT4 UNIQUE NOT NULL,
457 ERROR: syntax error at or near "NUL"
458 LINE 16: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
460 -- Check that stack depth detection mechanism works and
461 -- max_stack_depth is not set too high
462 create function infinite_recurse() returns int as
463 'select infinite_recurse()' language sql;
465 select infinite_recurse();
466 ERROR: stack depth limit exceeded