5 -- bad in postquel, but ok in postsql
19 -- missing relation name
23 select * from nonesuch;
25 -- missing target list
26 select from pg_database;
27 -- bad name in target list
28 select nonesuch from pg_database;
29 -- bad attribute name on lhs of operator
30 select * from pg_database where nonesuch = pg_database.datname;
32 -- bad attribute name on rhs of operator
33 select * from pg_database where pg_database.datname = nonesuch;
36 -- bad select distinct on syntax, distinct attribute missing
37 select distinct on (foobar) from pg_database;
40 -- bad select distinct on syntax, distinct attribute not in target list
41 select distinct on (foobar) * from pg_database;
47 -- missing relation name (this had better not wildcard!)
57 -- missing relation name (this had better not wildcard!)
69 -- missing relation name
73 alter table nonesuch rename to newnonesuch;
76 alter table nonesuch rename to stud_emp;
79 alter table stud_emp rename to aggtest;
82 alter table stud_emp rename to stud_emp;
88 alter table nonesuchrel rename column nonesuchatt to newnonesuchatt;
91 alter table emp rename column nonesuchatt to newnonesuchatt;
94 alter table emp rename column salary to manager;
97 alter table emp rename column salary to oid;
113 -- sfunc/finalfunc type disagreement
114 create aggregate newavg2 (sfunc = int4pl,
121 create aggregate newcnt1 (sfunc = int4inc,
129 -- missing index name
142 -- missing aggregate name
145 -- missing aggregate type
146 drop aggregate newcnt1;
148 -- bad aggregate name
149 drop aggregate 314159 (int);
151 -- bad aggregate type
152 drop aggregate newcnt (nonesuch);
155 drop aggregate nonesuch (int4);
157 -- no such aggregate for type
158 drop aggregate newcnt (float4);
164 -- missing function name
168 drop function 314159();
171 drop function nonesuch();
190 -- missing everything
194 drop operator equals;
199 -- missing parentheses
200 drop operator int4, int4;
202 -- missing operator name
203 drop operator (int4, int4);
205 -- missing type list contents
206 drop operator === ();
209 drop operator === (int4);
211 -- no such operator by that name
212 drop operator === (int4, int4);
215 drop operator = (nonesuch);
218 drop operator = ( , int4);
221 drop operator = (nonesuch, int4);
224 drop operator = (int4, nonesuch);
227 drop operator = (int4, );
240 drop rule nonesuch on noplace;
242 -- these postquel variants are no longer supported
243 drop tuple rule nonesuch;
244 drop instance rule nonesuch on noplace;
245 drop rewrite rule nonesuch;
248 -- Check that division-by-zero is properly caught.
275 -- Test psql's reporting of syntax error location
287 INSERT INTO foo VALUES(123) foo;
298 (id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY,
300 id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
302 -- long line to be truncated on the left
303 CREATE TABLE foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
304 id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
306 -- long line to be truncated on the right
308 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);
310 -- long line to be truncated both ways
311 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);
313 -- long line to be truncated on the left, many lines
317 foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
328 -- long line to be truncated on the right, many lines
333 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)
336 -- long line to be truncated both ways, many lines
343 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,
344 idz INT4 UNIQUE NOT NULL,
345 idv INT4 UNIQUE NOT NULL);
347 -- more than 10 lines...
363 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,
364 idz INT4 UNIQUE NOT NULL,
371 -- Check that stack depth detection mechanism works and
372 -- max_stack_depth is not set too high
373 create function infinite_recurse() returns int as
374 'select infinite_recurse()' language sql;
376 select infinite_recurse();