diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index b051707..04013b6 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -554,6 +554,24 @@ func_match_argtypes(int nargs, } } + if (ncandidates == 0) + { + /* try again with assignment rules */ + for (current_candidate = raw_candidates; + current_candidate != NULL; + current_candidate = next_candidate) + { + next_candidate = current_candidate->next; + if (can_coerce_type(nargs, input_typeids, current_candidate->args, + COERCION_ASSIGNMENT)) + { + current_candidate->next = *candidates; + *candidates = current_candidate; + ncandidates++; + } + } + } + return ncandidates; } /* func_match_argtypes() */ @@ -1354,7 +1372,7 @@ make_fn_arguments(ParseState *pstate, (Node *) na->arg, actual_arg_types[i], declared_arg_types[i], -1, - COERCION_IMPLICIT, + COERCION_ASSIGNMENT, COERCE_IMPLICIT_CAST, -1); na->arg = (Expr *) node; @@ -1365,7 +1383,7 @@ make_fn_arguments(ParseState *pstate, node, actual_arg_types[i], declared_arg_types[i], -1, - COERCION_IMPLICIT, + COERCION_ASSIGNMENT, COERCE_IMPLICIT_CAST, -1); lfirst(current_fargs) = node;