mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Replace LookupFuncNameTypeNames() with LookupFuncWithArgs()
The old function took function name and function argument list as separate arguments. Now that all function signatures are passed around as ObjectWithArgs structs, this is no longer necessary and can be replaced by a function that takes ObjectWithArgs directly. Similarly for aggregates and operators. Reviewed-by: Jim Nasby <Jim.Nasby@BlueTreble.com> Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
@ -475,19 +475,12 @@ DefineOpClass(CreateOpClassStmt *stmt)
|
||||
errmsg("invalid operator number %d,"
|
||||
" must be between 1 and %d",
|
||||
item->number, maxOpNumber)));
|
||||
if (item->args != NIL)
|
||||
{
|
||||
TypeName *typeName1 = (TypeName *) linitial(item->args);
|
||||
TypeName *typeName2 = (TypeName *) lsecond(item->args);
|
||||
|
||||
operOid = LookupOperNameTypeNames(NULL, item->name,
|
||||
typeName1, typeName2,
|
||||
false, -1);
|
||||
}
|
||||
if (item->name->objargs != NIL)
|
||||
operOid = LookupOperWithArgs(item->name, false);
|
||||
else
|
||||
{
|
||||
/* Default to binary op on input datatype */
|
||||
operOid = LookupOperName(NULL, item->name,
|
||||
operOid = LookupOperName(NULL, item->name->objname,
|
||||
typeoid, typeoid,
|
||||
false, -1);
|
||||
}
|
||||
@ -526,8 +519,7 @@ DefineOpClass(CreateOpClassStmt *stmt)
|
||||
errmsg("invalid procedure number %d,"
|
||||
" must be between 1 and %d",
|
||||
item->number, maxProcNumber)));
|
||||
funcOid = LookupFuncNameTypeNames(item->name, item->args,
|
||||
false);
|
||||
funcOid = LookupFuncWithArgs(item->name, false);
|
||||
#ifdef NOT_USED
|
||||
/* XXX this is unnecessary given the superuser check above */
|
||||
/* Caller must own function */
|
||||
@ -857,15 +849,8 @@ AlterOpFamilyAdd(AlterOpFamilyStmt *stmt, Oid amoid, Oid opfamilyoid,
|
||||
errmsg("invalid operator number %d,"
|
||||
" must be between 1 and %d",
|
||||
item->number, maxOpNumber)));
|
||||
if (item->args != NIL)
|
||||
{
|
||||
TypeName *typeName1 = (TypeName *) linitial(item->args);
|
||||
TypeName *typeName2 = (TypeName *) lsecond(item->args);
|
||||
|
||||
operOid = LookupOperNameTypeNames(NULL, item->name,
|
||||
typeName1, typeName2,
|
||||
false, -1);
|
||||
}
|
||||
if (item->name->objargs != NIL)
|
||||
operOid = LookupOperWithArgs(item->name, false);
|
||||
else
|
||||
{
|
||||
ereport(ERROR,
|
||||
@ -908,8 +893,7 @@ AlterOpFamilyAdd(AlterOpFamilyStmt *stmt, Oid amoid, Oid opfamilyoid,
|
||||
errmsg("invalid procedure number %d,"
|
||||
" must be between 1 and %d",
|
||||
item->number, maxProcNumber)));
|
||||
funcOid = LookupFuncNameTypeNames(item->name, item->args,
|
||||
false);
|
||||
funcOid = LookupFuncWithArgs(item->name, false);
|
||||
#ifdef NOT_USED
|
||||
/* XXX this is unnecessary given the superuser check above */
|
||||
/* Caller must own function */
|
||||
|
Reference in New Issue
Block a user