1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-12 02:37:31 +03:00

First bits of work on error message editing.

This commit is contained in:
Tom Lane
2003-07-18 23:20:33 +00:00
parent 44f665bf40
commit 216311d590
21 changed files with 1083 additions and 534 deletions

View File

@@ -775,7 +775,7 @@ select atacc1.* from atacc1;
select a from atacc1;
ERROR: Attribute "a" not found
select atacc1.a from atacc1;
ERROR: No such attribute atacc1.a
ERROR: no such attribute atacc1.a
select b,c,d from atacc1;
b | c | d
---+---+---
@@ -789,7 +789,7 @@ ERROR: Attribute "a" not found
select "........pg.dropped.1........" from atacc1;
ERROR: Attribute "........pg.dropped.1........" not found
select atacc1."........pg.dropped.1........" from atacc1;
ERROR: No such attribute atacc1.........pg.dropped.1........
ERROR: no such attribute atacc1.........pg.dropped.1........
select "........pg.dropped.1........",b,c,d from atacc1;
ERROR: Attribute "........pg.dropped.1........" not found
select * from atacc1 where "........pg.dropped.1........" = 1;

View File

@@ -19,22 +19,24 @@ CREATE FUNCTION int42_in(cstring)
RETURNS int42
AS 'int4in'
LANGUAGE 'internal' WITH (isStrict);
NOTICE: ProcedureCreate: type int42 is not yet defined
NOTICE: type int42 is not yet defined
DETAIL: Creating a shell type definition.
CREATE FUNCTION int42_out(int42)
RETURNS cstring
AS 'int4out'
LANGUAGE 'internal' WITH (isStrict);
NOTICE: Argument type "int42" is only a shell
NOTICE: argument type int42 is only a shell
CREATE FUNCTION text_w_default_in(cstring)
RETURNS text_w_default
AS 'textin'
LANGUAGE 'internal' WITH (isStrict);
NOTICE: ProcedureCreate: type text_w_default is not yet defined
NOTICE: type text_w_default is not yet defined
DETAIL: Creating a shell type definition.
CREATE FUNCTION text_w_default_out(text_w_default)
RETURNS cstring
AS 'textout'
LANGUAGE 'internal' WITH (isStrict);
NOTICE: Argument type "text_w_default" is only a shell
NOTICE: argument type text_w_default is only a shell
CREATE TYPE int42 (
internallength = 4,
input = int42_in,

View File

@@ -6,12 +6,12 @@ CREATE USER regressuser2;
CREATE USER regressuser3;
CREATE USER regressuser4;
CREATE USER regressuser4; -- duplicate
ERROR: CREATE USER: user name "regressuser4" already exists
ERROR: user "regressuser4" already exists
CREATE GROUP regressgroup1;
CREATE GROUP regressgroup2 WITH USER regressuser1, regressuser2;
ALTER GROUP regressgroup1 ADD USER regressuser4;
ALTER GROUP regressgroup2 ADD USER regressuser2; -- duplicate
WARNING: ALTER GROUP: user "regressuser2" is already in group "regressgroup2"
WARNING: user "regressuser2" is already in group "regressgroup2"
ALTER GROUP regressgroup2 DROP USER regressuser2;
ALTER GROUP regressgroup2 ADD USER regressuser4;
-- test owner privileges

View File

@@ -5,22 +5,24 @@ CREATE FUNCTION widget_in(cstring)
RETURNS widget
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
NOTICE: ProcedureCreate: type widget is not yet defined
NOTICE: type widget is not yet defined
DETAIL: Creating a shell type definition.
CREATE FUNCTION widget_out(widget)
RETURNS cstring
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
NOTICE: Argument type "widget" is only a shell
NOTICE: argument type widget is only a shell
CREATE FUNCTION int44in(cstring)
RETURNS city_budget
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
NOTICE: ProcedureCreate: type city_budget is not yet defined
NOTICE: type city_budget is not yet defined
DETAIL: Creating a shell type definition.
CREATE FUNCTION int44out(city_budget)
RETURNS cstring
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
NOTICE: Argument type "city_budget" is only a shell
NOTICE: argument type city_budget is only a shell
CREATE FUNCTION check_primary_key ()
RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
@@ -48,25 +50,27 @@ CREATE FUNCTION set_ttdummy (int4)
-- Things that shouldn't work:
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
AS 'SELECT ''not an integer'';';
ERROR: return type mismatch in function: declared to return integer, returns "unknown"
ERROR: return type mismatch in function declared to return integer
DETAIL: Actual return type is "unknown".
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
AS 'not even SQL';
ERROR: syntax error at or near "not" at character 1
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
AS 'SELECT 1, 2, 3;';
ERROR: function declared to return integer returns multiple columns in final SELECT
ERROR: return type mismatch in function declared to return integer
DETAIL: Final SELECT must return exactly one column.
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
AS 'SELECT $2;';
ERROR: Parameter '$2' is out of range
ERROR: there is no parameter $2
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
AS 'a', 'b';
ERROR: CREATE FUNCTION: only one AS item needed for sql language
ERROR: only one AS item needed for language "sql"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE c
AS 'nosuchfile';
ERROR: stat failed on file 'nosuchfile': No such file or directory
ERROR: could not access file "nosuchfile": No such file or directory
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE c
AS '@abs_builddir@/regress@DLSUFFIX@', 'nosuchsymbol';
ERROR: Can't find function nosuchsymbol in file @abs_builddir@/regress@DLSUFFIX@
ERROR: could not find function "nosuchsymbol" in file "@abs_builddir@/regress@DLSUFFIX@"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE internal
AS 'nosuch';
ERROR: there is no built-in function named "nosuch"