]> granicus.if.org Git - postgresql/blob - src/test/regress/expected/errors.out
Reduce error level of ROLLBACK outside a transaction from WARNING to
[postgresql] / src / test / regress / expected / errors.out
1 --
2 -- ERRORS
3 --
4 -- bad in postquel, but ok in postsql
5 select 1;
6  ?column? 
7 ----------
8         1
9 (1 row)
10
11 --
12 -- UNSUPPORTED STUFF
13  
14 -- doesn't work 
15 -- notify pg_class
16 --
17 --
18 -- SELECT
19  
20 -- missing relation name 
21 select;
22 ERROR:  syntax error at or near ";"
23 LINE 1: select;
24               ^
25 -- no such relation 
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;
32                ^
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;
37                ^
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...
42                                         ^
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;
47                                                               ^
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;
52                                     ^
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;
57                             ^
58 --
59 -- DELETE
60  
61 -- missing relation name (this had better not wildcard!) 
62 delete from;
63 ERROR:  syntax error at or near ";"
64 LINE 1: delete from;
65                    ^
66 -- no such relation 
67 delete from nonesuch;
68 ERROR:  relation "nonesuch" does not exist
69 --
70 -- DROP
71  
72 -- missing relation name (this had better not wildcard!) 
73 drop table;
74 ERROR:  syntax error at or near ";"
75 LINE 1: drop table;
76                   ^
77 -- no such relation 
78 drop table nonesuch;
79 ERROR:  table "nonesuch" does not exist
80 --
81 -- ALTER TABLE
82  
83 -- relation renaming 
84 -- missing relation name 
85 alter table rename;
86 ERROR:  syntax error at or near ";"
87 LINE 1: alter table rename;
88                           ^
89 -- no such relation 
90 alter table nonesuch rename to newnonesuch;
91 ERROR:  relation "nonesuch" does not exist
92 -- no such relation 
93 alter table nonesuch rename to stud_emp;
94 ERROR:  relation "nonesuch" does not exist
95 -- conflict 
96 alter table stud_emp rename to aggtest;
97 ERROR:  relation "aggtest" already exists
98 -- self-conflict 
99 alter table stud_emp rename to stud_emp;
100 ERROR:  relation "stud_emp" already exists
101 -- attribute renaming 
102 -- no such relation 
103 alter table nonesuchrel rename column nonesuchatt to newnonesuchatt;
104 ERROR:  relation "nonesuchrel" does not exist
105 -- no such attribute 
106 alter table emp rename column nonesuchatt to newnonesuchatt;
107 ERROR:  column "nonesuchatt" does not exist
108 -- conflict 
109 alter table emp rename column salary to manager;
110 ERROR:  column "manager" of relation "stud_emp" already exists
111 -- conflict 
112 alter table emp rename column salary to oid;
113 ERROR:  column "oid" of relation "stud_emp" already exists
114 --
115 -- TRANSACTION STUFF
116  
117 -- not in a xact 
118 abort;
119 NOTICE:  there is no transaction in progress
120 -- not in a xact 
121 end;
122 WARNING:  there is no transaction in progress
123 --
124 -- CREATE AGGREGATE
125 -- sfunc/finalfunc type disagreement 
126 create aggregate newavg2 (sfunc = int4pl,
127                           basetype = int4,
128                           stype = int4,
129                           finalfunc = int2um,
130                           initcond = '0');
131 ERROR:  function int2um(integer) does not exist
132 -- left out basetype
133 create aggregate newcnt1 (sfunc = int4inc,
134                           stype = int4,
135                           initcond = '0');
136 ERROR:  aggregate input type must be specified
137 --
138 -- DROP INDEX
139  
140 -- missing index name 
141 drop index;
142 ERROR:  syntax error at or near ";"
143 LINE 1: drop index;
144                   ^
145 -- bad index name 
146 drop index 314159;
147 ERROR:  syntax error at or near "314159"
148 LINE 1: drop index 314159;
149                    ^
150 -- no such index 
151 drop index nonesuch;
152 ERROR:  index "nonesuch" does not exist
153 --
154 -- DROP AGGREGATE
155  
156 -- missing aggregate name 
157 drop aggregate;
158 ERROR:  syntax error at or near ";"
159 LINE 1: drop aggregate;
160                       ^
161 -- missing aggregate type
162 drop aggregate newcnt1;
163 ERROR:  syntax error at or near ";"
164 LINE 1: drop aggregate newcnt1;
165                               ^
166 -- bad aggregate name 
167 drop aggregate 314159 (int);
168 ERROR:  syntax error at or near "314159"
169 LINE 1: drop aggregate 314159 (int);
170                        ^
171 -- bad aggregate type
172 drop aggregate newcnt (nonesuch);
173 ERROR:  type "nonesuch" does not exist
174 -- no such aggregate 
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
180 --
181 -- DROP FUNCTION
182  
183 -- missing function name 
184 drop function ();
185 ERROR:  syntax error at or near "("
186 LINE 1: drop function ();
187                       ^
188 -- bad function name 
189 drop function 314159();
190 ERROR:  syntax error at or near "314159"
191 LINE 1: drop function 314159();
192                       ^
193 -- no such function 
194 drop function nonesuch();
195 ERROR:  function nonesuch() does not exist
196 --
197 -- DROP TYPE
198  
199 -- missing type name 
200 drop type;
201 ERROR:  syntax error at or near ";"
202 LINE 1: drop type;
203                  ^
204 -- bad type name 
205 drop type 314159;
206 ERROR:  syntax error at or near "314159"
207 LINE 1: drop type 314159;
208                   ^
209 -- no such type 
210 drop type nonesuch;
211 ERROR:  type "nonesuch" does not exist
212 --
213 -- DROP OPERATOR
214  
215 -- missing everything 
216 drop operator;
217 ERROR:  syntax error at or near ";"
218 LINE 1: drop operator;
219                      ^
220 -- bad operator name 
221 drop operator equals;
222 ERROR:  syntax error at or near ";"
223 LINE 1: drop operator equals;
224                             ^
225 -- missing type list 
226 drop operator ===;
227 ERROR:  syntax error at or near ";"
228 LINE 1: drop operator ===;
229                          ^
230 -- missing parentheses 
231 drop operator int4, int4;
232 ERROR:  syntax error at or near ","
233 LINE 1: drop operator int4, int4;
234                           ^
235 -- missing operator name 
236 drop operator (int4, int4);
237 ERROR:  syntax error at or near "("
238 LINE 1: drop operator (int4, int4);
239                       ^
240 -- missing type list contents 
241 drop operator === ();
242 ERROR:  syntax error at or near ")"
243 LINE 1: drop operator === ();
244                            ^
245 -- no such 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
252 -- no such type1 
253 drop operator = (nonesuch);
254 ERROR:  missing argument
255 HINT:  Use NONE to denote the missing argument of a unary operator.
256 -- no such type1 
257 drop operator = ( , int4);
258 ERROR:  syntax error at or near ","
259 LINE 1: drop operator = ( , int4);
260                           ^
261 -- no such type1 
262 drop operator = (nonesuch, int4);
263 ERROR:  type "nonesuch" does not exist
264 -- no such type2 
265 drop operator = (int4, nonesuch);
266 ERROR:  type "nonesuch" does not exist
267 -- no such type2 
268 drop operator = (int4, );
269 ERROR:  syntax error at or near ")"
270 LINE 1: drop operator = (int4, );
271                                ^
272 --
273 -- DROP RULE
274  
275 -- missing rule name 
276 drop rule;
277 ERROR:  syntax error at or near ";"
278 LINE 1: drop rule;
279                  ^
280 -- bad rule name 
281 drop rule 314159;
282 ERROR:  syntax error at or near "314159"
283 LINE 1: drop rule 314159;
284                   ^
285 -- no such rule 
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;
292              ^
293 drop instance rule nonesuch on noplace;
294 ERROR:  syntax error at or near "instance"
295 LINE 1: drop instance rule nonesuch on noplace;
296              ^
297 drop rewrite rule nonesuch;
298 ERROR:  syntax error at or near "rewrite"
299 LINE 1: drop rewrite rule nonesuch;
300              ^
301 --
302 -- Check that division-by-zero is properly caught.
303 --
304 select 1/0;
305 ERROR:  division by zero
306 select 1::int8/0;
307 ERROR:  division by zero
308 select 1/0::int8;
309 ERROR:  division by zero
310 select 1::int2/0;
311 ERROR:  division by zero
312 select 1/0::int2;
313 ERROR:  division by zero
314 select 1::numeric/0;
315 ERROR:  division by zero
316 select 1/0::numeric;
317 ERROR:  division by zero
318 select 1::float8/0;
319 ERROR:  division by zero
320 select 1/0::float8;
321 ERROR:  division by zero
322 select 1::float4/0;
323 ERROR:  division by zero
324 select 1/0::float4;
325 ERROR:  division by zero
326 --
327 -- Test psql's reporting of syntax error location
328 --
329 xxx;
330 ERROR:  syntax error at or near "xxx"
331 LINE 1: xxx;
332         ^
333 CREATE foo;
334 ERROR:  syntax error at or near "foo"
335 LINE 1: CREATE foo;
336                ^
337 CREATE TABLE ;
338 ERROR:  syntax error at or near ";"
339 LINE 1: CREATE TABLE ;
340                      ^
341 CREATE TABLE
342 \g
343 ERROR:  syntax error at end of input
344 LINE 1: CREATE TABLE
345                     ^
346 INSERT INTO foo VALUES(123) foo;
347 ERROR:  syntax error at or near "foo"
348 LINE 1: INSERT INTO foo VALUES(123) foo;
349                                     ^
350 INSERT INTO 123
351 VALUES(123);
352 ERROR:  syntax error at or near "123"
353 LINE 1: INSERT INTO 123
354                     ^
355 INSERT INTO foo 
356 VALUES(123) 123
357 ;
358 ERROR:  syntax error at or near "123"
359 LINE 2: VALUES(123) 123
360                     ^
361 -- with a tab
362 CREATE TABLE foo
363   (id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY,
364         id3 INTEGER NOT NUL,
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,
368                          ^
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, 
374                                                                   ^
375 -- long line to be truncated on the right
376 CREATE TABLE foo(
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...
380                         ^
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...
385                                                              ^
386 -- long line to be truncated on the left, many lines
387 CREATE
388 TEMPORARY
389 TABLE 
390 foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, 
391 id4 INT4 
392 UNIQUE 
393 NOT 
394 NULL, 
395 id5 TEXT 
396 UNIQUE 
397 NOT 
398 NULL)
399 ;
400 ERROR:  syntax error at or near "NUL"
401 LINE 4: ...T NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, 
402                                                                   ^
403 -- long line to be truncated on the right, many lines
404 CREATE 
405 TEMPORARY
406 TABLE 
407 foo(
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)
409 ;
410 ERROR:  syntax error at or near "NUL"
411 LINE 5: id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQ...
412                         ^
413 -- long line to be truncated both ways, many lines
414 CREATE 
415 TEMPORARY
416 TABLE 
417 foo
418 (id 
419 INT4 
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...
425                                                              ^
426 -- more than 10 lines...
427 CREATE 
428 TEMPORARY
429 TABLE 
430 foo
431 (id 
432 INT4 
433 UNIQUE 
434 NOT 
435 NULL
436
437 idm
438 INT4 
439 UNIQUE 
440 NOT 
441 NULL,
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, 
444 idv 
445 INT4 
446 UNIQUE 
447 NOT 
448 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...
451                                                               ^
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;
456 \set VERBOSITY terse
457 select infinite_recurse();
458 ERROR:  stack depth limit exceeded