/src/postgres/src/include/nodes/nodes.h
Line | Count | Source |
1 | | /*------------------------------------------------------------------------- |
2 | | * |
3 | | * nodes.h |
4 | | * Definitions for tagged nodes. |
5 | | * |
6 | | * |
7 | | * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group |
8 | | * Portions Copyright (c) 1994, Regents of the University of California |
9 | | * |
10 | | * src/include/nodes/nodes.h |
11 | | * |
12 | | *------------------------------------------------------------------------- |
13 | | */ |
14 | | #ifndef NODES_H |
15 | | #define NODES_H |
16 | | |
17 | | /* |
18 | | * The first field of every node is NodeTag. Each node created (with makeNode) |
19 | | * will have one of the following tags as the value of its first field. |
20 | | * |
21 | | * Note that inserting or deleting node types changes the numbers of other |
22 | | * node types later in the list. This is no problem during development, since |
23 | | * the node numbers are never stored on disk. But don't do it in a released |
24 | | * branch, because that would represent an ABI break for extensions. |
25 | | */ |
26 | | typedef enum NodeTag |
27 | | { |
28 | | T_Invalid = 0, |
29 | | |
30 | | #include "nodes/nodetags.h" |
31 | | } NodeTag; |
32 | | |
33 | | /* |
34 | | * pg_node_attr() - Used in node definitions to set extra information for |
35 | | * gen_node_support.pl |
36 | | * |
37 | | * Attributes can be attached to a node as a whole (place the attribute |
38 | | * specification on the first line after the struct's opening brace) |
39 | | * or to a specific field (place it at the end of that field's line). The |
40 | | * argument is a comma-separated list of attributes. Unrecognized attributes |
41 | | * cause an error. |
42 | | * |
43 | | * Valid node attributes: |
44 | | * |
45 | | * - abstract: Abstract types are types that cannot be instantiated but that |
46 | | * can be supertypes of other types. We track their fields, so that |
47 | | * subtypes can use them, but we don't emit a node tag, so you can't |
48 | | * instantiate them. |
49 | | * |
50 | | * - custom_copy_equal: Has custom implementations in copyfuncs.c and |
51 | | * equalfuncs.c. |
52 | | * |
53 | | * - custom_read_write: Has custom implementations in outfuncs.c and |
54 | | * readfuncs.c. |
55 | | * |
56 | | * - custom_query_jumble: Has custom implementation in queryjumblefuncs.c. |
57 | | * Also available as a node field attribute. |
58 | | * |
59 | | * - no_copy: Does not support copyObject() at all. |
60 | | * |
61 | | * - no_equal: Does not support equal() at all. |
62 | | * |
63 | | * - no_copy_equal: Shorthand for both no_copy and no_equal. |
64 | | * |
65 | | * - no_query_jumble: Does not support JumbleQuery() at all. |
66 | | * |
67 | | * - no_read: Does not support nodeRead() at all. |
68 | | * |
69 | | * - nodetag_only: Does not support copyObject(), equal(), jumbleQuery() |
70 | | * outNode() or nodeRead(). |
71 | | * |
72 | | * - special_read_write: Has special treatment in outNode() and nodeRead(). |
73 | | * |
74 | | * - nodetag_number(VALUE): assign the specified nodetag number instead of |
75 | | * an auto-generated number. Typically this would only be used in stable |
76 | | * branches, to give a newly-added node type a number without breaking ABI |
77 | | * by changing the numbers of existing node types. |
78 | | * |
79 | | * Node types can be supertypes of other types whether or not they are marked |
80 | | * abstract: if a node struct appears as the first field of another struct |
81 | | * type, then it is the supertype of that type. The no_copy, no_equal, |
82 | | * no_query_jumble and no_read node attributes are automatically inherited |
83 | | * from the supertype. (Notice that nodetag_only does not inherit, so it's |
84 | | * not quite equivalent to a combination of other attributes.) |
85 | | * |
86 | | * Valid node field attributes: |
87 | | * |
88 | | * - array_size(OTHERFIELD): This field is a dynamically allocated array with |
89 | | * size indicated by the mentioned other field. The other field is either a |
90 | | * scalar or a list, in which case the length of the list is used. |
91 | | * |
92 | | * - copy_as(VALUE): In copyObject(), replace the field's value with VALUE. |
93 | | * |
94 | | * - copy_as_scalar: In copyObject(), copy the field as a scalar value |
95 | | * (e.g. a pointer) even if it is a node-type pointer. |
96 | | * |
97 | | * - equal_as_scalar: In equal(), compare the field as a scalar value |
98 | | * even if it is a node-type pointer. |
99 | | * |
100 | | * - equal_ignore: Ignore the field for equality. |
101 | | * |
102 | | * - equal_ignore_if_zero: Ignore the field for equality if it is zero. |
103 | | * (Otherwise, compare normally.) |
104 | | * |
105 | | * - custom_query_jumble: Has custom implementation in queryjumblefuncs.c |
106 | | * for the field of a node. Also available as a node attribute. |
107 | | * |
108 | | * - query_jumble_ignore: Ignore the field for query jumbling. |
109 | | * |
110 | | * - query_jumble_squash: Squash multiple values during query jumbling. |
111 | | * |
112 | | * - query_jumble_location: Mark the field as a location to track. This is |
113 | | * only used for fields of type ParseLoc, which otherwise are not jumbled. |
114 | | * |
115 | | * - read_as(VALUE): In nodeRead(), replace the field's value with VALUE. |
116 | | * |
117 | | * - read_write_ignore: Ignore the field for read/write. This is only allowed |
118 | | * if the node type is marked no_read or read_as() is also specified. |
119 | | * |
120 | | * - write_only_relids, write_only_nondefault_pathtarget, write_only_req_outer: |
121 | | * Special handling for Path struct; see there. |
122 | | * |
123 | | */ |
124 | | #define pg_node_attr(...) |
125 | | |
126 | | /* |
127 | | * The first field of a node of any type is guaranteed to be the NodeTag. |
128 | | * Hence the type of any node can be gotten by casting it to Node. Declaring |
129 | | * a variable to be of Node * (instead of void *) can also facilitate |
130 | | * debugging. |
131 | | */ |
132 | | typedef struct Node |
133 | | { |
134 | | NodeTag type; |
135 | | } Node; |
136 | | |
137 | 10.6M | #define nodeTag(nodeptr) (((const Node*)(nodeptr))->type) |
138 | | |
139 | | /* |
140 | | * newNode - |
141 | | * create a new node of the specified size and tag the node with the |
142 | | * specified tag. |
143 | | * |
144 | | * !WARNING!: Avoid using newNode directly. You should be using the |
145 | | * macro makeNode. eg. to create a Query node, use makeNode(Query) |
146 | | */ |
147 | | static inline Node * |
148 | | newNode(size_t size, NodeTag tag) |
149 | 5.25M | { |
150 | 5.25M | Node *result; |
151 | | |
152 | 5.25M | Assert(size >= sizeof(Node)); /* need the tag, at least */ |
153 | 5.25M | result = (Node *) palloc0(size); |
154 | 5.25M | result->type = tag; |
155 | | |
156 | 5.25M | return result; |
157 | 5.25M | } Unexecuted instantiation: json_parser_fuzzer.c:newNode Unexecuted instantiation: fuzzer_initialize.c:newNode Unexecuted instantiation: brin.c:newNode Unexecuted instantiation: brin_bloom.c:newNode Unexecuted instantiation: brin_inclusion.c:newNode Unexecuted instantiation: brin_minmax.c:newNode Unexecuted instantiation: brin_minmax_multi.c:newNode Unexecuted instantiation: brin_pageops.c:newNode Unexecuted instantiation: brin_revmap.c:newNode Unexecuted instantiation: brin_tuple.c:newNode Unexecuted instantiation: brin_validate.c:newNode Unexecuted instantiation: brin_xlog.c:newNode Unexecuted instantiation: attmap.c:newNode Unexecuted instantiation: bufmask.c:newNode Unexecuted instantiation: detoast.c:newNode Unexecuted instantiation: heaptuple.c:newNode Unexecuted instantiation: indextuple.c:newNode Unexecuted instantiation: printsimple.c:newNode Unexecuted instantiation: printtup.c:newNode Unexecuted instantiation: relation.c:newNode Unexecuted instantiation: reloptions.c:newNode Unexecuted instantiation: session.c:newNode Unexecuted instantiation: syncscan.c:newNode Unexecuted instantiation: tidstore.c:newNode Unexecuted instantiation: toast_internals.c:newNode Unexecuted instantiation: tupconvert.c:newNode Unexecuted instantiation: tupdesc.c:newNode Unexecuted instantiation: ginarrayproc.c:newNode Unexecuted instantiation: ginbtree.c:newNode Unexecuted instantiation: ginbulk.c:newNode Unexecuted instantiation: gindatapage.c:newNode Unexecuted instantiation: ginentrypage.c:newNode Unexecuted instantiation: ginfast.c:newNode Unexecuted instantiation: ginget.c:newNode Unexecuted instantiation: gininsert.c:newNode Unexecuted instantiation: ginlogic.c:newNode Unexecuted instantiation: ginpostinglist.c:newNode Unexecuted instantiation: ginscan.c:newNode Unexecuted instantiation: ginutil.c:newNode Unexecuted instantiation: ginvacuum.c:newNode Unexecuted instantiation: ginvalidate.c:newNode Unexecuted instantiation: ginxlog.c:newNode Unexecuted instantiation: gist.c:newNode Unexecuted instantiation: gistbuild.c:newNode Unexecuted instantiation: gistbuildbuffers.c:newNode Unexecuted instantiation: gistget.c:newNode Unexecuted instantiation: gistproc.c:newNode Unexecuted instantiation: gistscan.c:newNode Unexecuted instantiation: gistsplit.c:newNode Unexecuted instantiation: gistutil.c:newNode Unexecuted instantiation: gistvacuum.c:newNode Unexecuted instantiation: gistvalidate.c:newNode Unexecuted instantiation: gistxlog.c:newNode Unexecuted instantiation: hash.c:newNode Unexecuted instantiation: hash_xlog.c:newNode Unexecuted instantiation: hashfunc.c:newNode Unexecuted instantiation: hashinsert.c:newNode Unexecuted instantiation: hashovfl.c:newNode Unexecuted instantiation: hashpage.c:newNode Unexecuted instantiation: hashsearch.c:newNode Unexecuted instantiation: hashsort.c:newNode Unexecuted instantiation: hashutil.c:newNode Unexecuted instantiation: hashvalidate.c:newNode Unexecuted instantiation: heapam.c:newNode Unexecuted instantiation: heapam_handler.c:newNode Unexecuted instantiation: heapam_indexscan.c:newNode Unexecuted instantiation: heapam_visibility.c:newNode Unexecuted instantiation: heapam_xlog.c:newNode Unexecuted instantiation: heaptoast.c:newNode Unexecuted instantiation: hio.c:newNode Unexecuted instantiation: pruneheap.c:newNode Unexecuted instantiation: rewriteheap.c:newNode Unexecuted instantiation: vacuumlazy.c:newNode Unexecuted instantiation: visibilitymap.c:newNode Unexecuted instantiation: amapi.c:newNode Unexecuted instantiation: amvalidate.c:newNode Unexecuted instantiation: genam.c:newNode Unexecuted instantiation: indexam.c:newNode Unexecuted instantiation: nbtcompare.c:newNode Unexecuted instantiation: nbtdedup.c:newNode Unexecuted instantiation: nbtinsert.c:newNode Unexecuted instantiation: nbtpage.c:newNode Unexecuted instantiation: nbtpreprocesskeys.c:newNode Unexecuted instantiation: nbtreadpage.c:newNode Unexecuted instantiation: nbtree.c:newNode Unexecuted instantiation: nbtsearch.c:newNode Unexecuted instantiation: nbtsort.c:newNode Unexecuted instantiation: nbtsplitloc.c:newNode Unexecuted instantiation: nbtutils.c:newNode Unexecuted instantiation: nbtvalidate.c:newNode Unexecuted instantiation: nbtxlog.c:newNode Unexecuted instantiation: brindesc.c:newNode Unexecuted instantiation: committsdesc.c:newNode Unexecuted instantiation: genericdesc.c:newNode Unexecuted instantiation: gindesc.c:newNode Unexecuted instantiation: gistdesc.c:newNode Unexecuted instantiation: heapdesc.c:newNode Unexecuted instantiation: logicalmsgdesc.c:newNode Unexecuted instantiation: replorigindesc.c:newNode Unexecuted instantiation: tblspcdesc.c:newNode Unexecuted instantiation: xactdesc.c:newNode Unexecuted instantiation: xlogdesc.c:newNode Unexecuted instantiation: spgdoinsert.c:newNode Unexecuted instantiation: spginsert.c:newNode Unexecuted instantiation: spgkdtreeproc.c:newNode Unexecuted instantiation: spgproc.c:newNode Unexecuted instantiation: spgquadtreeproc.c:newNode Unexecuted instantiation: spgscan.c:newNode Unexecuted instantiation: spgtextproc.c:newNode Unexecuted instantiation: spgutils.c:newNode Unexecuted instantiation: spgvacuum.c:newNode Unexecuted instantiation: spgvalidate.c:newNode Unexecuted instantiation: spgxlog.c:newNode Unexecuted instantiation: sequence.c:newNode Unexecuted instantiation: table.c:newNode Unexecuted instantiation: tableam.c:newNode Unexecuted instantiation: tableamapi.c:newNode Unexecuted instantiation: toast_helper.c:newNode Unexecuted instantiation: bernoulli.c:newNode Unexecuted instantiation: system.c:newNode Unexecuted instantiation: tablesample.c:newNode Unexecuted instantiation: clog.c:newNode Unexecuted instantiation: commit_ts.c:newNode Unexecuted instantiation: generic_xlog.c:newNode Unexecuted instantiation: multixact.c:newNode Unexecuted instantiation: parallel.c:newNode Unexecuted instantiation: rmgr.c:newNode Unexecuted instantiation: slru.c:newNode Unexecuted instantiation: subtrans.c:newNode Unexecuted instantiation: timeline.c:newNode Unexecuted instantiation: transam.c:newNode Unexecuted instantiation: twophase.c:newNode Unexecuted instantiation: twophase_rmgr.c:newNode Unexecuted instantiation: varsup.c:newNode Unexecuted instantiation: xact.c:newNode Unexecuted instantiation: xlog.c:newNode Unexecuted instantiation: xlogarchive.c:newNode Unexecuted instantiation: xlogbackup.c:newNode Unexecuted instantiation: xlogfuncs.c:newNode Unexecuted instantiation: xloginsert.c:newNode Unexecuted instantiation: xlogprefetcher.c:newNode Unexecuted instantiation: xlogreader.c:newNode Unexecuted instantiation: xlogrecovery.c:newNode Unexecuted instantiation: xlogutils.c:newNode Unexecuted instantiation: xlogwait.c:newNode Unexecuted instantiation: bootparse.c:newNode Unexecuted instantiation: bootscanner.c:newNode Unexecuted instantiation: bootstrap.c:newNode Unexecuted instantiation: aclchk.c:newNode Unexecuted instantiation: catalog.c:newNode Unexecuted instantiation: dependency.c:newNode Unexecuted instantiation: heap.c:newNode Unexecuted instantiation: index.c:newNode Unexecuted instantiation: indexing.c:newNode Unexecuted instantiation: namespace.c:newNode Unexecuted instantiation: objectaccess.c:newNode Unexecuted instantiation: objectaddress.c:newNode Unexecuted instantiation: partition.c:newNode Unexecuted instantiation: pg_aggregate.c:newNode Unexecuted instantiation: pg_attrdef.c:newNode Unexecuted instantiation: pg_cast.c:newNode Unexecuted instantiation: pg_collation.c:newNode Unexecuted instantiation: pg_constraint.c:newNode Unexecuted instantiation: pg_conversion.c:newNode Unexecuted instantiation: pg_db_role_setting.c:newNode Unexecuted instantiation: pg_depend.c:newNode Unexecuted instantiation: pg_enum.c:newNode Unexecuted instantiation: pg_inherits.c:newNode Unexecuted instantiation: pg_largeobject.c:newNode Unexecuted instantiation: pg_namespace.c:newNode Unexecuted instantiation: pg_operator.c:newNode Unexecuted instantiation: pg_parameter_acl.c:newNode Unexecuted instantiation: pg_proc.c:newNode Unexecuted instantiation: pg_publication.c:newNode Unexecuted instantiation: pg_range.c:newNode Unexecuted instantiation: pg_shdepend.c:newNode Unexecuted instantiation: pg_subscription.c:newNode Unexecuted instantiation: pg_tablespace.c:newNode Unexecuted instantiation: pg_type.c:newNode Unexecuted instantiation: storage.c:newNode Unexecuted instantiation: toasting.c:newNode Line | Count | Source | 149 | 439 | { | 150 | 439 | Node *result; | 151 | | | 152 | 439 | Assert(size >= sizeof(Node)); /* need the tag, at least */ | 153 | 439 | result = (Node *) palloc0(size); | 154 | 439 | result->type = tag; | 155 | | | 156 | 439 | return result; | 157 | 439 | } |
Line | Count | Source | 149 | 756k | { | 150 | 756k | Node *result; | 151 | | | 152 | 756k | Assert(size >= sizeof(Node)); /* need the tag, at least */ | 153 | 756k | result = (Node *) palloc0(size); | 154 | 756k | result->type = tag; | 155 | | | 156 | 756k | return result; | 157 | 756k | } |
Unexecuted instantiation: parse_agg.c:newNode Unexecuted instantiation: parse_clause.c:newNode Unexecuted instantiation: parse_coerce.c:newNode Unexecuted instantiation: parse_collate.c:newNode Unexecuted instantiation: parse_cte.c:newNode Unexecuted instantiation: parse_enr.c:newNode Unexecuted instantiation: parse_expr.c:newNode Unexecuted instantiation: parse_func.c:newNode Unexecuted instantiation: parse_graphtable.c:newNode Unexecuted instantiation: parse_jsontable.c:newNode Unexecuted instantiation: parse_merge.c:newNode Unexecuted instantiation: parse_node.c:newNode Unexecuted instantiation: parse_oper.c:newNode Unexecuted instantiation: parse_param.c:newNode Unexecuted instantiation: parse_relation.c:newNode Unexecuted instantiation: parse_target.c:newNode Unexecuted instantiation: parse_type.c:newNode Unexecuted instantiation: parse_utilcmd.c:newNode Unexecuted instantiation: parser.c:newNode Unexecuted instantiation: scan.c:newNode Unexecuted instantiation: aggregatecmds.c:newNode Unexecuted instantiation: alter.c:newNode Unexecuted instantiation: amcmds.c:newNode Unexecuted instantiation: async.c:newNode Unexecuted instantiation: collationcmds.c:newNode Unexecuted instantiation: comment.c:newNode Unexecuted instantiation: constraint.c:newNode Unexecuted instantiation: conversioncmds.c:newNode Unexecuted instantiation: copy.c:newNode Unexecuted instantiation: copyfrom.c:newNode Unexecuted instantiation: copyfromparse.c:newNode Unexecuted instantiation: copyto.c:newNode Unexecuted instantiation: createas.c:newNode Unexecuted instantiation: dbcommands.c:newNode Unexecuted instantiation: define.c:newNode Unexecuted instantiation: discard.c:newNode Unexecuted instantiation: dropcmds.c:newNode Unexecuted instantiation: event_trigger.c:newNode Unexecuted instantiation: explain.c:newNode Unexecuted instantiation: explain_dr.c:newNode Unexecuted instantiation: explain_format.c:newNode Unexecuted instantiation: explain_state.c:newNode Unexecuted instantiation: extension.c:newNode Unexecuted instantiation: foreigncmds.c:newNode Unexecuted instantiation: functioncmds.c:newNode Unexecuted instantiation: indexcmds.c:newNode Unexecuted instantiation: lockcmds.c:newNode Unexecuted instantiation: matview.c:newNode Unexecuted instantiation: opclasscmds.c:newNode Unexecuted instantiation: operatorcmds.c:newNode Unexecuted instantiation: policy.c:newNode Unexecuted instantiation: portalcmds.c:newNode Unexecuted instantiation: prepare.c:newNode Unexecuted instantiation: proclang.c:newNode Unexecuted instantiation: propgraphcmds.c:newNode Unexecuted instantiation: publicationcmds.c:newNode Unexecuted instantiation: repack.c:newNode Unexecuted instantiation: repack_worker.c:newNode Unexecuted instantiation: schemacmds.c:newNode Unexecuted instantiation: seclabel.c:newNode Unexecuted instantiation: sequence_xlog.c:newNode Unexecuted instantiation: statscmds.c:newNode Unexecuted instantiation: subscriptioncmds.c:newNode Unexecuted instantiation: tablecmds.c:newNode Unexecuted instantiation: tablespace.c:newNode Unexecuted instantiation: trigger.c:newNode Unexecuted instantiation: tsearchcmds.c:newNode Unexecuted instantiation: typecmds.c:newNode Unexecuted instantiation: user.c:newNode Unexecuted instantiation: vacuum.c:newNode Unexecuted instantiation: vacuumparallel.c:newNode Unexecuted instantiation: variable.c:newNode Unexecuted instantiation: view.c:newNode Unexecuted instantiation: wait.c:newNode Unexecuted instantiation: execAmi.c:newNode Unexecuted instantiation: execAsync.c:newNode Unexecuted instantiation: execCurrent.c:newNode Unexecuted instantiation: execExpr.c:newNode Unexecuted instantiation: execExprInterp.c:newNode Unexecuted instantiation: execGrouping.c:newNode Unexecuted instantiation: execIndexing.c:newNode Unexecuted instantiation: execJunk.c:newNode Unexecuted instantiation: execMain.c:newNode Unexecuted instantiation: execParallel.c:newNode Unexecuted instantiation: execPartition.c:newNode Unexecuted instantiation: execProcnode.c:newNode Unexecuted instantiation: execReplication.c:newNode Unexecuted instantiation: execSRF.c:newNode Unexecuted instantiation: execScan.c:newNode Unexecuted instantiation: execTuples.c:newNode Unexecuted instantiation: execUtils.c:newNode Unexecuted instantiation: functions.c:newNode Unexecuted instantiation: instrument.c:newNode Unexecuted instantiation: nodeAgg.c:newNode Unexecuted instantiation: nodeAppend.c:newNode Unexecuted instantiation: nodeBitmapAnd.c:newNode Unexecuted instantiation: nodeBitmapHeapscan.c:newNode Unexecuted instantiation: nodeBitmapIndexscan.c:newNode Unexecuted instantiation: nodeBitmapOr.c:newNode Unexecuted instantiation: nodeCtescan.c:newNode Unexecuted instantiation: nodeCustom.c:newNode Unexecuted instantiation: nodeForeignscan.c:newNode Unexecuted instantiation: nodeFunctionscan.c:newNode Unexecuted instantiation: nodeGather.c:newNode Unexecuted instantiation: nodeGatherMerge.c:newNode Unexecuted instantiation: nodeGroup.c:newNode Unexecuted instantiation: nodeHash.c:newNode Unexecuted instantiation: nodeHashjoin.c:newNode Unexecuted instantiation: nodeIncrementalSort.c:newNode Unexecuted instantiation: nodeIndexonlyscan.c:newNode Unexecuted instantiation: nodeIndexscan.c:newNode Unexecuted instantiation: nodeLimit.c:newNode Unexecuted instantiation: nodeLockRows.c:newNode Unexecuted instantiation: nodeMaterial.c:newNode Unexecuted instantiation: nodeMemoize.c:newNode Unexecuted instantiation: nodeMergeAppend.c:newNode Unexecuted instantiation: nodeMergejoin.c:newNode Unexecuted instantiation: nodeModifyTable.c:newNode Unexecuted instantiation: nodeNamedtuplestorescan.c:newNode Unexecuted instantiation: nodeNestloop.c:newNode Unexecuted instantiation: nodeProjectSet.c:newNode Unexecuted instantiation: nodeRecursiveunion.c:newNode Unexecuted instantiation: nodeResult.c:newNode Unexecuted instantiation: nodeSamplescan.c:newNode Unexecuted instantiation: nodeSeqscan.c:newNode Unexecuted instantiation: nodeSetOp.c:newNode Unexecuted instantiation: nodeSort.c:newNode Unexecuted instantiation: nodeSubplan.c:newNode Unexecuted instantiation: nodeSubqueryscan.c:newNode Unexecuted instantiation: nodeTableFuncscan.c:newNode Unexecuted instantiation: nodeTidrangescan.c:newNode Unexecuted instantiation: nodeTidscan.c:newNode Unexecuted instantiation: nodeUnique.c:newNode Unexecuted instantiation: nodeValuesscan.c:newNode Unexecuted instantiation: nodeWindowAgg.c:newNode Unexecuted instantiation: nodeWorktablescan.c:newNode Unexecuted instantiation: spi.c:newNode Unexecuted instantiation: tqueue.c:newNode Unexecuted instantiation: tstoreReceiver.c:newNode Unexecuted instantiation: foreign.c:newNode Unexecuted instantiation: integerset.c:newNode Unexecuted instantiation: knapsack.c:newNode Unexecuted instantiation: auth-oauth.c:newNode Unexecuted instantiation: auth-sasl.c:newNode Unexecuted instantiation: auth-scram.c:newNode Unexecuted instantiation: auth.c:newNode Unexecuted instantiation: be-fsstubs.c:newNode Unexecuted instantiation: be-secure-common.c:newNode Unexecuted instantiation: be-secure.c:newNode Unexecuted instantiation: crypt.c:newNode Unexecuted instantiation: hba.c:newNode Unexecuted instantiation: pqcomm.c:newNode Unexecuted instantiation: pqformat.c:newNode Unexecuted instantiation: pqmq.c:newNode Unexecuted instantiation: bitmapset.c:newNode Unexecuted instantiation: copyfuncs.c:newNode Unexecuted instantiation: equalfuncs.c:newNode Unexecuted instantiation: extensible.c:newNode Unexecuted instantiation: list.c:newNode Line | Count | Source | 149 | 181k | { | 150 | 181k | Node *result; | 151 | | | 152 | 181k | Assert(size >= sizeof(Node)); /* need the tag, at least */ | 153 | 181k | result = (Node *) palloc0(size); | 154 | 181k | result->type = tag; | 155 | | | 156 | 181k | return result; | 157 | 181k | } |
Unexecuted instantiation: multibitmapset.c:newNode Unexecuted instantiation: nodeFuncs.c:newNode Unexecuted instantiation: outfuncs.c:newNode Unexecuted instantiation: params.c:newNode Unexecuted instantiation: print.c:newNode Unexecuted instantiation: queryjumblefuncs.c:newNode Unexecuted instantiation: read.c:newNode Unexecuted instantiation: readfuncs.c:newNode Unexecuted instantiation: tidbitmap.c:newNode Line | Count | Source | 149 | 4.31M | { | 150 | 4.31M | Node *result; | 151 | | | 152 | 4.31M | Assert(size >= sizeof(Node)); /* need the tag, at least */ | 153 | 4.31M | result = (Node *) palloc0(size); | 154 | 4.31M | result->type = tag; | 155 | | | 156 | 4.31M | return result; | 157 | 4.31M | } |
Unexecuted instantiation: geqo_copy.c:newNode Unexecuted instantiation: geqo_cx.c:newNode Unexecuted instantiation: geqo_erx.c:newNode Unexecuted instantiation: geqo_eval.c:newNode Unexecuted instantiation: geqo_main.c:newNode Unexecuted instantiation: geqo_misc.c:newNode Unexecuted instantiation: geqo_mutation.c:newNode Unexecuted instantiation: geqo_ox1.c:newNode Unexecuted instantiation: geqo_ox2.c:newNode Unexecuted instantiation: geqo_pmx.c:newNode Unexecuted instantiation: geqo_pool.c:newNode Unexecuted instantiation: geqo_px.c:newNode Unexecuted instantiation: geqo_random.c:newNode Unexecuted instantiation: geqo_recombination.c:newNode Unexecuted instantiation: geqo_selection.c:newNode Unexecuted instantiation: allpaths.c:newNode Unexecuted instantiation: clausesel.c:newNode Unexecuted instantiation: costsize.c:newNode Unexecuted instantiation: equivclass.c:newNode Unexecuted instantiation: indxpath.c:newNode Unexecuted instantiation: joinpath.c:newNode Unexecuted instantiation: joinrels.c:newNode Unexecuted instantiation: pathkeys.c:newNode Unexecuted instantiation: tidpath.c:newNode Unexecuted instantiation: analyzejoins.c:newNode Unexecuted instantiation: createplan.c:newNode Unexecuted instantiation: initsplan.c:newNode Unexecuted instantiation: planagg.c:newNode Unexecuted instantiation: planmain.c:newNode Unexecuted instantiation: planner.c:newNode Unexecuted instantiation: setrefs.c:newNode Unexecuted instantiation: subselect.c:newNode Unexecuted instantiation: prepagg.c:newNode Unexecuted instantiation: prepjointree.c:newNode Unexecuted instantiation: prepqual.c:newNode Unexecuted instantiation: preptlist.c:newNode Unexecuted instantiation: prepunion.c:newNode Unexecuted instantiation: appendinfo.c:newNode Unexecuted instantiation: clauses.c:newNode Unexecuted instantiation: extendplan.c:newNode Unexecuted instantiation: inherit.c:newNode Unexecuted instantiation: joininfo.c:newNode Unexecuted instantiation: orclauses.c:newNode Unexecuted instantiation: paramassign.c:newNode Unexecuted instantiation: pathnode.c:newNode Unexecuted instantiation: placeholder.c:newNode Unexecuted instantiation: plancat.c:newNode Unexecuted instantiation: predtest.c:newNode Unexecuted instantiation: relnode.c:newNode Unexecuted instantiation: restrictinfo.c:newNode Unexecuted instantiation: tlist.c:newNode Unexecuted instantiation: var.c:newNode Unexecuted instantiation: partbounds.c:newNode Unexecuted instantiation: partdesc.c:newNode Unexecuted instantiation: partprune.c:newNode Unexecuted instantiation: pg_shmem.c:newNode Unexecuted instantiation: autovacuum.c:newNode Unexecuted instantiation: auxprocess.c:newNode Unexecuted instantiation: bgworker.c:newNode Unexecuted instantiation: bgwriter.c:newNode Unexecuted instantiation: checkpointer.c:newNode Unexecuted instantiation: datachecksum_state.c:newNode Unexecuted instantiation: interrupt.c:newNode Unexecuted instantiation: launch_backend.c:newNode Unexecuted instantiation: pgarch.c:newNode Unexecuted instantiation: postmaster.c:newNode Unexecuted instantiation: startup.c:newNode Unexecuted instantiation: syslogger.c:newNode Unexecuted instantiation: walsummarizer.c:newNode Unexecuted instantiation: walwriter.c:newNode Unexecuted instantiation: applyparallelworker.c:newNode Unexecuted instantiation: conflict.c:newNode Unexecuted instantiation: decode.c:newNode Unexecuted instantiation: launcher.c:newNode Unexecuted instantiation: logical.c:newNode Unexecuted instantiation: logicalctl.c:newNode Unexecuted instantiation: logicalfuncs.c:newNode Unexecuted instantiation: message.c:newNode Unexecuted instantiation: origin.c:newNode Unexecuted instantiation: proto.c:newNode Unexecuted instantiation: reorderbuffer.c:newNode Unexecuted instantiation: sequencesync.c:newNode Unexecuted instantiation: slotsync.c:newNode Unexecuted instantiation: snapbuild.c:newNode Unexecuted instantiation: syncutils.c:newNode Unexecuted instantiation: tablesync.c:newNode Unexecuted instantiation: worker.c:newNode Unexecuted instantiation: repl_gram.c:newNode Unexecuted instantiation: repl_scanner.c:newNode Unexecuted instantiation: slot.c:newNode Unexecuted instantiation: slotfuncs.c:newNode Unexecuted instantiation: syncrep.c:newNode Unexecuted instantiation: syncrep_gram.c:newNode Unexecuted instantiation: syncrep_scanner.c:newNode Unexecuted instantiation: walreceiver.c:newNode Unexecuted instantiation: walreceiverfuncs.c:newNode Unexecuted instantiation: walsender.c:newNode Unexecuted instantiation: rewriteDefine.c:newNode Unexecuted instantiation: rewriteGraphTable.c:newNode Unexecuted instantiation: rewriteHandler.c:newNode Unexecuted instantiation: rewriteManip.c:newNode Unexecuted instantiation: rewriteRemove.c:newNode Unexecuted instantiation: rewriteSearchCycle.c:newNode Unexecuted instantiation: rewriteSupport.c:newNode Unexecuted instantiation: rowsecurity.c:newNode Unexecuted instantiation: backup_manifest.c:newNode Unexecuted instantiation: basebackup.c:newNode Unexecuted instantiation: basebackup_copy.c:newNode Unexecuted instantiation: basebackup_gzip.c:newNode Unexecuted instantiation: basebackup_incremental.c:newNode Unexecuted instantiation: basebackup_lz4.c:newNode Unexecuted instantiation: basebackup_zstd.c:newNode Unexecuted instantiation: basebackup_progress.c:newNode Unexecuted instantiation: basebackup_server.c:newNode Unexecuted instantiation: basebackup_sink.c:newNode Unexecuted instantiation: basebackup_target.c:newNode Unexecuted instantiation: basebackup_throttle.c:newNode Unexecuted instantiation: walsummary.c:newNode Unexecuted instantiation: walsummaryfuncs.c:newNode Unexecuted instantiation: attribute_stats.c:newNode Unexecuted instantiation: dependencies.c:newNode Unexecuted instantiation: extended_stats.c:newNode Unexecuted instantiation: extended_stats_funcs.c:newNode Unexecuted instantiation: mcv.c:newNode Unexecuted instantiation: mvdistinct.c:newNode Unexecuted instantiation: relation_stats.c:newNode Unexecuted instantiation: stat_utils.c:newNode Unexecuted instantiation: aio.c:newNode Unexecuted instantiation: aio_callback.c:newNode Unexecuted instantiation: aio_funcs.c:newNode Unexecuted instantiation: aio_init.c:newNode Unexecuted instantiation: method_worker.c:newNode Unexecuted instantiation: read_stream.c:newNode Unexecuted instantiation: buf_init.c:newNode Unexecuted instantiation: buf_table.c:newNode Unexecuted instantiation: bufmgr.c:newNode Unexecuted instantiation: freelist.c:newNode Unexecuted instantiation: localbuf.c:newNode Unexecuted instantiation: buffile.c:newNode Unexecuted instantiation: copydir.c:newNode Unexecuted instantiation: fd.c:newNode Unexecuted instantiation: fileset.c:newNode Unexecuted instantiation: reinit.c:newNode Unexecuted instantiation: freespace.c:newNode Unexecuted instantiation: fsmpage.c:newNode Unexecuted instantiation: indexfsm.c:newNode Unexecuted instantiation: dsm.c:newNode Unexecuted instantiation: dsm_impl.c:newNode Unexecuted instantiation: dsm_registry.c:newNode Unexecuted instantiation: ipc.c:newNode Unexecuted instantiation: ipci.c:newNode Unexecuted instantiation: pmsignal.c:newNode Unexecuted instantiation: procarray.c:newNode Unexecuted instantiation: procsignal.c:newNode Unexecuted instantiation: shm_mq.c:newNode Unexecuted instantiation: shmem.c:newNode Unexecuted instantiation: shmem_hash.c:newNode Unexecuted instantiation: signalfuncs.c:newNode Unexecuted instantiation: sinval.c:newNode Unexecuted instantiation: standby.c:newNode Unexecuted instantiation: waiteventset.c:newNode Unexecuted instantiation: inv_api.c:newNode Unexecuted instantiation: deadlock.c:newNode Unexecuted instantiation: lmgr.c:newNode Unexecuted instantiation: lock.c:newNode Unexecuted instantiation: lwlock.c:newNode Unexecuted instantiation: predicate.c:newNode Unexecuted instantiation: proc.c:newNode Unexecuted instantiation: bufpage.c:newNode Unexecuted instantiation: bulk_write.c:newNode Unexecuted instantiation: md.c:newNode Unexecuted instantiation: smgr.c:newNode Unexecuted instantiation: sync.c:newNode Unexecuted instantiation: backend_startup.c:newNode Unexecuted instantiation: cmdtag.c:newNode Unexecuted instantiation: dest.c:newNode Unexecuted instantiation: fastpath.c:newNode Line | Count | Source | 149 | 439 | { | 150 | 439 | Node *result; | 151 | | | 152 | 439 | Assert(size >= sizeof(Node)); /* need the tag, at least */ | 153 | 439 | result = (Node *) palloc0(size); | 154 | 439 | result->type = tag; | 155 | | | 156 | 439 | return result; | 157 | 439 | } |
Unexecuted instantiation: pquery.c:newNode Unexecuted instantiation: utility.c:newNode Unexecuted instantiation: dict.c:newNode Unexecuted instantiation: dict_ispell.c:newNode Unexecuted instantiation: dict_simple.c:newNode Unexecuted instantiation: dict_synonym.c:newNode Unexecuted instantiation: dict_thesaurus.c:newNode Unexecuted instantiation: spell.c:newNode Unexecuted instantiation: to_tsany.c:newNode Unexecuted instantiation: ts_parse.c:newNode Unexecuted instantiation: ts_selfuncs.c:newNode Unexecuted instantiation: ts_typanalyze.c:newNode Unexecuted instantiation: ts_utils.c:newNode Unexecuted instantiation: wparser.c:newNode Unexecuted instantiation: wparser_def.c:newNode Unexecuted instantiation: backend_status.c:newNode Unexecuted instantiation: pgstat.c:newNode Unexecuted instantiation: pgstat_archiver.c:newNode Unexecuted instantiation: pgstat_backend.c:newNode Unexecuted instantiation: pgstat_bgwriter.c:newNode Unexecuted instantiation: pgstat_checkpointer.c:newNode Unexecuted instantiation: pgstat_database.c:newNode Unexecuted instantiation: pgstat_function.c:newNode Unexecuted instantiation: pgstat_index.c:newNode Unexecuted instantiation: pgstat_io.c:newNode Unexecuted instantiation: pgstat_kind.c:newNode Unexecuted instantiation: pgstat_lock.c:newNode Unexecuted instantiation: pgstat_relation.c:newNode Unexecuted instantiation: pgstat_replslot.c:newNode Unexecuted instantiation: pgstat_shmem.c:newNode Unexecuted instantiation: pgstat_slru.c:newNode Unexecuted instantiation: pgstat_subscription.c:newNode Unexecuted instantiation: pgstat_wal.c:newNode Unexecuted instantiation: pgstat_xact.c:newNode Unexecuted instantiation: wait_event.c:newNode Unexecuted instantiation: wait_event_funcs.c:newNode Unexecuted instantiation: acl.c:newNode Unexecuted instantiation: amutils.c:newNode Unexecuted instantiation: array_expanded.c:newNode Unexecuted instantiation: array_selfuncs.c:newNode Unexecuted instantiation: array_typanalyze.c:newNode Unexecuted instantiation: array_userfuncs.c:newNode Unexecuted instantiation: arrayfuncs.c:newNode Unexecuted instantiation: arraysubs.c:newNode Unexecuted instantiation: arrayutils.c:newNode Unexecuted instantiation: bool.c:newNode Unexecuted instantiation: bytea.c:newNode Unexecuted instantiation: cash.c:newNode Unexecuted instantiation: cryptohashfuncs.c:newNode Unexecuted instantiation: date.c:newNode Unexecuted instantiation: datetime.c:newNode Unexecuted instantiation: dbsize.c:newNode Unexecuted instantiation: ddlutils.c:newNode Unexecuted instantiation: domains.c:newNode Unexecuted instantiation: encode.c:newNode Unexecuted instantiation: enum.c:newNode Unexecuted instantiation: expandeddatum.c:newNode Unexecuted instantiation: expandedrecord.c:newNode Unexecuted instantiation: float.c:newNode Unexecuted instantiation: format_type.c:newNode Unexecuted instantiation: formatting.c:newNode Unexecuted instantiation: genfile.c:newNode Unexecuted instantiation: geo_ops.c:newNode Unexecuted instantiation: geo_spgist.c:newNode Unexecuted instantiation: hbafuncs.c:newNode Unexecuted instantiation: inet_cidr_ntop.c:newNode Unexecuted instantiation: inet_net_pton.c:newNode Unexecuted instantiation: int.c:newNode Unexecuted instantiation: int8.c:newNode Unexecuted instantiation: json.c:newNode Unexecuted instantiation: jsonb.c:newNode Unexecuted instantiation: jsonb_gin.c:newNode Unexecuted instantiation: jsonb_op.c:newNode Unexecuted instantiation: jsonb_util.c:newNode Unexecuted instantiation: jsonfuncs.c:newNode Unexecuted instantiation: jsonbsubs.c:newNode Unexecuted instantiation: jsonpath.c:newNode Unexecuted instantiation: jsonpath_exec.c:newNode Unexecuted instantiation: jsonpath_gram.c:newNode Unexecuted instantiation: jsonpath_scan.c:newNode Unexecuted instantiation: like_support.c:newNode Unexecuted instantiation: lockfuncs.c:newNode Unexecuted instantiation: mac.c:newNode Unexecuted instantiation: mac8.c:newNode Unexecuted instantiation: mcxtfuncs.c:newNode Unexecuted instantiation: misc.c:newNode Unexecuted instantiation: multirangetypes.c:newNode Unexecuted instantiation: multirangetypes_selfuncs.c:newNode Unexecuted instantiation: multixactfuncs.c:newNode Unexecuted instantiation: name.c:newNode Unexecuted instantiation: network.c:newNode Unexecuted instantiation: network_gist.c:newNode Unexecuted instantiation: network_selfuncs.c:newNode Unexecuted instantiation: network_spgist.c:newNode Unexecuted instantiation: numeric.c:newNode Unexecuted instantiation: numutils.c:newNode Unexecuted instantiation: oid.c:newNode Unexecuted instantiation: oid8.c:newNode Unexecuted instantiation: oracle_compat.c:newNode Unexecuted instantiation: orderedsetaggs.c:newNode Unexecuted instantiation: partitionfuncs.c:newNode Unexecuted instantiation: pg_dependencies.c:newNode Unexecuted instantiation: pg_locale.c:newNode Unexecuted instantiation: pg_locale_builtin.c:newNode Unexecuted instantiation: pg_locale_icu.c:newNode Unexecuted instantiation: pg_locale_libc.c:newNode Unexecuted instantiation: pg_ndistinct.c:newNode Unexecuted instantiation: pg_upgrade_support.c:newNode Unexecuted instantiation: pgstatfuncs.c:newNode Unexecuted instantiation: quote.c:newNode Unexecuted instantiation: rangetypes.c:newNode Unexecuted instantiation: rangetypes_gist.c:newNode Unexecuted instantiation: rangetypes_selfuncs.c:newNode Unexecuted instantiation: rangetypes_spgist.c:newNode Unexecuted instantiation: rangetypes_typanalyze.c:newNode Unexecuted instantiation: regexp.c:newNode Unexecuted instantiation: regproc.c:newNode Unexecuted instantiation: ri_triggers.c:newNode Unexecuted instantiation: rowtypes.c:newNode Unexecuted instantiation: ruleutils.c:newNode Unexecuted instantiation: selfuncs.c:newNode Unexecuted instantiation: skipsupport.c:newNode Unexecuted instantiation: tid.c:newNode Unexecuted instantiation: timestamp.c:newNode Unexecuted instantiation: trigfuncs.c:newNode Unexecuted instantiation: tsginidx.c:newNode Unexecuted instantiation: tsgistidx.c:newNode Unexecuted instantiation: tsquery.c:newNode Unexecuted instantiation: tsquery_cleanup.c:newNode Unexecuted instantiation: tsquery_gist.c:newNode Unexecuted instantiation: tsquery_op.c:newNode Unexecuted instantiation: tsquery_rewrite.c:newNode Unexecuted instantiation: tsquery_util.c:newNode Unexecuted instantiation: tsrank.c:newNode Unexecuted instantiation: tsvector.c:newNode Unexecuted instantiation: tsvector_op.c:newNode Unexecuted instantiation: tsvector_parser.c:newNode Unexecuted instantiation: uuid.c:newNode Unexecuted instantiation: varbit.c:newNode Unexecuted instantiation: varchar.c:newNode Unexecuted instantiation: varlena.c:newNode Unexecuted instantiation: version.c:newNode Unexecuted instantiation: waitfuncs.c:newNode Unexecuted instantiation: windowfuncs.c:newNode Unexecuted instantiation: xid.c:newNode Unexecuted instantiation: xid8funcs.c:newNode Unexecuted instantiation: xml.c:newNode Unexecuted instantiation: attoptcache.c:newNode Unexecuted instantiation: catcache.c:newNode Unexecuted instantiation: evtcache.c:newNode Unexecuted instantiation: funccache.c:newNode Unexecuted instantiation: inval.c:newNode Unexecuted instantiation: lsyscache.c:newNode Unexecuted instantiation: partcache.c:newNode Unexecuted instantiation: plancache.c:newNode Unexecuted instantiation: relcache.c:newNode Unexecuted instantiation: relfilenumbermap.c:newNode Unexecuted instantiation: relmapper.c:newNode Unexecuted instantiation: spccache.c:newNode Unexecuted instantiation: syscache.c:newNode Unexecuted instantiation: ts_cache.c:newNode Unexecuted instantiation: typcache.c:newNode Unexecuted instantiation: csvlog.c:newNode Unexecuted instantiation: elog.c:newNode Unexecuted instantiation: jsonlog.c:newNode Unexecuted instantiation: fmgr.c:newNode Unexecuted instantiation: funcapi.c:newNode Unexecuted instantiation: dynahash.c:newNode Unexecuted instantiation: globals.c:newNode Unexecuted instantiation: miscinit.c:newNode Unexecuted instantiation: postinit.c:newNode Unexecuted instantiation: usercontext.c:newNode Unexecuted instantiation: mbutils.c:newNode Unexecuted instantiation: guc.c:newNode Unexecuted instantiation: guc-file.c:newNode Unexecuted instantiation: guc_funcs.c:newNode Unexecuted instantiation: guc_tables.c:newNode Unexecuted instantiation: help_config.c:newNode Unexecuted instantiation: injection_point.c:newNode Unexecuted instantiation: pg_config.c:newNode Unexecuted instantiation: pg_controldata.c:newNode Unexecuted instantiation: ps_status.c:newNode Unexecuted instantiation: queryenvironment.c:newNode Unexecuted instantiation: rls.c:newNode Unexecuted instantiation: stack_depth.c:newNode Unexecuted instantiation: superuser.c:newNode Unexecuted instantiation: tzparser.c:newNode Unexecuted instantiation: alignedalloc.c:newNode Unexecuted instantiation: aset.c:newNode Unexecuted instantiation: bump.c:newNode Unexecuted instantiation: dsa.c:newNode Unexecuted instantiation: generation.c:newNode Unexecuted instantiation: mcxt.c:newNode Unexecuted instantiation: portalmem.c:newNode Unexecuted instantiation: slab.c:newNode Unexecuted instantiation: resowner.c:newNode Unexecuted instantiation: logtape.c:newNode Unexecuted instantiation: sharedtuplestore.c:newNode Unexecuted instantiation: sortsupport.c:newNode Unexecuted instantiation: tuplesort.c:newNode Unexecuted instantiation: tuplesortvariants.c:newNode Unexecuted instantiation: tuplestore.c:newNode Unexecuted instantiation: combocid.c:newNode Unexecuted instantiation: snapmgr.c:newNode Unexecuted instantiation: jit.c:newNode Unexecuted instantiation: blkreftable.c:newNode Unexecuted instantiation: controldata_utils.c:newNode Unexecuted instantiation: psprintf.c:newNode Unexecuted instantiation: saslprep.c:newNode Unexecuted instantiation: stringinfo.c:newNode Unexecuted instantiation: unicode_norm.c:newNode Unexecuted instantiation: shell_archive.c:newNode Unexecuted instantiation: simple_query_fuzzer.c:newNode |
158 | | |
159 | 5.25M | #define makeNode(_type_) ((_type_ *) newNode(sizeof(_type_),T_##_type_)) |
160 | 0 | #define NodeSetTag(nodeptr,t) (((Node*)(nodeptr))->type = (t)) |
161 | | |
162 | 10.6M | #define IsA(nodeptr,_type_) (nodeTag(nodeptr) == T_##_type_) |
163 | | |
164 | | /* |
165 | | * castNode(type, ptr) casts ptr to "type *", and if assertions are enabled, |
166 | | * verifies that the node has the appropriate type (using its nodeTag()). |
167 | | * |
168 | | * Use an inline function when assertions are enabled, to avoid multiple |
169 | | * evaluations of the ptr argument (which could e.g. be a function call). |
170 | | */ |
171 | | #ifdef USE_ASSERT_CHECKING |
172 | | static inline Node * |
173 | | castNodeImpl(NodeTag type, void *ptr) |
174 | | { |
175 | | Assert(ptr == NULL || nodeTag(ptr) == type); |
176 | | return (Node *) ptr; |
177 | | } |
178 | | #define castNode(_type_, nodeptr) ((_type_ *) castNodeImpl(T_##_type_, nodeptr)) |
179 | | #else |
180 | 2.09k | #define castNode(_type_, nodeptr) ((_type_ *) (nodeptr)) |
181 | | #endif /* USE_ASSERT_CHECKING */ |
182 | | |
183 | | |
184 | | /* ---------------------------------------------------------------- |
185 | | * extern declarations follow |
186 | | * ---------------------------------------------------------------- |
187 | | */ |
188 | | |
189 | | #ifndef FRONTEND |
190 | | |
191 | | /* |
192 | | * nodes/{outfuncs.c,print.c} |
193 | | */ |
194 | | struct Bitmapset; /* not to include bitmapset.h here */ |
195 | | struct StringInfoData; /* not to include stringinfo.h here */ |
196 | | |
197 | | extern void outNode(struct StringInfoData *str, const void *obj); |
198 | | extern void outToken(struct StringInfoData *str, const char *s); |
199 | | extern void outBitmapset(struct StringInfoData *str, |
200 | | const struct Bitmapset *bms); |
201 | | extern void outDatum(struct StringInfoData *str, Datum value, |
202 | | int typlen, bool typbyval); |
203 | | extern char *nodeToString(const void *obj); |
204 | | extern char *nodeToStringWithLocations(const void *obj); |
205 | | extern char *bmsToString(const struct Bitmapset *bms); |
206 | | |
207 | | /* |
208 | | * nodes/{readfuncs.c,read.c} |
209 | | */ |
210 | | extern void *stringToNode(const char *str); |
211 | | #ifdef DEBUG_NODE_TESTS_ENABLED |
212 | | extern void *stringToNodeWithLocations(const char *str); |
213 | | #endif |
214 | | extern struct Bitmapset *readBitmapset(void); |
215 | | extern Datum readDatum(bool typbyval); |
216 | | extern bool *readBoolCols(int numCols); |
217 | | extern int *readIntCols(int numCols); |
218 | | extern Oid *readOidCols(int numCols); |
219 | | extern int16 *readAttrNumberCols(int numCols); |
220 | | |
221 | | /* |
222 | | * nodes/copyfuncs.c |
223 | | */ |
224 | | extern void *copyObjectImpl(const void *from); |
225 | | |
226 | | /* cast result back to argument type, if supported by compiler */ |
227 | | #ifdef HAVE_TYPEOF_UNQUAL |
228 | 0 | #define copyObject(obj) ((typeof_unqual(*(obj)) *) copyObjectImpl(obj)) |
229 | | #else |
230 | | #define copyObject(obj) copyObjectImpl(obj) |
231 | | #endif |
232 | | |
233 | | /* |
234 | | * nodes/equalfuncs.c |
235 | | */ |
236 | | extern bool equal(const void *a, const void *b); |
237 | | |
238 | | #endif /* !FRONTEND */ |
239 | | |
240 | | |
241 | | /* |
242 | | * Typedef for parse location. This is just an int, but this way |
243 | | * gen_node_support.pl knows which fields should get special treatment for |
244 | | * location values. |
245 | | * |
246 | | * -1 is used for unknown. |
247 | | */ |
248 | | typedef int ParseLoc; |
249 | | |
250 | | /* |
251 | | * Typedefs for identifying qualifier selectivities, plan costs, and row |
252 | | * counts as such. These are just plain "double"s, but declaring a variable |
253 | | * as Selectivity, Cost, or Cardinality makes the intent more obvious. |
254 | | * |
255 | | * These could have gone into plannodes.h or some such, but many files |
256 | | * depend on them... |
257 | | */ |
258 | | typedef double Selectivity; /* fraction of tuples a qualifier will pass */ |
259 | | typedef double Cost; /* execution cost (in page-access units) */ |
260 | | typedef double Cardinality; /* (estimated) number of rows or other integer |
261 | | * count */ |
262 | | |
263 | | |
264 | | /* |
265 | | * CmdType - |
266 | | * enums for type of operation represented by a Query or PlannedStmt |
267 | | * |
268 | | * This is needed in both parsenodes.h and plannodes.h, so put it here... |
269 | | */ |
270 | | typedef enum CmdType |
271 | | { |
272 | | CMD_UNKNOWN, |
273 | | CMD_SELECT, /* select stmt */ |
274 | | CMD_UPDATE, /* update stmt */ |
275 | | CMD_INSERT, /* insert stmt */ |
276 | | CMD_DELETE, /* delete stmt */ |
277 | | CMD_MERGE, /* merge stmt */ |
278 | | CMD_UTILITY, /* cmds like create, destroy, copy, vacuum, |
279 | | * etc. */ |
280 | | CMD_NOTHING, /* dummy command for instead nothing rules |
281 | | * with qual */ |
282 | | } CmdType; |
283 | | |
284 | | |
285 | | /* |
286 | | * JoinType - |
287 | | * enums for types of relation joins |
288 | | * |
289 | | * JoinType determines the exact semantics of joining two relations using |
290 | | * a matching qualification. For example, it tells what to do with a tuple |
291 | | * that has no match in the other relation. |
292 | | * |
293 | | * This is needed in both parsenodes.h and plannodes.h, so put it here... |
294 | | */ |
295 | | typedef enum JoinType |
296 | | { |
297 | | /* |
298 | | * The canonical kinds of joins according to the SQL JOIN syntax. Only |
299 | | * these codes can appear in parser output (e.g., JoinExpr nodes). |
300 | | */ |
301 | | JOIN_INNER, /* matching tuple pairs only */ |
302 | | JOIN_LEFT, /* pairs + unmatched LHS tuples */ |
303 | | JOIN_FULL, /* pairs + unmatched LHS + unmatched RHS */ |
304 | | JOIN_RIGHT, /* pairs + unmatched RHS tuples */ |
305 | | |
306 | | /* |
307 | | * Semijoins and anti-semijoins (as defined in relational theory) do not |
308 | | * appear in the SQL JOIN syntax, but there are standard idioms for |
309 | | * representing them (e.g., using EXISTS). The planner recognizes these |
310 | | * cases and converts them to joins. So the planner and executor must |
311 | | * support these codes. NOTE: in JOIN_SEMI output, it is unspecified |
312 | | * which matching RHS row is joined to. In JOIN_ANTI output, the row is |
313 | | * guaranteed to be null-extended. |
314 | | */ |
315 | | JOIN_SEMI, /* 1 copy of each LHS row that has match(es) */ |
316 | | JOIN_ANTI, /* 1 copy of each LHS row that has no match */ |
317 | | JOIN_RIGHT_SEMI, /* 1 copy of each RHS row that has match(es) */ |
318 | | JOIN_RIGHT_ANTI, /* 1 copy of each RHS row that has no match */ |
319 | | |
320 | | /* |
321 | | * These codes are used internally in the planner, but are not supported |
322 | | * by the executor (nor, indeed, by most of the planner). |
323 | | */ |
324 | | JOIN_UNIQUE_OUTER, /* LHS has be made unique */ |
325 | | JOIN_UNIQUE_INNER, /* RHS has be made unique */ |
326 | | |
327 | | /* |
328 | | * We might need additional join types someday. |
329 | | */ |
330 | | } JoinType; |
331 | | |
332 | | /* |
333 | | * OUTER joins are those for which pushed-down quals must behave differently |
334 | | * from the join's own quals. This is in fact everything except INNER, SEMI |
335 | | * and RIGHT_SEMI joins. However, this macro must also exclude the |
336 | | * JOIN_UNIQUE symbols since those are temporary proxies for what will |
337 | | * eventually be an INNER join. |
338 | | * |
339 | | * Note: semijoins are a hybrid case, but we choose to treat them as not |
340 | | * being outer joins. This is okay principally because the SQL syntax makes |
341 | | * it impossible to have a pushed-down qual that refers to the inner relation |
342 | | * of a semijoin; so there is no strong need to distinguish join quals from |
343 | | * pushed-down quals. This is convenient because for almost all purposes, |
344 | | * quals attached to a semijoin can be treated the same as innerjoin quals. |
345 | | */ |
346 | | #define IS_OUTER_JOIN(jointype) \ |
347 | 0 | (((1 << (jointype)) & \ |
348 | 0 | ((1 << JOIN_LEFT) | \ |
349 | 0 | (1 << JOIN_FULL) | \ |
350 | 0 | (1 << JOIN_RIGHT) | \ |
351 | 0 | (1 << JOIN_ANTI) | \ |
352 | 0 | (1 << JOIN_RIGHT_ANTI))) != 0) |
353 | | |
354 | | /* |
355 | | * AggStrategy - |
356 | | * overall execution strategies for Agg plan nodes |
357 | | * |
358 | | * This is needed in both pathnodes.h and plannodes.h, so put it here... |
359 | | */ |
360 | | typedef enum AggStrategy |
361 | | { |
362 | | AGG_PLAIN, /* simple agg across all input rows */ |
363 | | AGG_SORTED, /* grouped agg, input must be sorted */ |
364 | | AGG_HASHED, /* grouped agg, use internal hashtable */ |
365 | | AGG_MIXED, /* grouped agg, hash and sort both used */ |
366 | | } AggStrategy; |
367 | | |
368 | | /* |
369 | | * AggSplit - |
370 | | * splitting (partial aggregation) modes for Agg plan nodes |
371 | | * |
372 | | * This is needed in both pathnodes.h and plannodes.h, so put it here... |
373 | | */ |
374 | | |
375 | | /* Primitive options supported by nodeAgg.c: */ |
376 | 0 | #define AGGSPLITOP_COMBINE 0x01 /* substitute combinefn for transfn */ |
377 | 0 | #define AGGSPLITOP_SKIPFINAL 0x02 /* skip finalfn, return state as-is */ |
378 | 0 | #define AGGSPLITOP_SERIALIZE 0x04 /* apply serialfn to output */ |
379 | 0 | #define AGGSPLITOP_DESERIALIZE 0x08 /* apply deserialfn to input */ |
380 | | |
381 | | /* Supported operating modes (i.e., useful combinations of these options): */ |
382 | | typedef enum AggSplit |
383 | | { |
384 | | /* Basic, non-split aggregation: */ |
385 | | AGGSPLIT_SIMPLE = 0, |
386 | | /* Initial phase of partial aggregation, with serialization: */ |
387 | | AGGSPLIT_INITIAL_SERIAL = AGGSPLITOP_SKIPFINAL | AGGSPLITOP_SERIALIZE, |
388 | | /* Final phase of partial aggregation, with deserialization: */ |
389 | | AGGSPLIT_FINAL_DESERIAL = AGGSPLITOP_COMBINE | AGGSPLITOP_DESERIALIZE, |
390 | | } AggSplit; |
391 | | |
392 | | /* Test whether an AggSplit value selects each primitive option: */ |
393 | 0 | #define DO_AGGSPLIT_COMBINE(as) (((as) & AGGSPLITOP_COMBINE) != 0) |
394 | 0 | #define DO_AGGSPLIT_SKIPFINAL(as) (((as) & AGGSPLITOP_SKIPFINAL) != 0) |
395 | 0 | #define DO_AGGSPLIT_SERIALIZE(as) (((as) & AGGSPLITOP_SERIALIZE) != 0) |
396 | 0 | #define DO_AGGSPLIT_DESERIALIZE(as) (((as) & AGGSPLITOP_DESERIALIZE) != 0) |
397 | | |
398 | | /* |
399 | | * SetOpCmd and SetOpStrategy - |
400 | | * overall semantics and execution strategies for SetOp plan nodes |
401 | | * |
402 | | * This is needed in both pathnodes.h and plannodes.h, so put it here... |
403 | | */ |
404 | | typedef enum SetOpCmd |
405 | | { |
406 | | SETOPCMD_INTERSECT, |
407 | | SETOPCMD_INTERSECT_ALL, |
408 | | SETOPCMD_EXCEPT, |
409 | | SETOPCMD_EXCEPT_ALL, |
410 | | } SetOpCmd; |
411 | | |
412 | | typedef enum SetOpStrategy |
413 | | { |
414 | | SETOP_SORTED, /* input must be sorted */ |
415 | | SETOP_HASHED, /* use internal hashtable */ |
416 | | } SetOpStrategy; |
417 | | |
418 | | /* |
419 | | * OnConflictAction - |
420 | | * "ON CONFLICT" clause type of query |
421 | | * |
422 | | * This is needed in both parsenodes.h and plannodes.h, so put it here... |
423 | | */ |
424 | | typedef enum OnConflictAction |
425 | | { |
426 | | ONCONFLICT_NONE, /* No "ON CONFLICT" clause */ |
427 | | ONCONFLICT_NOTHING, /* ON CONFLICT ... DO NOTHING */ |
428 | | ONCONFLICT_UPDATE, /* ON CONFLICT ... DO UPDATE */ |
429 | | ONCONFLICT_SELECT, /* ON CONFLICT ... DO SELECT */ |
430 | | } OnConflictAction; |
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 | | */ |
438 | | typedef enum LimitOption |
439 | | { |
440 | | LIMIT_OPTION_COUNT, /* FETCH FIRST... ONLY */ |
441 | | LIMIT_OPTION_WITH_TIES, /* FETCH FIRST... WITH TIES */ |
442 | | } LimitOption; |
443 | | |
444 | | #endif /* NODES_H */ |