PostgreSQL Source Code git master
Loading...
Searching...
No Matches
nodes.h File Reference
#include "nodes/nodetags.h"
Include dependency graph for nodes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Node
 

Macros

#define pg_node_attr(...)
 
#define nodeTag(nodeptr)   (((const Node*)(nodeptr))->type)
 
#define makeNode(_type_)   ((_type_ *) newNode(sizeof(_type_),T_##_type_))
 
#define NodeSetTag(nodeptr, t)   (((Node*)(nodeptr))->type = (t))
 
#define IsA(nodeptr, _type_)   (nodeTag(nodeptr) == T_##_type_)
 
#define castNode(_type_, nodeptr)   ((_type_ *) (nodeptr))
 
#define copyObject(obj)   copyObjectImpl(obj)
 
#define IS_OUTER_JOIN(jointype)
 
#define AGGSPLITOP_COMBINE   0x01 /* substitute combinefn for transfn */
 
#define AGGSPLITOP_SKIPFINAL   0x02 /* skip finalfn, return state as-is */
 
#define AGGSPLITOP_SERIALIZE   0x04 /* apply serialfn to output */
 
#define AGGSPLITOP_DESERIALIZE   0x08 /* apply deserialfn to input */
 
#define DO_AGGSPLIT_COMBINE(as)   (((as) & AGGSPLITOP_COMBINE) != 0)
 
#define DO_AGGSPLIT_SKIPFINAL(as)   (((as) & AGGSPLITOP_SKIPFINAL) != 0)
 
#define DO_AGGSPLIT_SERIALIZE(as)   (((as) & AGGSPLITOP_SERIALIZE) != 0)
 
#define DO_AGGSPLIT_DESERIALIZE(as)   (((as) & AGGSPLITOP_DESERIALIZE) != 0)
 

Typedefs

typedef enum NodeTag NodeTag
 
typedef struct Node Node
 
typedef int ParseLoc
 
typedef double Selectivity
 
typedef double Cost
 
typedef double Cardinality
 
typedef enum CmdType CmdType
 
typedef enum JoinType JoinType
 
typedef enum AggStrategy AggStrategy
 
typedef enum AggSplit AggSplit
 
typedef enum SetOpCmd SetOpCmd
 
typedef enum SetOpStrategy SetOpStrategy
 
typedef enum OnConflictAction OnConflictAction
 
typedef enum LimitOption LimitOption
 

Enumerations

enum  NodeTag { T_Invalid = 0 }
 
enum  CmdType {
  CMD_UNKNOWN , CMD_SELECT , CMD_UPDATE , CMD_INSERT ,
  CMD_DELETE , CMD_MERGE , CMD_UTILITY , CMD_NOTHING
}
 
enum  JoinType {
  JOIN_INNER , JOIN_LEFT , JOIN_FULL , JOIN_RIGHT ,
  JOIN_SEMI , JOIN_ANTI , JOIN_RIGHT_SEMI , JOIN_RIGHT_ANTI ,
  JOIN_UNIQUE_OUTER , JOIN_UNIQUE_INNER
}
 
enum  AggStrategy { AGG_PLAIN , AGG_SORTED , AGG_HASHED , AGG_MIXED }
 
enum  AggSplit { AGGSPLIT_SIMPLE = 0 , AGGSPLIT_INITIAL_SERIAL = AGGSPLITOP_SKIPFINAL | AGGSPLITOP_SERIALIZE , AGGSPLIT_FINAL_DESERIAL = AGGSPLITOP_COMBINE | AGGSPLITOP_DESERIALIZE }
 
enum  SetOpCmd { SETOPCMD_INTERSECT , SETOPCMD_INTERSECT_ALL , SETOPCMD_EXCEPT , SETOPCMD_EXCEPT_ALL }
 
enum  SetOpStrategy { SETOP_SORTED , SETOP_HASHED }
 
enum  OnConflictAction { ONCONFLICT_NONE , ONCONFLICT_NOTHING , ONCONFLICT_UPDATE }
 
