@@ -50,6 +50,8 @@ sub elem
50
50
my @no_read ;
51
51
# node types we don't want read/write support for
52
52
my @no_read_write ;
53
+ # node types we don't want any support functions for, just node tags
54
+ my @nodetag_only ;
53
55
54
56
# types that are copied by straight assignment
55
57
my @scalar_types = qw(
@@ -95,7 +97,10 @@ sub elem
95
97
# currently not required.
96
98
push @scalar_types , qw( QualCost) ;
97
99
98
- # Nodes from these input files don't need support functions, just node tags.
100
+ # Nodes from these input files are automatically treated as nodetag_only.
101
+ # In the future we might add explicit pg_node_attr labeling to some of these
102
+ # files and remove them from this list, but for now this is the path of least
103
+ # resistance.
99
104
my @nodetag_only_files = qw(
100
105
nodes/execnodes.h
101
106
access/amapi.h
@@ -113,10 +118,8 @@ sub elem
113
118
114
119
# XXX various things we are not publishing right now to stay level
115
120
# with the manual system
116
- push @no_copy , qw( CallContext InlineCodeBlock) ;
117
- push @no_equal , qw( CallContext InlineCodeBlock) ;
118
121
push @no_read_write ,
119
- qw( AccessPriv AlterTableCmd CallContext CreateOpClassItem FunctionParameter InferClause InlineCodeBlock ObjectWithArgs OnConflictClause PartitionCmd RoleSpec VacuumRelation) ;
122
+ qw( AccessPriv AlterTableCmd CreateOpClassItem FunctionParameter InferClause ObjectWithArgs OnConflictClause PartitionCmd RoleSpec VacuumRelation) ;
120
123
push @no_read , qw( A_ArrayExpr A_Indices A_Indirection AlterStatsStmt
121
124
CollateClause ColumnDef ColumnRef CreateForeignTableStmt CreateStatsStmt
122
125
CreateStmt FuncCall ImportForeignSchemaStmt IndexElem IndexStmt
@@ -254,6 +257,10 @@ sub elem
254
257
{
255
258
push @no_read , $in_struct ;
256
259
}
260
+ elsif ($attr eq ' nodetag_only' )
261
+ {
262
+ push @nodetag_only , $in_struct ;
263
+ }
257
264
elsif ($attr eq ' special_read_write' )
258
265
{
259
266
# This attribute is called
@@ -314,13 +321,9 @@ sub elem
314
321
$node_type_info {$in_struct }-> {field_types } = \%ft ;
315
322
$node_type_info {$in_struct }-> {field_attrs } = \%fa ;
316
323
317
- # Exclude nodes in nodetag_only_files from support.
318
- if (elem $infile , @nodetag_only_files )
319
- {
320
- push @no_copy , $in_struct ;
321
- push @no_equal , $in_struct ;
322
- push @no_read_write , $in_struct ;
323
- }
324
+ # Propagate nodetag_only marking from files to nodes
325
+ push @nodetag_only , $in_struct
326
+ if (elem $infile , @nodetag_only_files );
324
327
325
328
# Propagate some node attributes from supertypes
326
329
if ($supertype )
@@ -515,6 +518,7 @@ sub elem
515
518
foreach my $n (@node_types )
516
519
{
517
520
next if elem $n , @abstract_types ;
521
+ next if elem $n , @nodetag_only ;
518
522
my $struct_no_copy = (elem $n , @no_copy );
519
523
my $struct_no_equal = (elem $n , @no_equal );
520
524
next if $struct_no_copy && $struct_no_equal ;
@@ -706,6 +710,7 @@ sub elem
706
710
foreach my $n (@node_types )
707
711
{
708
712
next if elem $n , @abstract_types ;
713
+ next if elem $n , @nodetag_only ;
709
714
next if elem $n , @no_read_write ;
710
715
711
716
# XXX For now, skip all "Stmt"s except that ones that were there before.
0 commit comments