5 -- bad in postquel, but ok in PostgreSQL
19 -- this used to be a syntax error, but now we allow an empty target list
23 select * from nonesuch;
25 -- bad name in target list
26 select nonesuch from pg_database;
28 -- empty distinct list isn't OK
29 select distinct from pg_database;
31 -- bad attribute name on lhs of operator
32 select * from pg_database where nonesuch = pg_database.datname;
34 -- bad attribute name on rhs of operator
35 select * from pg_database where pg_database.datname = nonesuch;
37 -- bad attribute name in select distinct on
38 select distinct on (foobar) * from pg_database;
44 -- missing relation name (this had better not wildcard!)
54 -- missing relation name (this had better not wildcard!)
66 -- missing relation name
70 alter table nonesuch rename to newnonesuch;
73 alter table nonesuch rename to stud_emp;
76 alter table stud_emp rename to aggtest;
79 alter table stud_emp rename to stud_emp;
85 alter table nonesuchrel rename column nonesuchatt to newnonesuchatt;
88 alter table emp rename column nonesuchatt to newnonesuchatt;
91 alter table emp rename column salary to manager;
94 alter table emp rename column salary to ctid;
110 -- sfunc/finalfunc type disagreement
111 create aggregate newavg2 (sfunc = int4pl,
118 create aggregate newcnt1 (sfunc = int4inc,
126 -- missing index name
139 -- missing aggregate name
142 -- missing aggregate type
143 drop aggregate newcnt1;
145 -- bad aggregate name
146 drop aggregate 314159 (int);
148 -- bad aggregate type
149 drop aggregate newcnt (nonesuch);
152 drop aggregate nonesuch (int4);
154 -- no such aggregate for type
155 drop aggregate newcnt (float4);
161 -- missing function name
165 drop function 314159();
168 drop function nonesuch();
187 -- missing everything
191 drop operator equals;
196 -- missing parentheses
197 drop operator int4, int4;
199 -- missing operator name
200 drop operator (int4, int4);
202 -- missing type list contents
203 drop operator === ();
206 drop operator === (int4);
208 -- no such operator by that name
209 drop operator === (int4, int4);
212 drop operator = (nonesuch);
215 drop operator = ( , int4);
218 drop operator = (nonesuch, int4);
221 drop operator = (int4, nonesuch);
224 drop operator = (int4, );
237 drop rule nonesuch on noplace;
239 -- these postquel variants are no longer supported
240 drop tuple rule nonesuch;
241 drop instance rule nonesuch on noplace;
242 drop rewrite rule nonesuch;
245 -- Check that division-by-zero is properly caught.
272 -- Test psql's reporting of syntax error location
284 INSERT INTO foo VALUES(123) foo;
295 (id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY,
297 id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
299 -- long line to be truncated on the left
300 CREATE TABLE foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
301 id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
303 -- long line to be truncated on the right
305 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);
307 -- long line to be truncated both ways
308 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);
310 -- long line to be truncated on the left, many lines
314 foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
325 -- long line to be truncated on the right, many lines
330 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)
333 -- long line to be truncated both ways, many lines
340 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,
341 idz INT4 UNIQUE NOT NULL,
342 idv INT4 UNIQUE NOT NULL);
344 -- more than 10 lines...
360 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,
361 idz INT4 UNIQUE NOT NULL,
368 -- Check that stack depth detection mechanism works and
369 -- max_stack_depth is not set too high
370 create function infinite_recurse() returns int as
371 'select infinite_recurse()' language sql;
373 select infinite_recurse();