enum  LimitOption { LIMIT_OPTION_COUNT , LIMIT_OPTION_WITH_TIES }
 

Functions

static NodenewNode (size_t size, NodeTag tag)
 
void outNode (struct StringInfoData *str, const void *obj)
 
void outToken (struct StringInfoData *str, const char *s)
 
void outBitmapset (struct StringInfoData *str, const struct Bitmapset *bms)
 
void outDatum (struct StringInfoData *str, Datum value, int typlen, bool typbyval)
 
charnodeToString (const void *obj)
 
charnodeToStringWithLocations (const void *obj)
 
charbmsToString (const struct Bitmapset *bms)
 
voidstringToNode (const char *str)
 
struct BitmapsetreadBitmapset (void)
 
Datum readDatum (bool typbyval)
 
boolreadBoolCols (int numCols)
 
intreadIntCols (int numCols)
 
OidreadOidCols (int numCols)
 
int16readAttrNumberCols (int numCols)
 
voidcopyObjectImpl (const void *from)
 
bool equal (const void *a, const void *b)
 

Macro Definition Documentation

◆ AGGSPLITOP_COMBINE

#define AGGSPLITOP_COMBINE   0x01 /* substitute combinefn for transfn */

Definition at line 378 of file nodes.h.

◆ AGGSPLITOP_DESERIALIZE

#define AGGSPLITOP_DESERIALIZE   0x08 /* apply deserialfn to input */

Definition at line 381 of file nodes.h.

◆ AGGSPLITOP_SERIALIZE

#define AGGSPLITOP_SERIALIZE   0x04 /* apply serialfn to output */

Definition at line 380 of file nodes.h.

◆ AGGSPLITOP_SKIPFINAL

#define AGGSPLITOP_SKIPFINAL   0x02 /* skip finalfn, return state as-is */

Definition at line 379 of file nodes.h.

◆ castNode

#define castNode (   _type_,
  nodeptr 
)    ((_type_ *) (nodeptr))

Definition at line 182 of file nodes.h.

◆ copyObject

#define copyObject (   obj)    copyObjectImpl(obj)

Definition at line 232 of file nodes.h.

◆ DO_AGGSPLIT_COMBINE

#define DO_AGGSPLIT_COMBINE (   as)    (((as) & AGGSPLITOP_COMBINE) != 0)

Definition at line 395 of file nodes.h.

◆ DO_AGGSPLIT_DESERIALIZE

#define DO_AGGSPLIT_DESERIALIZE (   as)    (((as) & AGGSPLITOP_DESERIALIZE) != 0)

Definition at line 398 of file nodes.h.

◆ DO_AGGSPLIT_SERIALIZE

#define DO_AGGSPLIT_SERIALIZE (   as)    (((as) & AGGSPLITOP_SERIALIZE) != 0)

Definition at line 397 of file nodes.h.

◆ DO_AGGSPLIT_SKIPFINAL

#define DO_AGGSPLIT_SKIPFINAL (   as)    (((as) & AGGSPLITOP_SKIPFINAL) != 0)

Definition at line 396 of file nodes.h.

◆ IS_OUTER_JOIN

#define IS_OUTER_JOIN (   jointype)
Value:
(((1 << (jointype)) & \
((1 << JOIN_LEFT) | \
(1 << JOIN_FULL) | \
(1 << JOIN_RIGHT) | \
(1 << JOIN_ANTI) | \
(1 << JOIN_RIGHT_ANTI))) != 0)
@ JOIN_FULL
Definition nodes.h:305
@ JOIN_RIGHT
Definition nodes.h:306
@ JOIN_LEFT
Definition nodes.h:304
@ JOIN_RIGHT_ANTI
Definition nodes.h:320
@ JOIN_ANTI
Definition nodes.h:318

Definition at line 348 of file nodes.h.

