PostgreSQL Source Code  git master
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 newNode(size, tag)
 
#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 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_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 , LIMIT_OPTION_DEFAULT }
 

Functions

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, uintptr_t value, int typlen, bool typbyval)
 
char * nodeToString (const void *obj)
 
char * bmsToString (const struct Bitmapset *bms)
 
void * stringToNode (const char *str)
 
struct BitmapsetreadBitmapset (void)
 
uintptr_t readDatum (bool typbyval)
 
boolreadBoolCols (int numCols)
 
int * readIntCols (int numCols)
 
OidreadOidCols (int numCols)
 
int16readAttrNumberCols (int numCols)
 
void * copyObjectImpl (const void *from)
 
bool equal (const void *a, const void *b)
 

Variables

PGDLLIMPORT NodenewNodeMacroHolder
 

Macro Definition Documentation

◆ AGGSPLITOP_COMBINE

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

Definition at line 359 of file nodes.h.

◆ AGGSPLITOP_DESERIALIZE

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

Definition at line 362 of file nodes.h.

◆ AGGSPLITOP_SERIALIZE

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

Definition at line 361 of file nodes.h.

◆ AGGSPLITOP_SKIPFINAL

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

Definition at line 360 of file nodes.h.

◆ castNode

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

Definition at line 180 of file nodes.h.

◆ copyObject

#define copyObject (   obj)    copyObjectImpl(obj)

Definition at line 227 of file nodes.h.

◆ DO_AGGSPLIT_COMBINE

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

Definition at line 376 of file nodes.h.

◆ DO_AGGSPLIT_DESERIALIZE

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

Definition at line 379 of file nodes.h.

◆ DO_AGGSPLIT_SERIALIZE

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

Definition at line 378 of file nodes.h.

◆ DO_AGGSPLIT_SKIPFINAL

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

Definition at line 377 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))) != 0)
@ JOIN_FULL
Definition: nodes.h:289
@ JOIN_RIGHT
Definition: nodes.h:290
@ JOIN_LEFT
Definition: nodes.h:288
@ JOIN_ANTI
Definition: nodes.h:302

Definition at line 330 of file nodes.h.

◆ IsA

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

Definition at line 162 of file nodes.h.

◆ makeNode

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

Definition at line 159 of file nodes.h.

◆ newNode

#define newNode (   size,
  tag 
)
Value:
( \
AssertMacro((size) >= sizeof(Node)), /* need the tag, at least */ \
newNodeMacroHolder = (Node *) palloc0fast(size), \
newNodeMacroHolder->type = (tag), \
)
PGDLLIMPORT Node * newNodeMacroHolder
Definition: nodes.c:31
#define palloc0fast(sz)
Definition: palloc.h:113
Definition: nodes.h:112

Definition at line 149 of file nodes.h.

◆ NodeSetTag

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

Definition at line 160 of file nodes.h.

◆ nodeTag

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

Definition at line 116 of file nodes.h.

◆ pg_node_attr

#define pg_node_attr (   ...)

Definition at line 103 of file nodes.h.

Typedef Documentation

◆ AggSplit

typedef enum AggSplit AggSplit

◆ AggStrategy

typedef enum AggStrategy AggStrategy

◆ Cardinality

typedef double Cardinality

Definition at line 246 of file nodes.h.

◆ CmdType

typedef enum CmdType CmdType

◆ Cost

typedef double Cost

Definition at line 245 of file nodes.h.

◆ JoinType

typedef enum JoinType JoinType

◆ LimitOption

typedef enum LimitOption LimitOption

◆ Node

typedef struct Node Node

◆ NodeTag

typedef enum NodeTag NodeTag

◆ OnConflictAction

◆ Selectivity

typedef double Selectivity

Definition at line 244 of file nodes.h.

◆ SetOpCmd

typedef enum SetOpCmd SetOpCmd

◆ SetOpStrategy

Enumeration Type Documentation

◆ AggSplit

enum AggSplit
Enumerator
AGGSPLIT_SIMPLE 
AGGSPLIT_INITIAL_SERIAL 
AGGSPLIT_FINAL_DESERIAL 

Definition at line 365 of file nodes.h.

366 {
367  /* Basic, non-split aggregation: */
368  AGGSPLIT_SIMPLE = 0,
369  /* Initial phase of partial aggregation, with serialization: */
371  /* Final phase of partial aggregation, with deserialization: */
373 } AggSplit;
#define AGGSPLITOP_DESERIALIZE
Definition: nodes.h:362
#define AGGSPLITOP_SKIPFINAL
Definition: nodes.h:360
#define AGGSPLITOP_SERIALIZE
Definition: nodes.h:361
AggSplit
Definition: nodes.h:366
@ AGGSPLIT_FINAL_DESERIAL
Definition: nodes.h:372
@ AGGSPLIT_SIMPLE
Definition: nodes.h:368
@ AGGSPLIT_INITIAL_SERIAL
Definition: nodes.h:370
#define AGGSPLITOP_COMBINE
Definition: nodes.h:359

