0001-readme-additions.patch
text/x-diff
Filename: 0001-readme-additions.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
Series: patch 0001
| File | + | − |
|---|---|---|
| src/backend/nodes/README | 21 | 1 |
diff --git a/src/backend/nodes/README b/src/backend/nodes/README index b3dc9afaf7..d8ae35ce58 100644 --- a/src/backend/nodes/README +++ b/src/backend/nodes/README @@ -6,10 +6,30 @@ Node Structures Introduction ------------ +Postgres uses "node" types to organize parse trees, plan trees, and +executor state trees. All objects that can appear in such trees must +be declared as node types. In addition, a few object types that aren't +part of parse/plan/execute node trees receive NodeTags anyway for +identification purposes, usually because they are involved in APIs +where we want to pass multiple object types through the same pointer. + The node structures are plain old C structures with the first field being of type NodeTag. "Inheritance" is achieved by convention: the first field can alternatively be of another node type. +Node types typically have support for being copied by copyObject(), +compared by equal(), serialized by outNode(), and deserialized by +nodeRead(). For some classes of Nodes, not all of these support +functions are required; for example, executor state nodes don't +presently need any of them. So far as the system is concerned, +output and read functions are only needed for node types that can +appear in parse trees stored in the catalogs. However, we provide +output functions for many other node types as well, because they +are very handy for debugging. + +Relevant Files +-------------- + Utility functions for manipulating node structures reside in this directory. Some support functions are automatically generated by the gen_node_support.pl script, other functions are maintained manually. @@ -40,7 +60,7 @@ FILES IN THIS DIRECTORY (src/backend/nodes/) FILES IN src/include/nodes/ - Node definitions: + Node definitions primarily appear in: nodes.h - define node tags (NodeTag) (*) primnodes.h - primitive nodes parsenodes.h - parse tree nodes