362{
363 AGG_PLAIN, /* simple agg across all input rows */
364 AGG_SORTED, /* grouped agg, input must be sorted */
365 AGG_HASHED, /* grouped agg, use internal hashtable */
366 AGG_MIXED, /* grouped agg, hash and sort both used */
368
369/*
370 * AggSplit -
371 * splitting (partial aggregation) modes for Agg plan nodes
372 *
373 * This is needed in both pathnodes.h and plannodes.h, so put it here...
374 */
375
376/* Primitive options supported by nodeAgg.c: */
377#define AGGSPLITOP_COMBINE 0x01 /* substitute combinefn for transfn */
378#define AGGSPLITOP_SKIPFINAL 0x02 /* skip finalfn, return state as-is */
379#define AGGSPLITOP_SERIALIZE 0x04 /* apply serialfn to output */
380#define AGGSPLITOP_DESERIALIZE 0x08 /* apply deserialfn to input */
381
382/* Supported operating modes (i.e., useful combinations of these options): */
383typedef enum AggSplit
384{
385 /* Basic, non-split aggregation: */
386 AGGSPLIT_SIMPLE = 0,
387 /* Initial phase of partial aggregation, with serialization: */
389 /* Final phase of partial aggregation, with deserialization: */
391} AggSplit;
392
393/* Test whether an AggSplit value selects each primitive option: */
394#define DO_AGGSPLIT_COMBINE(as) (((as) & AGGSPLITOP_COMBINE) != 0)
395#define DO_AGGSPLIT_SKIPFINAL(as) (((as) & AGGSPLITOP_SKIPFINAL) != 0)
396#define DO_AGGSPLIT_SERIALIZE(as) (((as) & AGGSPLITOP_SERIALIZE) != 0)
397#define DO_AGGSPLIT_DESERIALIZE(as) (((as) & AGGSPLITOP_DESERIALIZE) != 0)
398
399/*
400 * SetOpCmd and SetOpStrategy -
401 * overall semantics and execution strategies for SetOp plan nodes
402 *
403 * This is needed in both pathnodes.h and plannodes.h, so put it here...
404 */
405typedef enum SetOpCmd
406{
411} SetOpCmd;
412
413typedef enum SetOpStrategy
414{
415 SETOP_SORTED, /* input must be sorted */
416 SETOP_HASHED, /* use internal hashtable */
418
419/*
420 * OnConflictAction -
421 * "ON CONFLICT" clause type of query
422 *
423 * This is needed in both parsenodes.h and plannodes.h, so put it here...
424 */
425typedef enum OnConflictAction
426{
427 ONCONFLICT_NONE, /* No "ON CONFLICT" clause */
428 ONCONFLICT_NOTHING, /* ON CONFLICT ... DO NOTHING */
429 ONCONFLICT_UPDATE, /* ON CONFLICT ... DO UPDATE */
431
432/*
433 * LimitOption -
434 * LIMIT option of query
435 *
436 * This is needed in both parsenodes.h and plannodes.h, so put it here...
437 */
438typedef enum LimitOption
439{
440 LIMIT_OPTION_COUNT, /* FETCH FIRST... ONLY */
441 LIMIT_OPTION_WITH_TIES, /* FETCH FIRST... WITH TIES */
443
444#endif /* NODES_H */
SetOpCmd
Definition nodes.h:407
@ SETOPCMD_EXCEPT
Definition nodes.h:410
@ SETOPCMD_EXCEPT_ALL
Definition nodes.h:411
@ SETOPCMD_INTERSECT_ALL
Definition nodes.h:409
@ SETOPCMD_INTERSECT
Definition nodes.h:408
SetOpStrategy
Definition nodes.h:415
@ SETOP_HASHED
Definition nodes.h:417
@ SETOP_SORTED
Definition nodes.h:416
#define AGGSPLITOP_DESERIALIZE
Definition nodes.h:381
#define AGGSPLITOP_SKIPFINAL
Definition nodes.h:379
OnConflictAction
Definition nodes.h:427
@ ONCONFLICT_NONE
Definition nodes.h:428
@ ONCONFLICT_UPDATE
Definition nodes.h:430
@ ONCONFLICT_NOTHING
Definition nodes.h:429
#define AGGSPLITOP_SERIALIZE
Definition nodes.h:380
AggStrategy
Definition nodes.h:363
@ AGG_SORTED
Definition nodes.h:365
@ AGG_HASHED
Definition nodes.h:366
@ AGG_MIXED
Definition nodes.h:367
@ AGG_PLAIN
Definition nodes.h:364
AggSplit
Definition nodes.h:385
@ AGGSPLIT_FINAL_DESERIAL
Definition nodes.h:391
@ AGGSPLIT_SIMPLE
Definition nodes.h:387
@ AGGSPLIT_INITIAL_SERIAL
Definition nodes.h:389
LimitOption
Definition nodes.h:440
@ LIMIT_OPTION_COUNT
Definition nodes.h:441
@ LIMIT_OPTION_WITH_TIES
Definition nodes.h:442
#define AGGSPLITOP_COMBINE
Definition nodes.h:378

◆ IsA

#define IsA (   nodeptr,
  _type_ 
)    (nodeTag(nodeptr) == T_##_type_)

Definition at line 164 of file nodes.h.

◆ makeNode

#define makeNode (   _type_)    ((_type_ *) newNode(sizeof(_type_),T_##_type_))

Definition at line 161 of file nodes.h.

◆ NodeSetTag

#define NodeSetTag (   nodeptr,
 
)    (((Node*)(nodeptr))->type = (t))

Definition at line 162 of file nodes.h.

◆ nodeTag

#define nodeTag (   nodeptr)    (((const Node*)(nodeptr))->type)

Definition at line 139 of file nodes.h.

◆ pg_node_attr

#define pg_node_attr (   ...)

Definition at line 126 of file nodes.h.

Typedef Documentation

◆ AggSplit

◆ AggStrategy

◆ Cardinality

Definition at line 262 of file nodes.h.

◆ CmdType

◆ Cost

Definition at line 261 of file nodes.h.

◆ JoinType

◆ LimitOption

◆ Node

◆ NodeTag

◆ OnConflictAction

◆ ParseLoc

Definition at line 250 of file nodes.h.

◆ Selectivity

Definition at line 260 of file nodes.h.

◆ SetOpCmd

◆ SetOpStrategy

Enumeration Type Documentation

◆ AggSplit

Enumerator
AGGSPLIT_SIMPLE 
AGGSPLIT_INITIAL_SERIAL 
AGGSPLIT_FINAL_DESERIAL 

Definition at line 384 of file nodes.h.

385{
386 /* Basic, non-split aggregation: */
387 AGGSPLIT_SIMPLE = 0,
388 /* Initial phase of partial aggregation, with serialization: */
390 /* Final phase of partial aggregation, with deserialization: */
392} AggSplit;

◆ AggStrategy

Enumerator
AGG_PLAIN 
AGG_SORTED 
AGG_HASHED 
AGG_MIXED 

Definition at line 362 of file nodes.h.

363{
364 AGG_PLAIN, /* simple agg across all input rows */
365 AGG_SORTED, /* grouped agg, input must be sorted */
366 AGG_HASHED, /* grouped agg, use internal hashtable */
367 AGG_MIXED, /* grouped agg, hash and sort both used */

◆ CmdType

Enumerator
CMD_UNKNOWN 
CMD_SELECT 
CMD_UPDATE 
CMD_INSERT 
CMD_DELETE 
CMD_MERGE 
CMD_UTILITY 
CMD_NOTHING 

Definition at line 272 of file nodes.h.

273{
275 CMD_SELECT, /* select stmt */
276 CMD_UPDATE, /* update stmt */
277 CMD_INSERT, /* insert stmt */
278 CMD_DELETE, /* delete stmt */
279 CMD_MERGE, /* merge stmt */
280 CMD_UTILITY, /* cmds like create, destroy, copy, vacuum,
281 * etc. */
282 CMD_NOTHING, /* dummy command for instead nothing rules
283 * with qual */
284} CmdType;
CmdType
Definition nodes.h:273
@ CMD_MERGE
Definition nodes.h:279
@ CMD_UTILITY
Definition nodes.h:280
@ CMD_INSERT
Definition nodes.h:277
@ CMD_DELETE
Definition nodes.h:278
@ CMD_UNKNOWN
Definition nodes.h:274
@ CMD_UPDATE
Definition nodes.h:276
@ CMD_SELECT
Definition nodes.h:275
@ CMD_NOTHING
Definition nodes.h:282

◆ JoinType

Enumerator
JOIN_INNER 
JOIN_LEFT 
JOIN_FULL 
JOIN_RIGHT 
JOIN_SEMI 
JOIN_ANTI 
JOIN_RIGHT_SEMI 
JOIN_RIGHT_ANTI 
JOIN_UNIQUE_OUTER 
JOIN_UNIQUE_INNER 

Definition at line 297 of file nodes.h.

298{
299 /*
300 * The canonical kinds of joins according to the SQL JOIN syntax. Only
301 * these codes can appear in parser output (e.g., JoinExpr nodes).
302 */
303 JOIN_INNER, /* matching tuple pairs only */
304 JOIN_LEFT, /* pairs + unmatched LHS tuples */
305 JOIN_FULL, /* pairs + unmatched LHS + unmatched RHS */
306 JOIN_RIGHT, /* pairs + unmatched RHS tuples */
307
308 /*
309 * Semijoins and anti-semijoins (as defined in relational theory) do not
310 * appear in the SQL JOIN syntax, but there are standard idioms for
311 * representing them (e.g., using EXISTS). The planner recognizes these
312 * cases and converts them to joins. So the planner and executor must
313 * support these codes. NOTE: in JOIN_SEMI output, it is unspecified
314 * which matching RHS row is joined to. In JOIN_ANTI output, the row is
315 * guaranteed to be null-extended.
316 */
317 JOIN_SEMI, /* 1 copy of each LHS row that has match(es) */
318 JOIN_ANTI, /* 1 copy of each LHS row that has no match */
319 JOIN_RIGHT_SEMI, /* 1 copy of each RHS row that has match(es) */
320 JOIN_RIGHT_ANTI, /* 1 copy of each RHS row that has no match */
321
322 /*
323 * These codes are used internally in the planner, but are not supported
324 * by the executor (nor, indeed, by most of the planner).
325 */
326 JOIN_UNIQUE_OUTER, /* LHS has be made unique */
327 JOIN_UNIQUE_INNER, /* RHS has be made unique */
328
329 /*
330 * We might need additional join types someday.
331 */
332} JoinType;
JoinType
Definition nodes.h:298
@ JOIN_SEMI
Definition nodes.h:317
@ JOIN_INNER
Definition nodes.h:303
@ JOIN_RIGHT_SEMI
Definition nodes.h:319
@ JOIN_UNIQUE_OUTER
Definition nodes.h:326
@ JOIN_UNIQUE_INNER
Definition nodes.h:327

◆ LimitOption

Enumerator
LIMIT_OPTION_COUNT 
LIMIT_OPTION_WITH_TIES 

Definition at line 439 of file nodes.h.

440{
441 LIMIT_OPTION_COUNT, /* FETCH FIRST... ONLY */
442 LIMIT_OPTION_WITH_TIES, /* FETCH FIRST... WITH TIES */

◆ NodeTag

Enumerator
T_Invalid 

Definition at line 26 of file nodes.h.

27{
28 T_Invalid = 0,
29
30#include "nodes/nodetags.h"
31} NodeTag;
NodeTag
Definition nodes.h:27
@ T_Invalid
Definition nodes.h:28

◆ OnConflictAction

Enumerator
ONCONFLICT_NONE 
ONCONFLICT_NOTHING 
ONCONFLICT_UPDATE 

Definition at line 426 of file nodes.h.

427{
428 ONCONFLICT_NONE, /* No "ON CONFLICT" clause */
429 ONCONFLICT_NOTHING, /* ON CONFLICT ... DO NOTHING */
430 ONCONFLICT_UPDATE, /* ON CONFLICT ... DO UPDATE */

◆ SetOpCmd

Enumerator
SETOPCMD_INTERSECT 
SETOPCMD_INTERSECT_ALL 
SETOPCMD_EXCEPT 
SETOPCMD_EXCEPT_ALL 

Definition at line 406 of file nodes.h.

◆ SetOpStrategy

Enumerator
SETOP_SORTED 
SETOP_HASHED 

Definition at line 414 of file nodes.h.

415{
416 SETOP_SORTED, /* input must be sorted */
417 SETOP_HASHED, /* use internal hashtable */

Function Documentation

◆ bmsToString()

char * bmsToString ( const struct Bitmapset bms)
extern

◆ copyObjectImpl()

void * copyObjectImpl ( const void from)
extern

Definition at line 177 of file copyfuncs.c.

178{
179 void *retval;
180
181 if (from == NULL)
182 return NULL;
183
184 /* Guard against stack overflow due to overly complex expressions */
186
187 switch (nodeTag(from))
188 {
189#include "copyfuncs.switch.c"
190
191 case T_List:
192 retval = list_copy_deep(from);
193 break;
194
195 /*
196 * Lists of integers, OIDs and XIDs don't need to be deep-copied,
197 * so we perform a shallow copy via list_copy()
198 */
199 case T_IntList:
200 case T_OidList:
201 case T_XidList:
202 retval = list_copy(from);
203 break;
204
205 default:
206 elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
207 retval = NULL; /* keep compiler quiet */
208 break;
209 }
210
211 return retval;
212}
#define ERROR
Definition elog.h:39
#define elog(elevel,...)
Definition elog.h:226
List * list_copy_deep(const List *oldlist)
Definition list.c:1639
List * list_copy(const List *oldlist)
Definition list.c:1573
#define nodeTag(nodeptr)
Definition nodes.h:139
static int fb(int x)
void check_stack_depth(void)
Definition stack_depth.c:95

References check_stack_depth(), elog, ERROR, fb(), list_copy(), list_copy_deep(), and nodeTag.

Referenced by list_copy_deep().

◆ equal()

bool equal ( const void a,
const void b 
)
extern

Definition at line 223 of file equalfuncs.c.

224{
225 bool retval;
226
227 if (a == b)
228 return true;
229
230 /*
231 * note that a!=b, so only one of them can be NULL
232 */
233 if (a == NULL || b == NULL)
234 return false;
235
236 /*
237 * are they the same type of nodes?
238 */
239 if (nodeTag(a) != nodeTag(b))
240 return false;
241
242 /* Guard against stack overflow due to overly complex expressions */
244
245 switch (nodeTag(a))
246 {
247#include "equalfuncs.switch.c"
248
249 case T_List:
250 case T_IntList:
251 case T_OidList:
252 case T_XidList:
253 retval = _equalList(a, b);
254 break;
255
256 default:
257 elog(ERROR, "unrecognized node type: %d",
258 (int) nodeTag(a));
259 retval = false; /* keep compiler quiet */
260 break;
261 }
262
263 return retval;
264}
static bool _equalList(const List *a, const List *b)
Definition equalfuncs.c:156
int b
Definition isn.c:74
int a
Definition isn.c:73

References _equalList(), a, b, check_stack_depth(), elog, ERROR, fb(), and nodeTag.

Referenced by _equalA_Const(), _equalList(), add_row_identity_var(), add_sp_item_to_pathtarget(), add_unique_group_var(), addRangeClause(), AlterPublicationTables(), calc_hist_selectivity_scalar(), calc_hist_selectivity_scalar(), calc_length_hist_frac(), calc_length_hist_frac(), check_new_partition_bound(), check_partition_bounds_for_split_list(), clause_is_strict_for(), CompareIndexInfo(), convert_subquery_pathkeys(), create_ordered_paths(), create_projection_path(), CreateStatistics(), deparseParam(), deparseVar(), dependencies_clauselist_selectivity(), dependency_is_compatible_expression(), ec_member_matches_foreign(), equalPolicy(), equalRuleLocks(), estimate_multivariate_bucketsize(), estimate_multivariate_ndistinct(), examine_variable(), ExecInitWindowAgg(), expand_grouping_sets(), exprs_known_equal(), finalize_grouping_exprs_walker(), find_compatible_agg(), find_ec_member_matching_expr(), find_em_for_rel_target(), find_list_position(), find_minmax_agg_replacement_param(), findTargetlistEntrySQL92(), findTargetlistEntrySQL99(), fix_expr_common(), fix_indexqual_operand(), get_eclass_for_sort_expr(), get_expression_sortgroupref(), get_partition_for_tuple(), get_variable(), group_by_has_partkey(), grouping_planner(), infer_collation_opclass_match(), length_hist_bsearch(), length_hist_bsearch(), list_delete(), list_member(), list_member_rangevar(), match_boolean_partition_clause(), match_clause_to_partition_key(), match_eclasses_to_foreign_key_col(), match_expr_to_partition_keys(), match_index_to_operand(), match_unique_clauses(), matches_boolean_partition_clause(), maybe_reread_subscription(), mcv_match_expression(), MergeAttributes(), MergeCheckConstraint(), MergeWithExistingConstraint(), operator_predicate_proof(), optimize_window_clauses(), pg_parse_query(), pg_plan_query(), pg_rewrite_query(), plan_union_children(), predicate_implied_by_simple_clause(), predicate_refuted_by_simple_clause(), preprocess_groupclause(), process_duplicate_ors(), process_equivalence(), process_matched_tle(), process_subquery_nestloop_params(), rbound_bsearch(), rbound_bsearch(), recomputeNamespacePath(), reconsider_full_join_clause(), reconsider_outer_join_clause(), RelationGetIndexAttrBitmap(), replace_nestloop_param_placeholdervar(), replace_nestloop_param_var(), replace_relid_callback(), restrict_infos_logically_equal(), search_indexed_tlist_for_sortgroupref(), split_selfjoin_quals(), stat_find_expression(), substitute_grouped_columns_mutator(), tlist_member(), tlist_same_exprs(), transformIndexConstraints(), transformPartitionBound(), transformPartitionCmdForMerge(), transformPartitionCmdForSplit(), transformWindowFuncCall(), trivial_subqueryscan(), and update_eclasses().

◆ newNode()

static Node * newNode ( size_t  size,
NodeTag  tag 
)
inlinestatic

Definition at line 150 of file nodes.h.

151{
152 Node *result;
153
154 Assert(size >= sizeof(Node)); /* need the tag, at least */
155 result = (Node *) palloc0(size);
156 result->type = tag;
157
158 return result;
159}
#define Assert(condition)
Definition c.h:873
void * palloc0(Size size)
Definition mcxt.c:1417
Definition nodes.h:135
NodeTag type
Definition nodes.h:136

References Assert, palloc0(), and Node::type.

Referenced by _copyExtensibleNode(), and _readExtensibleNode().

◆ nodeToString()

◆ nodeToStringWithLocations()

char * nodeToStringWithLocations ( const void obj)
extern

Definition at line 808 of file outfuncs.c.

809{
810 return nodeToStringInternal(obj, true);
811}

References nodeToStringInternal().

Referenced by elog_node_display(), pg_parse_query(), pg_plan_query(), pg_rewrite_query(), pprint(), and print().

◆ outBitmapset()

void outBitmapset ( struct StringInfoData str,
const struct Bitmapset bms 
)
extern

◆ outDatum()

void outDatum ( struct StringInfoData str,
Datum  value,
int  typlen,
bool  typbyval 
)
extern

◆ outNode()

void outNode ( struct StringInfoData str,
const void obj 
)
extern

◆ outToken()

void outToken ( struct StringInfoData str,
const char s 
)
extern

◆ readAttrNumberCols()

int16 * readAttrNumberCols ( int  numCols)
extern

◆ readBitmapset()

struct Bitmapset * readBitmapset ( void  )
extern

Definition at line 249 of file readfuncs.c.

250{
251 return _readBitmapset();
252}
static Bitmapset * _readBitmapset(void)
Definition readfuncs.c:207

References _readBitmapset().

◆ readBoolCols()

bool * readBoolCols ( int  numCols)
extern

◆ readDatum()

Datum readDatum ( bool  typbyval)
extern

Definition at line 598 of file readfuncs.c.

599{
600 Size length;
601 int tokenLength;
602 const char *token;
603 Datum res;
604 char *s;
605
606 /*
607 * read the actual length of the value
608 */
610 length = atoui(token);
611
612 token = pg_strtok(&tokenLength); /* read the '[' */
613 if (token == NULL || token[0] != '[')
614 elog(ERROR, "expected \"[\" to start datum, but got \"%s\"; length = %zu",
615 token ? token : "[NULL]", length);
616
617 if (typbyval)
618 {
619 if (length > (Size) sizeof(Datum))
620 elog(ERROR, "byval datum but length = %zu", length);
621 res = (Datum) 0;
622 s = (char *) (&res);
623 for (Size i = 0; i < (Size) sizeof(Datum); i++)
624 {
626 s[i] = (char) atoi(token);
627 }
628 }
629 else if (length <= 0)
630 res = (Datum) 0;
631 else
632 {
633 s = (char *) palloc(length);
634 for (Size i = 0; i < length; i++)
635 {
637 s[i] = (char) atoi(token);
638 }
639 res = PointerGetDatum(s);
640 }
641
642 token = pg_strtok(&tokenLength); /* read the ']' */
643 if (token == NULL || token[0] != ']')
644 elog(ERROR, "expected \"]\" to end datum, but got \"%s\"; length = %zu",
645 token ? token : "[NULL]", length);
646
647 return res;
648}
size_t Size
Definition c.h:619
#define token
int i
Definition isn.c:77
void * palloc(Size size)
Definition mcxt.c:1387
static Datum PointerGetDatum(const void *X)
Definition postgres.h:352
uint64_t Datum
Definition postgres.h:70
const char * pg_strtok(int *length)
Definition read.c:153
#define atoui(x)
Definition readfuncs.c:181

References atoui, elog, ERROR, fb(), i, palloc(), pg_strtok(), PointerGetDatum(), and token.

Referenced by _readConst().

◆ readIntCols()

int * readIntCols ( int  numCols)
extern

◆ readOidCols()

Oid * readOidCols ( int  numCols)
extern

◆ stringToNode()

void * stringToNode ( const char str)
extern

Definition at line 90 of file read.c.

91{
92 return stringToNodeInternal(str, false);
93}
const char * str
static void * stringToNodeInternal(const char *str, bool restore_loc_fields)
Definition read.c:49

References str, and stringToNodeInternal().

Referenced by AddRelationNewConstraints(), AlterPolicy(), AlterPublicationTables(), CloneRowTriggersToPartition(), ConstraintImpliedByRelConstraint(), createTableConstraints(), ExecParallelGetQueryDesc(), ExecRelCheck(), expandTableLikeClause(), extended_statistics_update(), fetch_function_defaults(), fetch_statentries_for_relation(), fmgr_sql_validator(), func_get_detail(), generate_partition_qual(), generateClonedExtStatsStmt(), generateClonedIndexStmt(), GenerateTypeDependencies(), get_dependent_generated_columns(), get_partition_bound_spec(), get_qual_for_range(), get_relation_constraints(), get_relation_statistics(), get_typdefault(), index_concurrently_create_copy(), inline_function(), inline_sql_function_in_from(), load_domaintype_info(), make_ruledef(), make_viewdef(), MergeAttributes(), MergeWithExistingConstraint(), pg_get_constraintdef_worker(), pg_get_expr_worker(), pg_get_function_arg_default(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), pg_get_statisticsobjdef_expressions(), pg_get_triggerdef_worker(), pgoutput_row_filter_init(), print_function_arguments(), print_function_sqlbody(), ProcedureCreate(), pub_rf_contains_invalid_column(), QueueCheckConstraintValidation(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationGetDummyIndexExpressions(), RelationGetIndexAttrBitmap(), RelationGetIndexExpressions(), RelationGetIndexPredicate(), sql_compile_callback(), TriggerEnabled(), TupleDescGetDefault(), TypeCreate(), and validateDomainCheckConstraint().