◆ AggStrategy

Enumerator
AGG_PLAIN 
AGG_SORTED 
AGG_HASHED 
AGG_MIXED 

Definition at line 343 of file nodes.h.

344 {
345  AGG_PLAIN, /* simple agg across all input rows */
346  AGG_SORTED, /* grouped agg, input must be sorted */
347  AGG_HASHED, /* grouped agg, use internal hashtable */
348  AGG_MIXED /* grouped agg, hash and sort both used */
349 } AggStrategy;
AggStrategy
Definition: nodes.h:344
@ AGG_SORTED
Definition: nodes.h:346
@ AGG_HASHED
Definition: nodes.h:347
@ AGG_MIXED
Definition: nodes.h:348
@ AGG_PLAIN
Definition: nodes.h:345

◆ CmdType

enum CmdType
Enumerator
CMD_UNKNOWN 
CMD_SELECT 
CMD_UPDATE 
CMD_INSERT 
CMD_DELETE 
CMD_MERGE 
CMD_UTILITY 
CMD_NOTHING 

Definition at line 256 of file nodes.h.

257 {
258  CMD_UNKNOWN,
259  CMD_SELECT, /* select stmt */
260  CMD_UPDATE, /* update stmt */
261  CMD_INSERT, /* insert stmt */
262  CMD_DELETE, /* delete stmt */
263  CMD_MERGE, /* merge stmt */
264  CMD_UTILITY, /* cmds like create, destroy, copy, vacuum,
265  * etc. */
266  CMD_NOTHING /* dummy command for instead nothing rules
267  * with qual */
268 } CmdType;
CmdType
Definition: nodes.h:257
@ CMD_MERGE
Definition: nodes.h:263
@ CMD_UTILITY
Definition: nodes.h:264
@ CMD_INSERT
Definition: nodes.h:261
@ CMD_DELETE
Definition: nodes.h:262
@ CMD_UNKNOWN
Definition: nodes.h:258
@ CMD_UPDATE
Definition: nodes.h:260
@ CMD_SELECT
Definition: nodes.h:259
@ CMD_NOTHING
Definition: nodes.h:266

◆ JoinType

enum JoinType
Enumerator
JOIN_INNER 
JOIN_LEFT 
JOIN_FULL 
JOIN_RIGHT 
JOIN_SEMI 
JOIN_ANTI 
JOIN_UNIQUE_OUTER 
JOIN_UNIQUE_INNER 

Definition at line 281 of file nodes.h.

282 {
283  /*
284  * The canonical kinds of joins according to the SQL JOIN syntax. Only
285  * these codes can appear in parser output (e.g., JoinExpr nodes).
286  */
287  JOIN_INNER, /* matching tuple pairs only */
288  JOIN_LEFT, /* pairs + unmatched LHS tuples */
289  JOIN_FULL, /* pairs + unmatched LHS + unmatched RHS */
290  JOIN_RIGHT, /* pairs + unmatched RHS tuples */
291 
292  /*
293  * Semijoins and anti-semijoins (as defined in relational theory) do not
294  * appear in the SQL JOIN syntax, but there are standard idioms for
295  * representing them (e.g., using EXISTS). The planner recognizes these
296  * cases and converts them to joins. So the planner and executor must
297  * support these codes. NOTE: in JOIN_SEMI output, it is unspecified
298  * which matching RHS row is joined to. In JOIN_ANTI output, the row is
299  * guaranteed to be null-extended.
300  */
301  JOIN_SEMI, /* 1 copy of each LHS row that has match(es) */
302  JOIN_ANTI, /* 1 copy of each LHS row that has no match */
303 
304  /*
305  * These codes are used internally in the planner, but are not supported
306  * by the executor (nor, indeed, by most of the planner).
307  */
308  JOIN_UNIQUE_OUTER, /* LHS path must be made unique */
309  JOIN_UNIQUE_INNER /* RHS path must be made unique */
310 
311  /*
312  * We might need additional join types someday.
313  */
314 } JoinType;
JoinType
Definition: nodes.h:282
@ JOIN_SEMI
Definition: nodes.h:301
@ JOIN_INNER
Definition: nodes.h:287
@ JOIN_UNIQUE_OUTER
Definition: nodes.h:308
@ JOIN_UNIQUE_INNER
Definition: nodes.h:309

◆ LimitOption

Enumerator
LIMIT_OPTION_COUNT 
LIMIT_OPTION_WITH_TIES 
LIMIT_OPTION_DEFAULT 

Definition at line 420 of file nodes.h.

