my @no_read;
# node types we don't want read/write support for
my @no_read_write;
+# node types we don't want any support functions for, just node tags
+my @nodetag_only;
# types that are copied by straight assignment
my @scalar_types = qw(
# currently not required.
push @scalar_types, qw(QualCost);
-# Nodes from these input files don't need support functions, just node tags.
+# Nodes from these input files are automatically treated as nodetag_only.
+# In the future we might add explicit pg_node_attr labeling to some of these
+# files and remove them from this list, but for now this is the path of least
+# resistance.
my @nodetag_only_files = qw(
nodes/execnodes.h
access/amapi.h
# XXX various things we are not publishing right now to stay level
# with the manual system
-push @no_copy, qw(CallContext InlineCodeBlock);
-push @no_equal, qw(CallContext InlineCodeBlock);
push @no_read_write,
- qw(AccessPriv AlterTableCmd CallContext CreateOpClassItem FunctionParameter InferClause InlineCodeBlock ObjectWithArgs OnConflictClause PartitionCmd RoleSpec VacuumRelation);
+ qw(AccessPriv AlterTableCmd CreateOpClassItem FunctionParameter InferClause ObjectWithArgs OnConflictClause PartitionCmd RoleSpec VacuumRelation);
push @no_read, qw(A_ArrayExpr A_Indices A_Indirection AlterStatsStmt
CollateClause ColumnDef ColumnRef CreateForeignTableStmt CreateStatsStmt
CreateStmt FuncCall ImportForeignSchemaStmt IndexElem IndexStmt
{
push @no_read, $in_struct;
}
+ elsif ($attr eq 'nodetag_only')
+ {
+ push @nodetag_only, $in_struct;
+ }
elsif ($attr eq 'special_read_write')
{
# This attribute is called
$node_type_info{$in_struct}->{field_types} = \%ft;
$node_type_info{$in_struct}->{field_attrs} = \%fa;
- # Exclude nodes in nodetag_only_files from support.
- if (elem $infile, @nodetag_only_files)
- {
- push @no_copy, $in_struct;
- push @no_equal, $in_struct;
- push @no_read_write, $in_struct;
- }
+ # Propagate nodetag_only marking from files to nodes
+ push @nodetag_only, $in_struct
+ if (elem $infile, @nodetag_only_files);
# Propagate some node attributes from supertypes
if ($supertype)
foreach my $n (@node_types)
{
next if elem $n, @abstract_types;
+ next if elem $n, @nodetag_only;
my $struct_no_copy = (elem $n, @no_copy);
my $struct_no_equal = (elem $n, @no_equal);
next if $struct_no_copy && $struct_no_equal;
foreach my $n (@node_types)
{
next if elem $n, @abstract_types;
+ next if elem $n, @nodetag_only;
next if elem $n, @no_read_write;
# XXX For now, skip all "Stmt"s except that ones that were there before.
*
* - no_read: Does not support nodeRead() at all.
*
+ * - nodetag_only: Does not support copyObject(), equal(), outNode(),
+ * or nodeRead().
+ *
* - special_read_write: Has special treatment in outNode() and nodeRead().
*
* Node types can be supertypes of other types whether or not they are marked
* abstract: if a node struct appears as the first field of another struct
* type, then it is the supertype of that type. The no_copy, no_equal, and
* no_read node attributes are automatically inherited from the supertype.
+ * (Notice that nodetag_only does not inherit, so it's not quite equivalent
+ * to a combination of other attributes.)
*
* Valid node field attributes:
*