From 2ca64c6f7105f97ce886bdbbd880f50225bf24ba Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 28 Dec 2016 12:00:00 -0500 Subject: 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 Reviewed-by: Michael Paquier --- src/include/nodes/parsenodes.h | 7 ++----- src/include/parser/parse_func.h | 4 ++-- src/include/parser/parse_oper.h | 5 ++--- 3 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src/include') diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 7c7530bd3f1..956f99830ca 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -2418,9 +2418,7 @@ typedef struct CreateOpClassItem { NodeTag type; int itemtype; /* see codes above */ - /* fields used for an operator or function item: */ - List *name; /* operator or function name */ - List *args; /* argument types */ + ObjectWithArgs *name; /* operator or function name and args */ int number; /* strategy num or support proc num */ List *order_family; /* only used for ordering operators */ List *class_args; /* amproclefttype/amprocrighttype or @@ -2730,8 +2728,7 @@ typedef struct AlterOwnerStmt typedef struct AlterOperatorStmt { NodeTag type; - List *opername; /* operator name */ - List *operargs; /* operator's argument TypeNames */ + ObjectWithArgs *opername; /* operator name and argument types */ List *options; /* List of DefElem nodes */ } AlterOperatorStmt; diff --git a/src/include/parser/parse_func.h b/src/include/parser/parse_func.h index 1c914065c08..8ccf7a95383 100644 --- a/src/include/parser/parse_func.h +++ b/src/include/parser/parse_func.h @@ -62,9 +62,9 @@ extern const char *func_signature_string(List *funcname, int nargs, extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError); -extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes, +extern Oid LookupFuncWithArgs(ObjectWithArgs *func, bool noError); -extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes, +extern Oid LookupAggWithArgs(ObjectWithArgs *agg, bool noError); extern void check_srf_call_placement(ParseState *pstate, int location); diff --git a/src/include/parser/parse_oper.h b/src/include/parser/parse_oper.h index b8d46637bec..a8f75b5921e 100644 --- a/src/include/parser/parse_oper.h +++ b/src/include/parser/parse_oper.h @@ -15,6 +15,7 @@ #define PARSE_OPER_H #include "access/htup.h" +#include "nodes/parsenodes.h" #include "parser/parse_node.h" @@ -24,9 +25,7 @@ typedef HeapTuple Operator; extern Oid LookupOperName(ParseState *pstate, List *opername, Oid oprleft, Oid oprright, bool noError, int location); -extern Oid LookupOperNameTypeNames(ParseState *pstate, List *opername, - TypeName *oprleft, TypeName *oprright, - bool noError, int location); +extern Oid LookupOperWithArgs(ObjectWithArgs *oper, bool noError); /* Routines to find operators matching a name and given input types */ /* NB: the selected operator may require coercion of the input types! */ -- cgit v1.2.3