421 {
422  LIMIT_OPTION_COUNT, /* FETCH FIRST... ONLY */
423  LIMIT_OPTION_WITH_TIES, /* FETCH FIRST... WITH TIES */
424  LIMIT_OPTION_DEFAULT, /* No limit present */
425 } LimitOption;
LimitOption
Definition: nodes.h:421
@ LIMIT_OPTION_COUNT
Definition: nodes.h:422
@ LIMIT_OPTION_WITH_TIES
Definition: nodes.h:423
@ LIMIT_OPTION_DEFAULT
Definition: nodes.h:424

◆ NodeTag

enum 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 407 of file nodes.h.

408 {
409  ONCONFLICT_NONE, /* No "ON CONFLICT" clause */
410  ONCONFLICT_NOTHING, /* ON CONFLICT ... DO NOTHING */
411  ONCONFLICT_UPDATE /* ON CONFLICT ... DO UPDATE */
OnConflictAction
Definition: nodes.h:408
@ ONCONFLICT_NONE
Definition: nodes.h:409
@ ONCONFLICT_UPDATE
Definition: nodes.h:411
@ ONCONFLICT_NOTHING
Definition: nodes.h:410

◆ SetOpCmd

enum SetOpCmd
Enumerator
SETOPCMD_INTERSECT 
SETOPCMD_INTERSECT_ALL 
SETOPCMD_EXCEPT 
SETOPCMD_EXCEPT_ALL 

Definition at line 387 of file nodes.h.

388 {
393 } SetOpCmd;
SetOpCmd
Definition: nodes.h:388
@ SETOPCMD_EXCEPT
Definition: nodes.h:391
@ SETOPCMD_EXCEPT_ALL
Definition: nodes.h:392
@ SETOPCMD_INTERSECT_ALL
Definition: nodes.h:390
@ SETOPCMD_INTERSECT
Definition: nodes.h:389

◆ SetOpStrategy

Enumerator
SETOP_SORTED 
SETOP_HASHED 

Definition at line 395 of file nodes.h.

396 {
397  SETOP_SORTED, /* input must be sorted */
398  SETOP_HASHED /* use internal hashtable */
399 } SetOpStrategy;
SetOpStrategy
Definition: nodes.h:396
@ SETOP_HASHED
Definition: nodes.h:398
@ SETOP_SORTED
Definition: nodes.h:397

Function Documentation

◆ bmsToString()

char* bmsToString ( const struct Bitmapset bms)

◆ copyObjectImpl()

void* copyObjectImpl ( const void *  from)

Definition at line 171 of file copyfuncs.c.

172 {
173  void *retval;
174 
175  if (from == NULL)
176  return NULL;
177 
178  /* Guard against stack overflow due to overly complex expressions */
180 
181  switch (nodeTag(from))
182  {
183 #include "copyfuncs.switch.c"
184 
185  case T_List:
186  retval = list_copy_deep(from);
187  break;
188 
189  /*
190  * Lists of integers, OIDs and XIDs don't need to be deep-copied,
191  * so we perform a shallow copy via list_copy()
192  */
193  case T_IntList:
194  case T_OidList:
195  case T_XidList:
196  retval = list_copy(from);
197  break;
198 
199  default:
200  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
201  retval = 0; /* keep compiler quiet */
202  break;
203  }
204 
205  return retval;
206 }
#define ERROR
Definition: elog.h:35
List * list_copy_deep(const List *oldlist)
Definition: list.c:1638
List * list_copy(const List *oldlist)
Definition: list.c:1572
#define nodeTag(nodeptr)
Definition: nodes.h:116
void check_stack_depth(void)
Definition: postgres.c:3440

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

Referenced by list_copy_deep().

◆ equal()

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

Definition at line 219 of file equalfuncs.c.

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

References _equalList(), a, b, check_stack_depth(), elog(), ERROR, 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_length_hist_frac(), check_new_partition_bound(), check_ungrouped_columns_walker(), clause_is_strict_for(), CompareIndexInfo(), convert_subquery_pathkeys(), create_projection_path(), CreateStatistics(), deparseParam(), deparseVar(), dependencies_clauselist_selectivity(), dependency_is_compatible_expression(), ec_member_matches_foreign(), equalPolicy(), equalRuleLocks(), 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(), findTargetlistEntrySQL92(), findTargetlistEntrySQL99(), fix_expr_common(), fix_indexqual_operand(), fix_scan_expr_mutator(), fix_upper_expr_mutator(), get_eclass_for_sort_expr(), get_partition_for_tuple(), get_relation_column_alias_ids(), grouping_planner(), infer_collation_opclass_match(), is_exprlist_member(), length_hist_bsearch(), list_delete(), list_member(), match_boolean_partition_clause(), match_clause_to_partition_key(), match_eclasses_to_foreign_key_col(), match_expr_to_partition_keys(), match_index_to_operand(), matches_boolean_partition_clause(), maybe_reread_subscription(), mcv_match_expression(), MergeAttributes(), MergeCheckConstraint(), MergeWithExistingConstraint(), operator_predicate_proof(), 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(), recomputeNamespacePath(), reconsider_full_join_clause(), reconsider_outer_join_clause(), RelationGetIndexAttrBitmap(), replace_nestloop_param_placeholdervar(), replace_nestloop_param_var(), search_indexed_tlist_for_sortgroupref(), stat_find_expression(), tlist_member(), tlist_same_exprs(), transformIndexConstraints(), transformPartitionBound(), transformWindowFuncCall(), and trivial_subqueryscan().

◆ nodeToString()

◆ outBitmapset()

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

◆ outDatum()

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

◆ outNode()

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

◆ outToken()

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

◆ readAttrNumberCols()

int16* readAttrNumberCols ( int  numCols)

◆ readBitmapset()

struct Bitmapset* readBitmapset ( void  )

Definition at line 240 of file readfuncs.c.

241 {
242  return _readBitmapset();
243 }
static Bitmapset * _readBitmapset(void)
Definition: readfuncs.c:199

References _readBitmapset().

◆ readBoolCols()

bool* readBoolCols ( int  numCols)

◆ readDatum()

uintptr_t readDatum ( bool  typbyval)

Definition at line 704 of file readfuncs.c.

705 {
706  Size length,
707  i;
708  int tokenLength;
709  const char *token;
710  Datum res;
711  char *s;
712 
713  /*
714  * read the actual length of the value
715  */
716  token = pg_strtok(&tokenLength);
717  length = atoui(token);
718 
719  token = pg_strtok(&tokenLength); /* read the '[' */
720  if (token == NULL || token[0] != '[')
721  elog(ERROR, "expected \"[\" to start datum, but got \"%s\"; length = %zu",
722  token ? token : "[NULL]", length);
723 
724  if (typbyval)
725  {
726  if (length > (Size) sizeof(Datum))
727  elog(ERROR, "byval datum but length = %zu", length);
728  res = (Datum) 0;
729  s = (char *) (&res);
730  for (i = 0; i < (Size) sizeof(Datum); i++)
731  {
732  token = pg_strtok(&tokenLength);
733  s[i] = (char) atoi(token);
734  }
735  }
736  else if (length <= 0)
737  res = (Datum) NULL;
738  else
739  {
740  s = (char *) palloc(length);
741  for (i = 0; i < length; i++)
742  {
743  token = pg_strtok(&tokenLength);
744  s[i] = (char) atoi(token);
745  }
746  res = PointerGetDatum(s);
747  }
748 
749  token = pg_strtok(&tokenLength); /* read the ']' */
750  if (token == NULL || token[0] != ']')
751  elog(ERROR, "expected \"]\" to end datum, but got \"%s\"; length = %zu",
752  token ? token : "[NULL]", length);
753 
754  return res;
755 }
size_t Size
Definition: c.h:541
int i
Definition: isn.c:73
void * palloc(Size size)
Definition: mcxt.c:1145
static Datum PointerGetDatum(const void *X)
Definition: postgres.h:670
uintptr_t Datum
Definition: postgres.h:412
const char * pg_strtok(int *length)
Definition: read.c:152
#define atoui(x)
Definition: readfuncs.c:177

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

Referenced by _readConst().

◆ readIntCols()

int* readIntCols ( int  numCols)

◆ readOidCols()

Oid* readOidCols ( int  numCols)

◆ stringToNode()

void* stringToNode ( const char *  str)

Definition at line 89 of file read.c.

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

References generate_unaccent_rules::str, and stringToNodeInternal().

Referenced by AddRelationNewConstraints(), AlterPolicy(), AlterPublicationTables(), ATExecValidateConstraint(), build_column_default(), CloneRowTriggersToPartition(), ConstraintImpliedByRelConstraint(), ExecParallelGetQueryDesc(), ExecRelCheck(), expandTableLikeClause(), fetch_function_defaults(), fetch_statentries_for_relation(), fill_extraUpdatedCols(), fmgr_sql_validator(), func_get_detail(), generate_partition_qual(), generateClonedExtStatsStmt(), generateClonedIndexStmt(), GenerateTypeDependencies(), get_qual_for_range(), get_relation_constraints(), get_relation_statistics(), get_typdefault(), index_concurrently_create_copy(), init_sql_fcache(), inline_function(), inline_set_returning_function(), 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(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationGetDummyIndexExpressions(), RelationGetIndexAttrBitmap(), RelationGetIndexExpressions(), RelationGetIndexPredicate(), TriggerEnabled(), TypeCreate(), and validateDomainConstraint().

Variable Documentation

◆ newNodeMacroHolder

PGDLLIMPORT Node* newNodeMacroHolder
extern

Definition at line 31 of file nodes.c.