Remove old RULE privilege completely.
[pgsql.git] / src / test / regress / expected / errors.out
blob8c527474daf8a1431dd36c969a8c6969adf53346
1 --
2 -- ERRORS
3 --
4 -- bad in postquel, but ok in PostgreSQL
5 select 1;
6  ?column? 
7 ----------
8         1
9 (1 row)
12 -- UNSUPPORTED STUFF
13 -- doesn't work
14 -- notify pg_class
17 -- SELECT
18 -- this used to be a syntax error, but now we allow an empty target list
19 select;
21 (1 row)
23 -- no such relation
24 select * from nonesuch;
25 ERROR:  relation "nonesuch" does not exist
26 LINE 1: select * from nonesuch;
27                       ^
28 -- bad name in target list
29 select nonesuch from pg_database;
30 ERROR:  column "nonesuch" does not exist
31 LINE 1: select nonesuch from pg_database;
32                ^
33 -- empty distinct list isn't OK
34 select distinct from pg_database;
35 ERROR:  syntax error at or near "from"
36 LINE 1: select distinct 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 attribute name in select distinct on
49 select distinct on (foobar) * from pg_database;
50 ERROR:  column "foobar" does not exist
51 LINE 1: select distinct on (foobar) * from pg_database;
52                             ^
53 -- grouping with FOR UPDATE
54 select null from pg_database group by datname for update;
55 ERROR:  FOR UPDATE is not allowed with GROUP BY clause
56 select null from pg_database group by grouping sets (()) for update;
57 ERROR:  FOR UPDATE is not allowed with GROUP BY clause
59 -- DELETE
60 -- missing relation name (this had better not wildcard!)
61 delete from;
62 ERROR:  syntax error at or near ";"
63 LINE 1: delete from;
64                    ^
65 -- no such relation
66 delete from nonesuch;
67 ERROR:  relation "nonesuch" does not exist
68 LINE 1: delete from nonesuch;
69                     ^
71 -- DROP
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
81 -- ALTER TABLE
82 -- relation renaming
83 -- missing relation name
84 alter table rename;
85 ERROR:  syntax error at or near ";"
86 LINE 1: alter table rename;
87                           ^
88 -- no such relation
89 alter table nonesuch rename to newnonesuch;
90 ERROR:  relation "nonesuch" does not exist
91 -- no such relation
92 alter table nonesuch rename to stud_emp;
93 ERROR:  relation "nonesuch" does not exist
94 -- conflict
95 alter table stud_emp rename to student;
96 ERROR:  relation "student" already exists
97 -- self-conflict
98 alter table stud_emp rename to stud_emp;
99 ERROR:  relation "stud_emp" already exists
100 -- attribute renaming
101 -- no such relation
102 alter table nonesuchrel rename column nonesuchatt to newnonesuchatt;
103 ERROR:  relation "nonesuchrel" does not exist
104 -- no such attribute
105 alter table emp rename column nonesuchatt to newnonesuchatt;
106 ERROR:  column "nonesuchatt" does not exist
107 -- conflict
108 alter table emp rename column salary to manager;
109 ERROR:  column "manager" of relation "stud_emp" already exists
110 -- conflict
111 alter table emp rename column salary to ctid;
112 ERROR:  column name "ctid" conflicts with a system column name
114 -- TRANSACTION STUFF
115 -- not in a xact
116 abort;
117 WARNING:  there is no transaction in progress
118 -- not in a xact
119 end;
120 WARNING:  there is no transaction in progress
122 -- CREATE AGGREGATE
123 -- sfunc/finalfunc type disagreement
124 create aggregate newavg2 (sfunc = int4pl,
125                           basetype = int4,
126                           stype = int4,
127                           finalfunc = int2um,
128                           initcond = '0');
129 ERROR:  function int2um(integer) does not exist
130 -- left out basetype
131 create aggregate newcnt1 (sfunc = int4inc,
132                           stype = int4,
133                           initcond = '0');
134 ERROR:  aggregate input type must be specified
136 -- DROP INDEX
137 -- missing index name
138 drop index;
139 ERROR:  syntax error at or near ";"
140 LINE 1: drop index;
141                   ^
142 -- bad index name
143 drop index 314159;
144 ERROR:  syntax error at or near "314159"
145 LINE 1: drop index 314159;
146                    ^
147 -- no such index
148 drop index nonesuch;
149 ERROR:  index "nonesuch" does not exist
151 -- DROP AGGREGATE
152 -- missing aggregate name
153 drop aggregate;
154 ERROR:  syntax error at or near ";"
155 LINE 1: drop aggregate;
156                       ^
157 -- missing aggregate type
158 drop aggregate newcnt1;
159 ERROR:  syntax error at or near ";"
160 LINE 1: drop aggregate newcnt1;
161                               ^
162 -- bad aggregate name
163 drop aggregate 314159 (int);
164 ERROR:  syntax error at or near "314159"
165 LINE 1: drop aggregate 314159 (int);
166                        ^
167 -- bad aggregate type
168 drop aggregate newcnt (nonesuch);
169 ERROR:  type "nonesuch" does not exist
170 -- no such aggregate
171 drop aggregate nonesuch (int4);
172 ERROR:  aggregate nonesuch(integer) does not exist
173 -- no such aggregate for type
174 drop aggregate newcnt (float4);
175 ERROR:  aggregate newcnt(real) does not exist
177 -- DROP FUNCTION
178 -- missing function name
179 drop function ();
180 ERROR:  syntax error at or near "("
181 LINE 1: drop function ();
182                       ^
183 -- bad function name
184 drop function 314159();
185 ERROR:  syntax error at or near "314159"
186 LINE 1: drop function 314159();
187                       ^
188 -- no such function
189 drop function nonesuch();
190 ERROR:  function nonesuch() does not exist
192 -- DROP TYPE
193 -- missing type name
194 drop type;
195 ERROR:  syntax error at or near ";"
196 LINE 1: drop type;
197                  ^
198 -- bad type name
199 drop type 314159;
200 ERROR:  syntax error at or near "314159"
201 LINE 1: drop type 314159;
202                   ^
203 -- no such type
204 drop type nonesuch;
205 ERROR:  type "nonesuch" does not exist
207 -- DROP OPERATOR
208 -- missing everything
209 drop operator;
210 ERROR:  syntax error at or near ";"
211 LINE 1: drop operator;
212                      ^
213 -- bad operator name
214 drop operator equals;
215 ERROR:  syntax error at or near ";"
216 LINE 1: drop operator equals;
217                             ^
218 -- missing type list
219 drop operator ===;
220 ERROR:  syntax error at or near ";"
221 LINE 1: drop operator ===;
222                          ^
223 -- missing parentheses
224 drop operator int4, int4;
225 ERROR:  syntax error at or near ","
226 LINE 1: drop operator int4, int4;
227                           ^
228 -- missing operator name
229 drop operator (int4, int4);
230 ERROR:  syntax error at or near "("
231 LINE 1: drop operator (int4, int4);
232                       ^
233 -- missing type list contents
234 drop operator === ();
235 ERROR:  syntax error at or near ")"
236 LINE 1: drop operator === ();
237                            ^
238 -- no such operator
239 drop operator === (int4);
240 ERROR:  missing argument
241 LINE 1: drop operator === (int4);
242                                ^
243 HINT:  Use NONE to denote the missing argument of a unary operator.
244 -- no such operator by that name
245 drop operator === (int4, int4);
246 ERROR:  operator does not exist: integer === integer
247 -- no such type1
248 drop operator = (nonesuch);
249 ERROR:  missing argument
250 LINE 1: drop operator = (nonesuch);
251                                  ^
252 HINT:  Use NONE to denote the missing argument of a unary operator.
253 -- no such type1
254 drop operator = ( , int4);
255 ERROR:  syntax error at or near ","
256 LINE 1: drop operator = ( , int4);
257                           ^
258 -- no such type1
259 drop operator = (nonesuch, int4);
260 ERROR:  type "nonesuch" does not exist
261 -- no such type2
262 drop operator = (int4, nonesuch);
263 ERROR:  type "nonesuch" does not exist
264 -- no such type2
265 drop operator = (int4, );
266 ERROR:  syntax error at or near ")"
267 LINE 1: drop operator = (int4, );
268                                ^
270 -- DROP RULE
271 -- missing rule name
272 drop rule;
273 ERROR:  syntax error at or near ";"
274 LINE 1: drop rule;
275                  ^
276 -- bad rule name
277 drop rule 314159;
278 ERROR:  syntax error at or near "314159"
279 LINE 1: drop rule 314159;
280                   ^
281 -- no such rule
282 drop rule nonesuch on noplace;
283 ERROR:  relation "noplace" does not exist
284 -- these postquel variants are no longer supported
285 drop tuple rule nonesuch;
286 ERROR:  syntax error at or near "tuple"
287 LINE 1: drop tuple rule nonesuch;
288              ^
289 drop instance rule nonesuch on noplace;
290 ERROR:  syntax error at or near "instance"
291 LINE 1: drop instance rule nonesuch on noplace;
292              ^
293 drop rewrite rule nonesuch;
294 ERROR:  syntax error at or near "rewrite"
295 LINE 1: drop rewrite rule nonesuch;
296              ^
298 -- Check that division-by-zero is properly caught.
300 select 1/0;
301 ERROR:  division by zero
302 select 1::int8/0;
303 ERROR:  division by zero
304 select 1/0::int8;
305 ERROR:  division by zero
306 select 1::int2/0;
307 ERROR:  division by zero
308 select 1/0::int2;
309 ERROR:  division by zero
310 select 1::numeric/0;
311 ERROR:  division by zero
312 select 1/0::numeric;
313 ERROR:  division by zero
314 select 1::float8/0;
315 ERROR:  division by zero
316 select 1/0::float8;
317 ERROR:  division by zero
318 select 1::float4/0;
319 ERROR:  division by zero
320 select 1/0::float4;
321 ERROR:  division by zero
323 -- Test psql's reporting of syntax error location
325 xxx;
326 ERROR:  syntax error at or near "xxx"
327 LINE 1: xxx;
328         ^
329 CREATE foo;
330 ERROR:  syntax error at or near "foo"
331 LINE 1: CREATE foo;
332                ^
333 CREATE TABLE ;
334 ERROR:  syntax error at or near ";"
335 LINE 1: CREATE TABLE ;
336                      ^
337 CREATE TABLE
339 ERROR:  syntax error at end of input
340 LINE 1: CREATE TABLE
341                     ^
342 INSERT INTO foo VALUES(123) foo;
343 ERROR:  syntax error at or near "foo"
344 LINE 1: INSERT INTO foo VALUES(123) foo;
345                                     ^
346 INSERT INTO 123
347 VALUES(123);
348 ERROR:  syntax error at or near "123"
349 LINE 1: INSERT INTO 123
350                     ^
351 INSERT INTO foo
352 VALUES(123) 123
354 ERROR:  syntax error at or near "123"
355 LINE 2: VALUES(123) 123
356                     ^
357 -- with a tab
358 CREATE TABLE foo
359   (id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY,
360         id3 INTEGER NOT NUL,
361    id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
362 ERROR:  syntax error at or near "NUL"
363 LINE 3:  id3 INTEGER NOT NUL,
364                          ^
365 -- long line to be truncated on the left
366 CREATE TABLE foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
367 id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQUE NOT NULL);
368 ERROR:  syntax error at or near "NUL"
369 LINE 1: ...OT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
370                                                                    ^
371 -- long line to be truncated on the right
372 CREATE TABLE foo(
373 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);
374 ERROR:  syntax error at or near "NUL"
375 LINE 2: id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQ...
376                         ^
377 -- long line to be truncated both ways
378 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);
379 ERROR:  syntax error at or near "NUL"
380 LINE 1: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
381                                                              ^
382 -- long line to be truncated on the left, many lines
383 CREATE
384 TEMPORARY
385 TABLE
386 foo(id INT4 UNIQUE NOT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
387 id4 INT4
388 UNIQUE
390 NULL,
391 id5 TEXT
392 UNIQUE
394 NULL)
396 ERROR:  syntax error at or near "NUL"
397 LINE 4: ...OT NULL, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL,
398                                                                    ^
399 -- long line to be truncated on the right, many lines
400 CREATE
401 TEMPORARY
402 TABLE
403 foo(
404 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)
406 ERROR:  syntax error at or near "NUL"
407 LINE 5: id3 INTEGER NOT NUL, id4 INT4 UNIQUE NOT NULL, id5 TEXT UNIQ...
408                         ^
409 -- long line to be truncated both ways, many lines
410 CREATE
411 TEMPORARY
412 TABLE
415 INT4
416 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,
417 idz INT4 UNIQUE NOT NULL,
418 idv INT4 UNIQUE NOT NULL);
419 ERROR:  syntax error at or near "NUL"
420 LINE 7: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
421                                                              ^
422 -- more than 10 lines...
423 CREATE
424 TEMPORARY
425 TABLE
428 INT4
429 UNIQUE
431 NULL
434 INT4
435 UNIQUE
437 NULL,
438 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,
439 idz INT4 UNIQUE NOT NULL,
441 INT4
442 UNIQUE
444 NULL);
445 ERROR:  syntax error at or near "NUL"
446 LINE 16: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
447                                                               ^