index 599f04242f3eabd95ddec8522842c853148d9ac4..ac53b09af6badb6326c5c32ea621adab283b3555 100644 (file)
@@ -404,7 +404,8 @@ ProcedureCreate(const char *procedureName,
ereport(ERROR,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
errmsg("cannot change return type of existing function"),
- errhint("Use DROP FUNCTION first.")));
+ errhint("Use DROP FUNCTION %s first.",
+ format_procedure(HeapTupleGetOid(oldtup)))));
/*
* If it returns RECORD, check for possible change of record type
@@ -427,7 +428,8 @@ ProcedureCreate(const char *procedureName,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
errmsg("cannot change return type of existing function"),
errdetail("Row type defined by OUT parameters is different."),
- errhint("Use DROP FUNCTION first.")));
+ errhint("Use DROP FUNCTION %s first.",
+ format_procedure(HeapTupleGetOid(oldtup)))));
}
/*
@@ -469,7 +471,8 @@ ProcedureCreate(const char *procedureName,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
errmsg("cannot change name of input parameter \"%s\"",
old_arg_names[j]),
- errhint("Use DROP FUNCTION first.")));
+ errhint("Use DROP FUNCTION %s first.",
+ format_procedure(HeapTupleGetOid(oldtup)))));
}
}
@@ -492,7 +495,8 @@ ProcedureCreate(const char *procedureName,
ereport(ERROR,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
errmsg("cannot remove parameter defaults from existing function"),
- errhint("Use DROP FUNCTION first.")));
+ errhint("Use DROP FUNCTION %s first.",
+ format_procedure(HeapTupleGetOid(oldtup)))));
proargdefaults = SysCacheGetAttr(PROCNAMEARGSNSP, oldtup,
Anum_pg_proc_proargdefaults,
@@ -518,7 +522,8 @@ ProcedureCreate(const char *procedureName,
ereport(ERROR,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
errmsg("cannot change data type of existing parameter default value"),
- errhint("Use DROP FUNCTION first.")));
+ errhint("Use DROP FUNCTION %s first.",
+ format_procedure(HeapTupleGetOid(oldtup)))));
newlc = lnext(newlc);
}
}
index 1e879532f870c58a090cfec00df686b4bbe1981d..a65e3b998f9a5d627bbffbf7a6231ccada4bf6de 100644 (file)
create or replace function dfunc(a variadic int[]) returns int as
$$ select array_upper(1,ドル 1) $$ language sql;
ERROR: cannot remove parameter defaults from existing function
-HINT: Use DROP FUNCTION first.
+HINT: Use DROP FUNCTION dfunc(integer[]) first.
\df dfunc
List of functions
Schema | Name | Result data type | Argument data types | Type
select 1,ドル 2ドル;
$$ language sql;
ERROR: cannot change name of input parameter "c"
-HINT: Use DROP FUNCTION first.
+HINT: Use DROP FUNCTION dfunc(character varying,numeric) first.
create or replace function dfunc(a varchar = 'def a', out _a varchar, numeric = NULL, out _c numeric)
returns record as $$
select 1,ドル 2ドル;
$$ language sql;
ERROR: cannot change name of input parameter "c"
-HINT: Use DROP FUNCTION first.
+HINT: Use DROP FUNCTION dfunc(character varying,numeric) first.
drop function dfunc(varchar, numeric);
--fail, named parameters are not unique
create function testfoo(a int, a int) returns int as $$ select 1;$$ language sql;
index 5f20c9324975eda8e52c730f621a76edf708a4bf..9fbdd83f6749a97a8bbc2349e705ceb75b62f078 100644 (file)
@@ -439,7 +439,7 @@ CREATE OR REPLACE FUNCTION foo(in f1 int, out f2 int, out f3 text)
RETURNS record
AS 'select 1ドル+1' LANGUAGE sql;
ERROR: cannot change return type of existing function
-HINT: Use DROP FUNCTION first.
+HINT: Use DROP FUNCTION foo(integer) first.
CREATE OR REPLACE FUNCTION foor(in f1 int, out f2 int, out text)
AS $$select 1ドル-1, 1ドル::text || 'z'$$ LANGUAGE sql;
SELECT f1, foor(f1) FROM int4_tbl;
CREATE OR REPLACE FUNCTION dup (inout f2 anyelement, out f3 anyarray)
AS 'select 1,ドル array[1,ドル1ドル]' LANGUAGE sql;
ERROR: cannot change name of input parameter "f1"
-HINT: Use DROP FUNCTION first.
+HINT: Use DROP FUNCTION dup(anyelement) first.
DROP FUNCTION dup(anyelement);
-- equivalent behavior, though different name exposed for input arg
CREATE OR REPLACE FUNCTION dup (inout f2 anyelement, out f3 anyarray)