PostgreSQL Source Code  git master
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.

Functions

void setup_parse_fixed_parameters (ParseState *pstate, const Oid *paramTypes, int numParams)
 
void setup_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

◆ check_variable_parameters()

void check_variable_parameters ( ParseState pstate,
Query query 
)

Definition at line 269 of file parse_param.c.

270 {
271  VarParamState *parstate = (VarParamState *) pstate->p_ref_hook_state;
272 
273  /* If numParams is zero then no Params were generated, so no work */
274  if (*parstate->numParams > 0)
275  (void) query_tree_walker(query,
277  (void *) pstate, 0);
278 }
if(TABLE==NULL||TABLE_index==NULL)
Definition: isn.c:77
#define query_tree_walker(q, w, c, f)
Definition: nodeFuncs.h:158
static bool check_parameter_resolution_walker(Node *node, ParseState *pstate)
Definition: parse_param.c:287
void * p_ref_hook_state
Definition: parse_node.h:242
int * numParams
Definition: parse_param.c:52

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

Referenced by parse_analyze_varparams(), and transformExplainStmt().

◆ query_contains_extern_params()

bool query_contains_extern_params ( Query query)

Definition at line 331 of file parse_param.c.

332 {
333  return query_tree_walker(query,
335  NULL, 0);
336 }
static bool query_contains_extern_params_walker(Node *node, void *context)
Definition: parse_param.c:339

References query_contains_extern_params_walker(), and query_tree_walker.

Referenced by transformCreateTableAsStmt().

◆ setup_parse_fixed_parameters()

void setup_parse_fixed_parameters ( ParseState pstate,
const Oid paramTypes,
int  numParams 
)

Definition at line 68 of file parse_param.c.

70 {
71  FixedParamState *parstate = palloc(sizeof(FixedParamState));
72 
73  parstate->paramTypes = paramTypes;
74  parstate->numParams = numParams;
75  pstate->p_ref_hook_state = (void *) parstate;
77  /* no need to use p_coerce_param_hook */
78 }
void * palloc(Size size)
Definition: mcxt.c:1317
static Node * fixed_paramref_hook(ParseState *pstate, ParamRef *pref)
Definition: parse_param.c:100
const Oid * paramTypes
Definition: parse_param.c:39
ParseParamRefHook p_paramref_hook
Definition: parse_node.h:240

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

Referenced by parse_analyze_fixedparams().

◆ setup_parse_variable_parameters()

void setup_parse_variable_parameters ( ParseState pstate,
Oid **  paramTypes,
int *  numParams 
)

Definition at line 84 of file parse_param.c.

86 {
87  VarParamState *parstate = palloc(sizeof(VarParamState));
88 
89  parstate->paramTypes = paramTypes;
90  parstate->numParams = numParams;
91  pstate->p_ref_hook_state = (void *) parstate;
94 }
static Node * variable_coerce_param_hook(ParseState *pstate, Param *param, Oid targetTypeId, int32 targetTypeMod, int location)
Definition: parse_param.c:187
static Node * variable_paramref_hook(ParseState *pstate, ParamRef *pref)
Definition: parse_param.c:132
CoerceParamHook p_coerce_param_hook
Definition: parse_node.h:241
Oid ** paramTypes
Definition: parse_param.c:51

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(), and transformExplainStmt().