PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
parse_param.h File Reference
Include dependency graph for parse_param.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


void parse_fixed_parameters (ParseState *pstate, Oid *paramTypes, int numParams)
void parse_variable_parameters (ParseState *pstate, Oid **paramTypes, int *numParams)
void check_variable_parameters (ParseState *pstate, Query *query)
bool query_contains_extern_params (Query *query)

Function Documentation

void check_variable_parameters ( ParseState pstate,
Query query 

Definition at line 263 of file parse_param.c.

References check_parameter_resolution_walker(), VarParamState::numParams, ParseState::p_ref_hook_state, and query_tree_walker().

Referenced by parse_analyze_varparams().

264 {
265  VarParamState *parstate = (VarParamState *) pstate->p_ref_hook_state;
267  /* If numParams is zero then no Params were generated, so no work */
268  if (*parstate->numParams > 0)
269  (void) query_tree_walker(query,
271  (void *) pstate, 0);
272 }
bool query_tree_walker(Query *query, bool(*walker)(), void *context, int flags)
Definition: nodeFuncs.c:2246
int * numParams
Definition: parse_param.c:51
static bool check_parameter_resolution_walker(Node *node, ParseState *pstate)
Definition: parse_param.c:281
void * p_ref_hook_state
Definition: parse_node.h:214
void parse_fixed_parameters ( ParseState pstate,
Oid paramTypes,
int  numParams 

Definition at line 67 of file parse_param.c.

References fixed_paramref_hook(), FixedParamState::numParams, ParseState::p_paramref_hook, ParseState::p_ref_hook_state, palloc(), and FixedParamState::paramTypes.

Referenced by parse_analyze().

69 {
70  FixedParamState *parstate = palloc(sizeof(FixedParamState));
72  parstate->paramTypes = paramTypes;
73  parstate->numParams = numParams;
74  pstate->p_ref_hook_state = (void *) parstate;
76  /* no need to use p_coerce_param_hook */
77 }
static Node * fixed_paramref_hook(ParseState *pstate, ParamRef *pref)
Definition: parse_param.c:99
ParseParamRefHook p_paramref_hook
Definition: parse_node.h:212
void * p_ref_hook_state
Definition: parse_node.h:214
void * palloc(Size size)
Definition: mcxt.c:849
void parse_variable_parameters ( ParseState pstate,
Oid **  paramTypes,
int *  numParams 

Definition at line 83 of file parse_param.c.

References VarParamState::numParams, ParseState::p_coerce_param_hook, ParseState::p_paramref_hook, ParseState::p_ref_hook_state, palloc(), VarParamState::paramTypes, variable_coerce_param_hook(), and variable_paramref_hook().

Referenced by parse_analyze_varparams().

85 {
86  VarParamState *parstate = palloc(sizeof(VarParamState));
88  parstate->paramTypes = paramTypes;
89  parstate->numParams = numParams;
90  pstate->p_ref_hook_state = (void *) parstate;
93 }
Oid ** paramTypes
Definition: parse_param.c:50
static Node * variable_coerce_param_hook(ParseState *pstate, Param *param, Oid targetTypeId, int32 targetTypeMod, int location)
Definition: parse_param.c:181
CoerceParamHook p_coerce_param_hook
Definition: parse_node.h:213
int * numParams
Definition: parse_param.c:51
ParseParamRefHook p_paramref_hook
Definition: parse_node.h:212
static Node * variable_paramref_hook(ParseState *pstate, ParamRef *pref)
Definition: parse_param.c:131
void * p_ref_hook_state
Definition: parse_node.h:214
void * palloc(Size size)
Definition: mcxt.c:849
bool query_contains_extern_params ( Query query)

Definition at line 325 of file parse_param.c.

References NULL, query_contains_extern_params_walker(), and query_tree_walker().

Referenced by transformCreateTableAsStmt().

326 {
327  return query_tree_walker(query,
329  NULL, 0);
330 }
bool query_tree_walker(Query *query, bool(*walker)(), void *context, int flags)
Definition: nodeFuncs.c:2246
static bool query_contains_extern_params_walker(Node *node, void *context)
Definition: parse_param.c:333
#define NULL
Definition: c.h:229