mirror of
https://github.com/postgres/postgres.git
synced 2026-03-02 21:30:36 -05:00
Generate distinct error messages for trigger function not found
and trigger function found but returns wrong type.
This commit is contained in:
parent
443c08a110
commit
33773af95b
1 changed files with 5 additions and 3 deletions
|
|
@ -138,10 +138,12 @@ CreateTrigger(CreateTrigStmt *stmt)
|
|||
PointerGetDatum(fargtypes),
|
||||
0);
|
||||
if (!HeapTupleIsValid(tuple) ||
|
||||
((Form_pg_proc) GETSTRUCT(tuple))->prorettype != 0 ||
|
||||
((Form_pg_proc) GETSTRUCT(tuple))->pronargs != 0)
|
||||
elog(ERROR, "CreateTrigger: function %s () does not exist", stmt->funcname);
|
||||
|
||||
elog(ERROR, "CreateTrigger: function %s() does not exist",
|
||||
stmt->funcname);
|
||||
if (((Form_pg_proc) GETSTRUCT(tuple))->prorettype != 0)
|
||||
elog(ERROR, "CreateTrigger: function %s() must return OPAQUE",
|
||||
stmt->funcname);
|
||||
if (((Form_pg_proc) GETSTRUCT(tuple))->prolang != ClanguageId)
|
||||
{
|
||||
HeapTuple langTup;
|
||||
|
|
|
|||
Loading…
Reference in a new issue