58 Oid targetTypeId,
int32 targetTypeMod,
69 const Oid *paramTypes,
int numParams)
85 Oid **paramTypes,
int *numParams)
103 int paramno = pref->
number;
107 if (paramno <= 0 || paramno > parstate->
numParams ||
110 (
errcode(ERRCODE_UNDEFINED_PARAMETER),
111 errmsg(
"there is no parameter $%d", paramno),
116 param->paramid = paramno;
117 param->paramtype = parstate->
paramTypes[paramno - 1];
118 param->paramtypmod = -1;
122 return (
Node *) param;
135 int paramno = pref->
number;
142 (
errcode(ERRCODE_UNDEFINED_PARAMETER),
143 errmsg(
"there is no parameter $%d", paramno),
157 pptype = &(*parstate->
paramTypes)[paramno - 1];
161 *pptype = UNKNOWNOID;
170 *pptype = UNKNOWNOID;
174 param->paramid = paramno;
175 param->paramtype = *pptype;
176 param->paramtypmod = -1;
180 return (
Node *) param;
188 Oid targetTypeId,
int32 targetTypeMod,
204 (
errcode(ERRCODE_UNDEFINED_PARAMETER),
205 errmsg(
"there is no parameter $%d", paramno),
208 if (paramTypes[paramno - 1] == UNKNOWNOID)
211 paramTypes[paramno - 1] = targetTypeId;
213 else if (paramTypes[paramno - 1] == targetTypeId)
221 (
errcode(ERRCODE_AMBIGUOUS_PARAMETER),
222 errmsg(
"inconsistent types deduced for parameter $%d",
239 param->paramtypmod = -1;
250 (param->
location < 0 || location < param->location))
253 return (
Node *) param;
303 (
errcode(ERRCODE_UNDEFINED_PARAMETER),
304 errmsg(
"there is no parameter $%d", paramno),
309 (
errcode(ERRCODE_AMBIGUOUS_PARAMETER),
310 errmsg(
"could not determine data type of parameter $%d",
#define OidIsValid(objectId)
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define palloc0_array(type, count)
if(TABLE==NULL||TABLE_index==NULL)
Oid get_typcollation(Oid typid)
#define query_tree_walker(q, w, c, f)
#define expression_tree_walker(n, w, c)
#define IsA(nodeptr, _type_)
#define repalloc0_array(pointer, type, oldcount, count)
int parser_errposition(ParseState *pstate, int location)
@ EXPR_KIND_CALL_ARGUMENT
void check_variable_parameters(ParseState *pstate, Query *query)
struct FixedParamState FixedParamState
bool query_contains_extern_params(Query *query)
void setup_parse_variable_parameters(ParseState *pstate, Oid **paramTypes, int *numParams)
static Node * variable_coerce_param_hook(ParseState *pstate, Param *param, Oid targetTypeId, int32 targetTypeMod, int location)
static Node * variable_paramref_hook(ParseState *pstate, ParamRef *pref)
void setup_parse_fixed_parameters(ParseState *pstate, const Oid *paramTypes, int numParams)
struct VarParamState VarParamState
static Node * fixed_paramref_hook(ParseState *pstate, ParamRef *pref)
static bool check_parameter_resolution_walker(Node *node, ParseState *pstate)
static bool query_contains_extern_params_walker(Node *node, void *context)
ParseExprKind p_expr_kind
ParseParamRefHook p_paramref_hook
CoerceParamHook p_coerce_param_hook