// This file is autogenerated by ./scripts/generate_protobuf_and_funcs.rb

static Alias * _readAlias(OUT_TYPE(Alias, Alias) msg);
static RangeVar * _readRangeVar(OUT_TYPE(RangeVar, RangeVar) msg);
static TableFunc * _readTableFunc(OUT_TYPE(TableFunc, TableFunc) msg);
static IntoClause * _readIntoClause(OUT_TYPE(IntoClause, IntoClause) msg);
static Var * _readVar(OUT_TYPE(Var, Var) msg);
static Param * _readParam(OUT_TYPE(Param, Param) msg);
static Aggref * _readAggref(OUT_TYPE(Aggref, Aggref) msg);
static GroupingFunc * _readGroupingFunc(OUT_TYPE(GroupingFunc, GroupingFunc) msg);
static WindowFunc * _readWindowFunc(OUT_TYPE(WindowFunc, WindowFunc) msg);
static WindowFuncRunCondition * _readWindowFuncRunCondition(OUT_TYPE(WindowFuncRunCondition, WindowFuncRunCondition) msg);
static MergeSupportFunc * _readMergeSupportFunc(OUT_TYPE(MergeSupportFunc, MergeSupportFunc) msg);
static SubscriptingRef * _readSubscriptingRef(OUT_TYPE(SubscriptingRef, SubscriptingRef) msg);
static FuncExpr * _readFuncExpr(OUT_TYPE(FuncExpr, FuncExpr) msg);
static NamedArgExpr * _readNamedArgExpr(OUT_TYPE(NamedArgExpr, NamedArgExpr) msg);
static OpExpr * _readOpExpr(OUT_TYPE(OpExpr, OpExpr) msg);
static DistinctExpr * _readDistinctExpr(OUT_TYPE(DistinctExpr, DistinctExpr) msg);
static NullIfExpr * _readNullIfExpr(OUT_TYPE(NullIfExpr, NullIfExpr) msg);
static ScalarArrayOpExpr * _readScalarArrayOpExpr(OUT_TYPE(ScalarArrayOpExpr, ScalarArrayOpExpr) msg);
static BoolExpr * _readBoolExpr(OUT_TYPE(BoolExpr, BoolExpr) msg);
static SubLink * _readSubLink(OUT_TYPE(SubLink, SubLink) msg);
static SubPlan * _readSubPlan(OUT_TYPE(SubPlan, SubPlan) msg);
static AlternativeSubPlan * _readAlternativeSubPlan(OUT_TYPE(AlternativeSubPlan, AlternativeSubPlan) msg);
static FieldSelect * _readFieldSelect(OUT_TYPE(FieldSelect, FieldSelect) msg);
static FieldStore * _readFieldStore(OUT_TYPE(FieldStore, FieldStore) msg);
static RelabelType * _readRelabelType(OUT_TYPE(RelabelType, RelabelType) msg);
static CoerceViaIO * _readCoerceViaIO(OUT_TYPE(CoerceViaIO, CoerceViaIO) msg);
static ArrayCoerceExpr * _readArrayCoerceExpr(OUT_TYPE(ArrayCoerceExpr, ArrayCoerceExpr) msg);
static ConvertRowtypeExpr * _readConvertRowtypeExpr(OUT_TYPE(ConvertRowtypeExpr, ConvertRowtypeExpr) msg);
static CollateExpr * _readCollateExpr(OUT_TYPE(CollateExpr, CollateExpr) msg);
static CaseExpr * _readCaseExpr(OUT_TYPE(CaseExpr, CaseExpr) msg);
static CaseWhen * _readCaseWhen(OUT_TYPE(CaseWhen, CaseWhen) msg);
static CaseTestExpr * _readCaseTestExpr(OUT_TYPE(CaseTestExpr, CaseTestExpr) msg);
static ArrayExpr * _readArrayExpr(OUT_TYPE(ArrayExpr, ArrayExpr) msg);
static RowExpr * _readRowExpr(OUT_TYPE(RowExpr, RowExpr) msg);
static RowCompareExpr * _readRowCompareExpr(OUT_TYPE(RowCompareExpr, RowCompareExpr) msg);
static CoalesceExpr * _readCoalesceExpr(OUT_TYPE(CoalesceExpr, CoalesceExpr) msg);
static MinMaxExpr * _readMinMaxExpr(OUT_TYPE(MinMaxExpr, MinMaxExpr) msg);
static SQLValueFunction * _readSQLValueFunction(OUT_TYPE(SQLValueFunction, SQLValueFunction) msg);
static XmlExpr * _readXmlExpr(OUT_TYPE(XmlExpr, XmlExpr) msg);
static JsonFormat * _readJsonFormat(OUT_TYPE(JsonFormat, JsonFormat) msg);
static JsonReturning * _readJsonReturning(OUT_TYPE(JsonReturning, JsonReturning) msg);
static JsonValueExpr * _readJsonValueExpr(OUT_TYPE(JsonValueExpr, JsonValueExpr) msg);
static JsonConstructorExpr * _readJsonConstructorExpr(OUT_TYPE(JsonConstructorExpr, JsonConstructorExpr) msg);
static JsonIsPredicate * _readJsonIsPredicate(OUT_TYPE(JsonIsPredicate, JsonIsPredicate) msg);
static JsonBehavior * _readJsonBehavior(OUT_TYPE(JsonBehavior, JsonBehavior) msg);
static JsonExpr * _readJsonExpr(OUT_TYPE(JsonExpr, JsonExpr) msg);
static JsonTablePath * _readJsonTablePath(OUT_TYPE(JsonTablePath, JsonTablePath) msg);
static JsonTablePathScan * _readJsonTablePathScan(OUT_TYPE(JsonTablePathScan, JsonTablePathScan) msg);
static JsonTableSiblingJoin * _readJsonTableSiblingJoin(OUT_TYPE(JsonTableSiblingJoin, JsonTableSiblingJoin) msg);
static NullTest * _readNullTest(OUT_TYPE(NullTest, NullTest) msg);
static BooleanTest * _readBooleanTest(OUT_TYPE(BooleanTest, BooleanTest) msg);
static MergeAction * _readMergeAction(OUT_TYPE(MergeAction, MergeAction) msg);
static CoerceToDomain * _readCoerceToDomain(OUT_TYPE(CoerceToDomain, CoerceToDomain) msg);
static CoerceToDomainValue * _readCoerceToDomainValue(OUT_TYPE(CoerceToDomainValue, CoerceToDomainValue) msg);
static SetToDefault * _readSetToDefault(OUT_TYPE(SetToDefault, SetToDefault) msg);
static CurrentOfExpr * _readCurrentOfExpr(OUT_TYPE(CurrentOfExpr, CurrentOfExpr) msg);
static NextValueExpr * _readNextValueExpr(OUT_TYPE(NextValueExpr, NextValueExpr) msg);
static InferenceElem * _readInferenceElem(OUT_TYPE(InferenceElem, InferenceElem) msg);
static TargetEntry * _readTargetEntry(OUT_TYPE(TargetEntry, TargetEntry) msg);
static RangeTblRef * _readRangeTblRef(OUT_TYPE(RangeTblRef, RangeTblRef) msg);
static JoinExpr * _readJoinExpr(OUT_TYPE(JoinExpr, JoinExpr) msg);
static FromExpr * _readFromExpr(OUT_TYPE(FromExpr, FromExpr) msg);
static OnConflictExpr * _readOnConflictExpr(OUT_TYPE(OnConflictExpr, OnConflictExpr) msg);
static Query * _readQuery(OUT_TYPE(Query, Query) msg);
static TypeName * _readTypeName(OUT_TYPE(TypeName, TypeName) msg);
static ColumnRef * _readColumnRef(OUT_TYPE(ColumnRef, ColumnRef) msg);
static ParamRef * _readParamRef(OUT_TYPE(ParamRef, ParamRef) msg);
static A_Expr * _readAExpr(OUT_TYPE(A_Expr, AExpr) msg);
static TypeCast * _readTypeCast(OUT_TYPE(TypeCast, TypeCast) msg);
static CollateClause * _readCollateClause(OUT_TYPE(CollateClause, CollateClause) msg);
static RoleSpec * _readRoleSpec(OUT_TYPE(RoleSpec, RoleSpec) msg);
static FuncCall * _readFuncCall(OUT_TYPE(FuncCall, FuncCall) msg);
static A_Star * _readAStar(OUT_TYPE(A_Star, AStar) msg);
static A_Indices * _readAIndices(OUT_TYPE(A_Indices, AIndices) msg);
static A_Indirection * _readAIndirection(OUT_TYPE(A_Indirection, AIndirection) msg);
static A_ArrayExpr * _readAArrayExpr(OUT_TYPE(A_ArrayExpr, AArrayExpr) msg);
static ResTarget * _readResTarget(OUT_TYPE(ResTarget, ResTarget) msg);
static MultiAssignRef * _readMultiAssignRef(OUT_TYPE(MultiAssignRef, MultiAssignRef) msg);
static SortBy * _readSortBy(OUT_TYPE(SortBy, SortBy) msg);
static WindowDef * _readWindowDef(OUT_TYPE(WindowDef, WindowDef) msg);
static RangeSubselect * _readRangeSubselect(OUT_TYPE(RangeSubselect, RangeSubselect) msg);
static RangeFunction * _readRangeFunction(OUT_TYPE(RangeFunction, RangeFunction) msg);
static RangeTableFunc * _readRangeTableFunc(OUT_TYPE(RangeTableFunc, RangeTableFunc) msg);
static RangeTableFuncCol * _readRangeTableFuncCol(OUT_TYPE(RangeTableFuncCol, RangeTableFuncCol) msg);
static RangeTableSample * _readRangeTableSample(OUT_TYPE(RangeTableSample, RangeTableSample) msg);
static ColumnDef * _readColumnDef(OUT_TYPE(ColumnDef, ColumnDef) msg);
static TableLikeClause * _readTableLikeClause(OUT_TYPE(TableLikeClause, TableLikeClause) msg);
static IndexElem * _readIndexElem(OUT_TYPE(IndexElem, IndexElem) msg);
static DefElem * _readDefElem(OUT_TYPE(DefElem, DefElem) msg);
static LockingClause * _readLockingClause(OUT_TYPE(LockingClause, LockingClause) msg);
static XmlSerialize * _readXmlSerialize(OUT_TYPE(XmlSerialize, XmlSerialize) msg);
static PartitionElem * _readPartitionElem(OUT_TYPE(PartitionElem, PartitionElem) msg);
static PartitionSpec * _readPartitionSpec(OUT_TYPE(PartitionSpec, PartitionSpec) msg);
static PartitionBoundSpec * _readPartitionBoundSpec(OUT_TYPE(PartitionBoundSpec, PartitionBoundSpec) msg);
static PartitionRangeDatum * _readPartitionRangeDatum(OUT_TYPE(PartitionRangeDatum, PartitionRangeDatum) msg);
static SinglePartitionSpec * _readSinglePartitionSpec(OUT_TYPE(SinglePartitionSpec, SinglePartitionSpec) msg);
static PartitionCmd * _readPartitionCmd(OUT_TYPE(PartitionCmd, PartitionCmd) msg);
static RangeTblEntry * _readRangeTblEntry(OUT_TYPE(RangeTblEntry, RangeTblEntry) msg);
static RTEPermissionInfo * _readRTEPermissionInfo(OUT_TYPE(RTEPermissionInfo, RTEPermissionInfo) msg);
static RangeTblFunction * _readRangeTblFunction(OUT_TYPE(RangeTblFunction, RangeTblFunction) msg);
static TableSampleClause * _readTableSampleClause(OUT_TYPE(TableSampleClause, TableSampleClause) msg);
static WithCheckOption * _readWithCheckOption(OUT_TYPE(WithCheckOption, WithCheckOption) msg);
static SortGroupClause * _readSortGroupClause(OUT_TYPE(SortGroupClause, SortGroupClause) msg);
static GroupingSet * _readGroupingSet(OUT_TYPE(GroupingSet, GroupingSet) msg);
static WindowClause * _readWindowClause(OUT_TYPE(WindowClause, WindowClause) msg);
static RowMarkClause * _readRowMarkClause(OUT_TYPE(RowMarkClause, RowMarkClause) msg);
static WithClause * _readWithClause(OUT_TYPE(WithClause, WithClause) msg);
static InferClause * _readInferClause(OUT_TYPE(InferClause, InferClause) msg);
static OnConflictClause * _readOnConflictClause(OUT_TYPE(OnConflictClause, OnConflictClause) msg);
static CTESearchClause * _readCTESearchClause(OUT_TYPE(CTESearchClause, CTESearchClause) msg);
static CTECycleClause * _readCTECycleClause(OUT_TYPE(CTECycleClause, CTECycleClause) msg);
static CommonTableExpr * _readCommonTableExpr(OUT_TYPE(CommonTableExpr, CommonTableExpr) msg);
static MergeWhenClause * _readMergeWhenClause(OUT_TYPE(MergeWhenClause, MergeWhenClause) msg);
static TriggerTransition * _readTriggerTransition(OUT_TYPE(TriggerTransition, TriggerTransition) msg);
static JsonOutput * _readJsonOutput(OUT_TYPE(JsonOutput, JsonOutput) msg);
static JsonArgument * _readJsonArgument(OUT_TYPE(JsonArgument, JsonArgument) msg);
static JsonFuncExpr * _readJsonFuncExpr(OUT_TYPE(JsonFuncExpr, JsonFuncExpr) msg);
static JsonTablePathSpec * _readJsonTablePathSpec(OUT_TYPE(JsonTablePathSpec, JsonTablePathSpec) msg);
static JsonTable * _readJsonTable(OUT_TYPE(JsonTable, JsonTable) msg);
static JsonTableColumn * _readJsonTableColumn(OUT_TYPE(JsonTableColumn, JsonTableColumn) msg);
static JsonKeyValue * _readJsonKeyValue(OUT_TYPE(JsonKeyValue, JsonKeyValue) msg);
static JsonParseExpr * _readJsonParseExpr(OUT_TYPE(JsonParseExpr, JsonParseExpr) msg);
static JsonScalarExpr * _readJsonScalarExpr(OUT_TYPE(JsonScalarExpr, JsonScalarExpr) msg);
static JsonSerializeExpr * _readJsonSerializeExpr(OUT_TYPE(JsonSerializeExpr, JsonSerializeExpr) msg);
static JsonObjectConstructor * _readJsonObjectConstructor(OUT_TYPE(JsonObjectConstructor, JsonObjectConstructor) msg);
static JsonArrayConstructor * _readJsonArrayConstructor(OUT_TYPE(JsonArrayConstructor, JsonArrayConstructor) msg);
static JsonArrayQueryConstructor * _readJsonArrayQueryConstructor(OUT_TYPE(JsonArrayQueryConstructor, JsonArrayQueryConstructor) msg);
static JsonAggConstructor * _readJsonAggConstructor(OUT_TYPE(JsonAggConstructor, JsonAggConstructor) msg);
static JsonObjectAgg * _readJsonObjectAgg(OUT_TYPE(JsonObjectAgg, JsonObjectAgg) msg);
static JsonArrayAgg * _readJsonArrayAgg(OUT_TYPE(JsonArrayAgg, JsonArrayAgg) msg);
static RawStmt * _readRawStmt(OUT_TYPE(RawStmt, RawStmt) msg);
static InsertStmt * _readInsertStmt(OUT_TYPE(InsertStmt, InsertStmt) msg);
static DeleteStmt * _readDeleteStmt(OUT_TYPE(DeleteStmt, DeleteStmt) msg);
static UpdateStmt * _readUpdateStmt(OUT_TYPE(UpdateStmt, UpdateStmt) msg);
static MergeStmt * _readMergeStmt(OUT_TYPE(MergeStmt, MergeStmt) msg);
static SelectStmt * _readSelectStmt(OUT_TYPE(SelectStmt, SelectStmt) msg);
static SetOperationStmt * _readSetOperationStmt(OUT_TYPE(SetOperationStmt, SetOperationStmt) msg);
static ReturnStmt * _readReturnStmt(OUT_TYPE(ReturnStmt, ReturnStmt) msg);
static PLAssignStmt * _readPLAssignStmt(OUT_TYPE(PLAssignStmt, PLAssignStmt) msg);
static CreateSchemaStmt * _readCreateSchemaStmt(OUT_TYPE(CreateSchemaStmt, CreateSchemaStmt) msg);
static AlterTableStmt * _readAlterTableStmt(OUT_TYPE(AlterTableStmt, AlterTableStmt) msg);
static ReplicaIdentityStmt * _readReplicaIdentityStmt(OUT_TYPE(ReplicaIdentityStmt, ReplicaIdentityStmt) msg);
static AlterTableCmd * _readAlterTableCmd(OUT_TYPE(AlterTableCmd, AlterTableCmd) msg);
static AlterCollationStmt * _readAlterCollationStmt(OUT_TYPE(AlterCollationStmt, AlterCollationStmt) msg);
static AlterDomainStmt * _readAlterDomainStmt(OUT_TYPE(AlterDomainStmt, AlterDomainStmt) msg);
static GrantStmt * _readGrantStmt(OUT_TYPE(GrantStmt, GrantStmt) msg);
static ObjectWithArgs * _readObjectWithArgs(OUT_TYPE(ObjectWithArgs, ObjectWithArgs) msg);
static AccessPriv * _readAccessPriv(OUT_TYPE(AccessPriv, AccessPriv) msg);
static GrantRoleStmt * _readGrantRoleStmt(OUT_TYPE(GrantRoleStmt, GrantRoleStmt) msg);
static AlterDefaultPrivilegesStmt * _readAlterDefaultPrivilegesStmt(OUT_TYPE(AlterDefaultPrivilegesStmt, AlterDefaultPrivilegesStmt) msg);
static CopyStmt * _readCopyStmt(OUT_TYPE(CopyStmt, CopyStmt) msg);
static VariableSetStmt * _readVariableSetStmt(OUT_TYPE(VariableSetStmt, VariableSetStmt) msg);
static VariableShowStmt * _readVariableShowStmt(OUT_TYPE(VariableShowStmt, VariableShowStmt) msg);
static CreateStmt * _readCreateStmt(OUT_TYPE(CreateStmt, CreateStmt) msg);
static Constraint * _readConstraint(OUT_TYPE(Constraint, Constraint) msg);
static CreateTableSpaceStmt * _readCreateTableSpaceStmt(OUT_TYPE(CreateTableSpaceStmt, CreateTableSpaceStmt) msg);
static DropTableSpaceStmt * _readDropTableSpaceStmt(OUT_TYPE(DropTableSpaceStmt, DropTableSpaceStmt) msg);
static AlterTableSpaceOptionsStmt * _readAlterTableSpaceOptionsStmt(OUT_TYPE(AlterTableSpaceOptionsStmt, AlterTableSpaceOptionsStmt) msg);
static AlterTableMoveAllStmt * _readAlterTableMoveAllStmt(OUT_TYPE(AlterTableMoveAllStmt, AlterTableMoveAllStmt) msg);
static CreateExtensionStmt * _readCreateExtensionStmt(OUT_TYPE(CreateExtensionStmt, CreateExtensionStmt) msg);
static AlterExtensionStmt * _readAlterExtensionStmt(OUT_TYPE(AlterExtensionStmt, AlterExtensionStmt) msg);
static AlterExtensionContentsStmt * _readAlterExtensionContentsStmt(OUT_TYPE(AlterExtensionContentsStmt, AlterExtensionContentsStmt) msg);
static CreateFdwStmt * _readCreateFdwStmt(OUT_TYPE(CreateFdwStmt, CreateFdwStmt) msg);
static AlterFdwStmt * _readAlterFdwStmt(OUT_TYPE(AlterFdwStmt, AlterFdwStmt) msg);
static CreateForeignServerStmt * _readCreateForeignServerStmt(OUT_TYPE(CreateForeignServerStmt, CreateForeignServerStmt) msg);
static AlterForeignServerStmt * _readAlterForeignServerStmt(OUT_TYPE(AlterForeignServerStmt, AlterForeignServerStmt) msg);
static CreateForeignTableStmt * _readCreateForeignTableStmt(OUT_TYPE(CreateForeignTableStmt, CreateForeignTableStmt) msg);
static CreateUserMappingStmt * _readCreateUserMappingStmt(OUT_TYPE(CreateUserMappingStmt, CreateUserMappingStmt) msg);
static AlterUserMappingStmt * _readAlterUserMappingStmt(OUT_TYPE(AlterUserMappingStmt, AlterUserMappingStmt) msg);
static DropUserMappingStmt * _readDropUserMappingStmt(OUT_TYPE(DropUserMappingStmt, DropUserMappingStmt) msg);
static ImportForeignSchemaStmt * _readImportForeignSchemaStmt(OUT_TYPE(ImportForeignSchemaStmt, ImportForeignSchemaStmt) msg);
static CreatePolicyStmt * _readCreatePolicyStmt(OUT_TYPE(CreatePolicyStmt, CreatePolicyStmt) msg);
static AlterPolicyStmt * _readAlterPolicyStmt(OUT_TYPE(AlterPolicyStmt, AlterPolicyStmt) msg);
static CreateAmStmt * _readCreateAmStmt(OUT_TYPE(CreateAmStmt, CreateAmStmt) msg);
static CreateTrigStmt * _readCreateTrigStmt(OUT_TYPE(CreateTrigStmt, CreateTrigStmt) msg);
static CreateEventTrigStmt * _readCreateEventTrigStmt(OUT_TYPE(CreateEventTrigStmt, CreateEventTrigStmt) msg);
static AlterEventTrigStmt * _readAlterEventTrigStmt(OUT_TYPE(AlterEventTrigStmt, AlterEventTrigStmt) msg);
static CreatePLangStmt * _readCreatePLangStmt(OUT_TYPE(CreatePLangStmt, CreatePLangStmt) msg);
static CreateRoleStmt * _readCreateRoleStmt(OUT_TYPE(CreateRoleStmt, CreateRoleStmt) msg);
static AlterRoleStmt * _readAlterRoleStmt(OUT_TYPE(AlterRoleStmt, AlterRoleStmt) msg);
static AlterRoleSetStmt * _readAlterRoleSetStmt(OUT_TYPE(AlterRoleSetStmt, AlterRoleSetStmt) msg);
static DropRoleStmt * _readDropRoleStmt(OUT_TYPE(DropRoleStmt, DropRoleStmt) msg);
static CreateSeqStmt * _readCreateSeqStmt(OUT_TYPE(CreateSeqStmt, CreateSeqStmt) msg);
static AlterSeqStmt * _readAlterSeqStmt(OUT_TYPE(AlterSeqStmt, AlterSeqStmt) msg);
static DefineStmt * _readDefineStmt(OUT_TYPE(DefineStmt, DefineStmt) msg);
static CreateDomainStmt * _readCreateDomainStmt(OUT_TYPE(CreateDomainStmt, CreateDomainStmt) msg);
static CreateOpClassStmt * _readCreateOpClassStmt(OUT_TYPE(CreateOpClassStmt, CreateOpClassStmt) msg);
static CreateOpClassItem * _readCreateOpClassItem(OUT_TYPE(CreateOpClassItem, CreateOpClassItem) msg);
static CreateOpFamilyStmt * _readCreateOpFamilyStmt(OUT_TYPE(CreateOpFamilyStmt, CreateOpFamilyStmt) msg);
static AlterOpFamilyStmt * _readAlterOpFamilyStmt(OUT_TYPE(AlterOpFamilyStmt, AlterOpFamilyStmt) msg);
static DropStmt * _readDropStmt(OUT_TYPE(DropStmt, DropStmt) msg);
static TruncateStmt * _readTruncateStmt(OUT_TYPE(TruncateStmt, TruncateStmt) msg);
static CommentStmt * _readCommentStmt(OUT_TYPE(CommentStmt, CommentStmt) msg);
static SecLabelStmt * _readSecLabelStmt(OUT_TYPE(SecLabelStmt, SecLabelStmt) msg);
static DeclareCursorStmt * _readDeclareCursorStmt(OUT_TYPE(DeclareCursorStmt, DeclareCursorStmt) msg);
static ClosePortalStmt * _readClosePortalStmt(OUT_TYPE(ClosePortalStmt, ClosePortalStmt) msg);
static FetchStmt * _readFetchStmt(OUT_TYPE(FetchStmt, FetchStmt) msg);
static IndexStmt * _readIndexStmt(OUT_TYPE(IndexStmt, IndexStmt) msg);
static CreateStatsStmt * _readCreateStatsStmt(OUT_TYPE(CreateStatsStmt, CreateStatsStmt) msg);
static StatsElem * _readStatsElem(OUT_TYPE(StatsElem, StatsElem) msg);
static AlterStatsStmt * _readAlterStatsStmt(OUT_TYPE(AlterStatsStmt, AlterStatsStmt) msg);
static CreateFunctionStmt * _readCreateFunctionStmt(OUT_TYPE(CreateFunctionStmt, CreateFunctionStmt) msg);
static FunctionParameter * _readFunctionParameter(OUT_TYPE(FunctionParameter, FunctionParameter) msg);
static AlterFunctionStmt * _readAlterFunctionStmt(OUT_TYPE(AlterFunctionStmt, AlterFunctionStmt) msg);
static DoStmt * _readDoStmt(OUT_TYPE(DoStmt, DoStmt) msg);
static InlineCodeBlock * _readInlineCodeBlock(OUT_TYPE(InlineCodeBlock, InlineCodeBlock) msg);
static CallStmt * _readCallStmt(OUT_TYPE(CallStmt, CallStmt) msg);
static CallContext * _readCallContext(OUT_TYPE(CallContext, CallContext) msg);
static RenameStmt * _readRenameStmt(OUT_TYPE(RenameStmt, RenameStmt) msg);
static AlterObjectDependsStmt * _readAlterObjectDependsStmt(OUT_TYPE(AlterObjectDependsStmt, AlterObjectDependsStmt) msg);
static AlterObjectSchemaStmt * _readAlterObjectSchemaStmt(OUT_TYPE(AlterObjectSchemaStmt, AlterObjectSchemaStmt) msg);
static AlterOwnerStmt * _readAlterOwnerStmt(OUT_TYPE(AlterOwnerStmt, AlterOwnerStmt) msg);
static AlterOperatorStmt * _readAlterOperatorStmt(OUT_TYPE(AlterOperatorStmt, AlterOperatorStmt) msg);
static AlterTypeStmt * _readAlterTypeStmt(OUT_TYPE(AlterTypeStmt, AlterTypeStmt) msg);
static RuleStmt * _readRuleStmt(OUT_TYPE(RuleStmt, RuleStmt) msg);
static NotifyStmt * _readNotifyStmt(OUT_TYPE(NotifyStmt, NotifyStmt) msg);
static ListenStmt * _readListenStmt(OUT_TYPE(ListenStmt, ListenStmt) msg);
static UnlistenStmt * _readUnlistenStmt(OUT_TYPE(UnlistenStmt, UnlistenStmt) msg);
static TransactionStmt * _readTransactionStmt(OUT_TYPE(TransactionStmt, TransactionStmt) msg);
static CompositeTypeStmt * _readCompositeTypeStmt(OUT_TYPE(CompositeTypeStmt, CompositeTypeStmt) msg);
static CreateEnumStmt * _readCreateEnumStmt(OUT_TYPE(CreateEnumStmt, CreateEnumStmt) msg);
static CreateRangeStmt * _readCreateRangeStmt(OUT_TYPE(CreateRangeStmt, CreateRangeStmt) msg);
static AlterEnumStmt * _readAlterEnumStmt(OUT_TYPE(AlterEnumStmt, AlterEnumStmt) msg);
static ViewStmt * _readViewStmt(OUT_TYPE(ViewStmt, ViewStmt) msg);
static LoadStmt * _readLoadStmt(OUT_TYPE(LoadStmt, LoadStmt) msg);
static CreatedbStmt * _readCreatedbStmt(OUT_TYPE(CreatedbStmt, CreatedbStmt) msg);
static AlterDatabaseStmt * _readAlterDatabaseStmt(OUT_TYPE(AlterDatabaseStmt, AlterDatabaseStmt) msg);
static AlterDatabaseRefreshCollStmt * _readAlterDatabaseRefreshCollStmt(OUT_TYPE(AlterDatabaseRefreshCollStmt, AlterDatabaseRefreshCollStmt) msg);
static AlterDatabaseSetStmt * _readAlterDatabaseSetStmt(OUT_TYPE(AlterDatabaseSetStmt, AlterDatabaseSetStmt) msg);
static DropdbStmt * _readDropdbStmt(OUT_TYPE(DropdbStmt, DropdbStmt) msg);
static AlterSystemStmt * _readAlterSystemStmt(OUT_TYPE(AlterSystemStmt, AlterSystemStmt) msg);
static ClusterStmt * _readClusterStmt(OUT_TYPE(ClusterStmt, ClusterStmt) msg);
static VacuumStmt * _readVacuumStmt(OUT_TYPE(VacuumStmt, VacuumStmt) msg);
static VacuumRelation * _readVacuumRelation(OUT_TYPE(VacuumRelation, VacuumRelation) msg);
static ExplainStmt * _readExplainStmt(OUT_TYPE(ExplainStmt, ExplainStmt) msg);
static CreateTableAsStmt * _readCreateTableAsStmt(OUT_TYPE(CreateTableAsStmt, CreateTableAsStmt) msg);
static RefreshMatViewStmt * _readRefreshMatViewStmt(OUT_TYPE(RefreshMatViewStmt, RefreshMatViewStmt) msg);
static CheckPointStmt * _readCheckPointStmt(OUT_TYPE(CheckPointStmt, CheckPointStmt) msg);
static DiscardStmt * _readDiscardStmt(OUT_TYPE(DiscardStmt, DiscardStmt) msg);
static LockStmt * _readLockStmt(OUT_TYPE(LockStmt, LockStmt) msg);
static ConstraintsSetStmt * _readConstraintsSetStmt(OUT_TYPE(ConstraintsSetStmt, ConstraintsSetStmt) msg);
static ReindexStmt * _readReindexStmt(OUT_TYPE(ReindexStmt, ReindexStmt) msg);
static CreateConversionStmt * _readCreateConversionStmt(OUT_TYPE(CreateConversionStmt, CreateConversionStmt) msg);
static CreateCastStmt * _readCreateCastStmt(OUT_TYPE(CreateCastStmt, CreateCastStmt) msg);
static CreateTransformStmt * _readCreateTransformStmt(OUT_TYPE(CreateTransformStmt, CreateTransformStmt) msg);
static PrepareStmt * _readPrepareStmt(OUT_TYPE(PrepareStmt, PrepareStmt) msg);
static ExecuteStmt * _readExecuteStmt(OUT_TYPE(ExecuteStmt, ExecuteStmt) msg);
static DeallocateStmt * _readDeallocateStmt(OUT_TYPE(DeallocateStmt, DeallocateStmt) msg);
static DropOwnedStmt * _readDropOwnedStmt(OUT_TYPE(DropOwnedStmt, DropOwnedStmt) msg);
static ReassignOwnedStmt * _readReassignOwnedStmt(OUT_TYPE(ReassignOwnedStmt, ReassignOwnedStmt) msg);
static AlterTSDictionaryStmt * _readAlterTSDictionaryStmt(OUT_TYPE(AlterTSDictionaryStmt, AlterTSDictionaryStmt) msg);
static AlterTSConfigurationStmt * _readAlterTSConfigurationStmt(OUT_TYPE(AlterTSConfigurationStmt, AlterTSConfigurationStmt) msg);
static PublicationTable * _readPublicationTable(OUT_TYPE(PublicationTable, PublicationTable) msg);
static PublicationObjSpec * _readPublicationObjSpec(OUT_TYPE(PublicationObjSpec, PublicationObjSpec) msg);
static CreatePublicationStmt * _readCreatePublicationStmt(OUT_TYPE(CreatePublicationStmt, CreatePublicationStmt) msg);
static AlterPublicationStmt * _readAlterPublicationStmt(OUT_TYPE(AlterPublicationStmt, AlterPublicationStmt) msg);
static CreateSubscriptionStmt * _readCreateSubscriptionStmt(OUT_TYPE(CreateSubscriptionStmt, CreateSubscriptionStmt) msg);
static AlterSubscriptionStmt * _readAlterSubscriptionStmt(OUT_TYPE(AlterSubscriptionStmt, AlterSubscriptionStmt) msg);
static DropSubscriptionStmt * _readDropSubscriptionStmt(OUT_TYPE(DropSubscriptionStmt, DropSubscriptionStmt) msg);


static Alias *
_readAlias(OUT_TYPE(Alias, Alias) msg)
{
  Alias *node = makeNode(Alias);
  READ_STRING_FIELD(aliasname, aliasname, aliasname);
  READ_LIST_FIELD(colnames, colnames, colnames);
  return node;
}

static RangeVar *
_readRangeVar(OUT_TYPE(RangeVar, RangeVar) msg)
{
  RangeVar *node = makeNode(RangeVar);
  READ_STRING_FIELD(catalogname, catalogname, catalogname);
  READ_STRING_FIELD(schemaname, schemaname, schemaname);
  READ_STRING_FIELD(relname, relname, relname);
  READ_BOOL_FIELD(inh, inh, inh);
  READ_CHAR_FIELD(relpersistence, relpersistence, relpersistence);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, alias, alias, alias);
  READ_INT_FIELD(location, location, location);
  return node;
}

static TableFunc *
_readTableFunc(OUT_TYPE(TableFunc, TableFunc) msg)
{
  TableFunc *node = makeNode(TableFunc);
  READ_ENUM_FIELD(TableFuncType, functype, functype, functype);
  READ_LIST_FIELD(ns_uris, ns_uris, ns_uris);
  READ_LIST_FIELD(ns_names, ns_names, ns_names);
  READ_NODE_PTR_FIELD(docexpr, docexpr, docexpr);
  READ_NODE_PTR_FIELD(rowexpr, rowexpr, rowexpr);
  READ_LIST_FIELD(colnames, colnames, colnames);
  READ_LIST_FIELD(coltypes, coltypes, coltypes);
  READ_LIST_FIELD(coltypmods, coltypmods, coltypmods);
  READ_LIST_FIELD(colcollations, colcollations, colcollations);
  READ_LIST_FIELD(colexprs, colexprs, colexprs);
  READ_LIST_FIELD(coldefexprs, coldefexprs, coldefexprs);
  READ_LIST_FIELD(colvalexprs, colvalexprs, colvalexprs);
  READ_LIST_FIELD(passingvalexprs, passingvalexprs, passingvalexprs);
  READ_BITMAPSET_FIELD(notnulls, notnulls, notnulls);
  READ_NODE_PTR_FIELD(plan, plan, plan);
  READ_INT_FIELD(ordinalitycol, ordinalitycol, ordinalitycol);
  READ_INT_FIELD(location, location, location);
  return node;
}

static IntoClause *
_readIntoClause(OUT_TYPE(IntoClause, IntoClause) msg)
{
  IntoClause *node = makeNode(IntoClause);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, rel, rel, rel);
  READ_LIST_FIELD(col_names, colNames, colNames);
  READ_STRING_FIELD(access_method, accessMethod, accessMethod);
  READ_LIST_FIELD(options, options, options);
  READ_ENUM_FIELD(OnCommitAction, on_commit, onCommit, onCommit);
  READ_STRING_FIELD(table_space_name, tableSpaceName, tableSpaceName);
  READ_NODE_PTR_FIELD(view_query, viewQuery, viewQuery);
  READ_BOOL_FIELD(skip_data, skipData, skipData);
  return node;
}

static Var *
_readVar(OUT_TYPE(Var, Var) msg)
{
  Var *node = makeNode(Var);
  READ_INT_FIELD(varno, varno, varno);
  READ_INT_FIELD(varattno, varattno, varattno);
  READ_UINT_FIELD(vartype, vartype, vartype);
  READ_INT_FIELD(vartypmod, vartypmod, vartypmod);
  READ_UINT_FIELD(varcollid, varcollid, varcollid);
  READ_BITMAPSET_FIELD(varnullingrels, varnullingrels, varnullingrels);
  READ_UINT_FIELD(varlevelsup, varlevelsup, varlevelsup);
  READ_INT_FIELD(location, location, location);
  return node;
}

static Param *
_readParam(OUT_TYPE(Param, Param) msg)
{
  Param *node = makeNode(Param);
  READ_ENUM_FIELD(ParamKind, paramkind, paramkind, paramkind);
  READ_INT_FIELD(paramid, paramid, paramid);
  READ_UINT_FIELD(paramtype, paramtype, paramtype);
  READ_INT_FIELD(paramtypmod, paramtypmod, paramtypmod);
  READ_UINT_FIELD(paramcollid, paramcollid, paramcollid);
  READ_INT_FIELD(location, location, location);
  return node;
}

static Aggref *
_readAggref(OUT_TYPE(Aggref, Aggref) msg)
{
  Aggref *node = makeNode(Aggref);
  READ_UINT_FIELD(aggfnoid, aggfnoid, aggfnoid);
  READ_UINT_FIELD(aggtype, aggtype, aggtype);
  READ_UINT_FIELD(aggcollid, aggcollid, aggcollid);
  READ_UINT_FIELD(inputcollid, inputcollid, inputcollid);
  READ_LIST_FIELD(aggargtypes, aggargtypes, aggargtypes);
  READ_LIST_FIELD(aggdirectargs, aggdirectargs, aggdirectargs);
  READ_LIST_FIELD(args, args, args);
  READ_LIST_FIELD(aggorder, aggorder, aggorder);
  READ_LIST_FIELD(aggdistinct, aggdistinct, aggdistinct);
  READ_ABSTRACT_PTR_FIELD(aggfilter, aggfilter, aggfilter, Expr*);
  READ_BOOL_FIELD(aggstar, aggstar, aggstar);
  READ_BOOL_FIELD(aggvariadic, aggvariadic, aggvariadic);
  READ_CHAR_FIELD(aggkind, aggkind, aggkind);
  READ_UINT_FIELD(agglevelsup, agglevelsup, agglevelsup);
  READ_ENUM_FIELD(AggSplit, aggsplit, aggsplit, aggsplit);
  READ_INT_FIELD(aggno, aggno, aggno);
  READ_INT_FIELD(aggtransno, aggtransno, aggtransno);
  READ_INT_FIELD(location, location, location);
  return node;
}

static GroupingFunc *
_readGroupingFunc(OUT_TYPE(GroupingFunc, GroupingFunc) msg)
{
  GroupingFunc *node = makeNode(GroupingFunc);
  READ_LIST_FIELD(args, args, args);
  READ_LIST_FIELD(refs, refs, refs);
  READ_UINT_FIELD(agglevelsup, agglevelsup, agglevelsup);
  READ_INT_FIELD(location, location, location);
  return node;
}

static WindowFunc *
_readWindowFunc(OUT_TYPE(WindowFunc, WindowFunc) msg)
{
  WindowFunc *node = makeNode(WindowFunc);
  READ_UINT_FIELD(winfnoid, winfnoid, winfnoid);
  READ_UINT_FIELD(wintype, wintype, wintype);
  READ_UINT_FIELD(wincollid, wincollid, wincollid);
  READ_UINT_FIELD(inputcollid, inputcollid, inputcollid);
  READ_LIST_FIELD(args, args, args);
  READ_ABSTRACT_PTR_FIELD(aggfilter, aggfilter, aggfilter, Expr*);
  READ_LIST_FIELD(run_condition, runCondition, runCondition);
  READ_UINT_FIELD(winref, winref, winref);
  READ_BOOL_FIELD(winstar, winstar, winstar);
  READ_BOOL_FIELD(winagg, winagg, winagg);
  READ_INT_FIELD(location, location, location);
  return node;
}

static WindowFuncRunCondition *
_readWindowFuncRunCondition(OUT_TYPE(WindowFuncRunCondition, WindowFuncRunCondition) msg)
{
  WindowFuncRunCondition *node = makeNode(WindowFuncRunCondition);
  READ_UINT_FIELD(opno, opno, opno);
  READ_UINT_FIELD(inputcollid, inputcollid, inputcollid);
  READ_BOOL_FIELD(wfunc_left, wfunc_left, wfunc_left);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  return node;
}

static MergeSupportFunc *
_readMergeSupportFunc(OUT_TYPE(MergeSupportFunc, MergeSupportFunc) msg)
{
  MergeSupportFunc *node = makeNode(MergeSupportFunc);
  READ_UINT_FIELD(msftype, msftype, msftype);
  READ_UINT_FIELD(msfcollid, msfcollid, msfcollid);
  READ_INT_FIELD(location, location, location);
  return node;
}

static SubscriptingRef *
_readSubscriptingRef(OUT_TYPE(SubscriptingRef, SubscriptingRef) msg)
{
  SubscriptingRef *node = makeNode(SubscriptingRef);
  READ_UINT_FIELD(refcontainertype, refcontainertype, refcontainertype);
  READ_UINT_FIELD(refelemtype, refelemtype, refelemtype);
  READ_UINT_FIELD(refrestype, refrestype, refrestype);
  READ_INT_FIELD(reftypmod, reftypmod, reftypmod);
  READ_UINT_FIELD(refcollid, refcollid, refcollid);
  READ_LIST_FIELD(refupperindexpr, refupperindexpr, refupperindexpr);
  READ_LIST_FIELD(reflowerindexpr, reflowerindexpr, reflowerindexpr);
  READ_ABSTRACT_PTR_FIELD(refexpr, refexpr, refexpr, Expr*);
  READ_ABSTRACT_PTR_FIELD(refassgnexpr, refassgnexpr, refassgnexpr, Expr*);
  return node;
}

static FuncExpr *
_readFuncExpr(OUT_TYPE(FuncExpr, FuncExpr) msg)
{
  FuncExpr *node = makeNode(FuncExpr);
  READ_UINT_FIELD(funcid, funcid, funcid);
  READ_UINT_FIELD(funcresulttype, funcresulttype, funcresulttype);
  READ_BOOL_FIELD(funcretset, funcretset, funcretset);
  READ_BOOL_FIELD(funcvariadic, funcvariadic, funcvariadic);
  READ_ENUM_FIELD(CoercionForm, funcformat, funcformat, funcformat);
  READ_UINT_FIELD(funccollid, funccollid, funccollid);
  READ_UINT_FIELD(inputcollid, inputcollid, inputcollid);
  READ_LIST_FIELD(args, args, args);
  READ_INT_FIELD(location, location, location);
  return node;
}

static NamedArgExpr *
_readNamedArgExpr(OUT_TYPE(NamedArgExpr, NamedArgExpr) msg)
{
  NamedArgExpr *node = makeNode(NamedArgExpr);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_STRING_FIELD(name, name, name);
  READ_INT_FIELD(argnumber, argnumber, argnumber);
  READ_INT_FIELD(location, location, location);
  return node;
}

static OpExpr *
_readOpExpr(OUT_TYPE(OpExpr, OpExpr) msg)
{
  OpExpr *node = makeNode(OpExpr);
  READ_UINT_FIELD(opno, opno, opno);
  READ_UINT_FIELD(opresulttype, opresulttype, opresulttype);
  READ_BOOL_FIELD(opretset, opretset, opretset);
  READ_UINT_FIELD(opcollid, opcollid, opcollid);
  READ_UINT_FIELD(inputcollid, inputcollid, inputcollid);
  READ_LIST_FIELD(args, args, args);
  READ_INT_FIELD(location, location, location);
  return node;
}

static DistinctExpr *
_readDistinctExpr(OUT_TYPE(DistinctExpr, DistinctExpr) msg)
{
  DistinctExpr *node = makeNode(DistinctExpr);
  READ_UINT_FIELD(opno, opno, opno);
  READ_UINT_FIELD(opresulttype, opresulttype, opresulttype);
  READ_BOOL_FIELD(opretset, opretset, opretset);
  READ_UINT_FIELD(opcollid, opcollid, opcollid);
  READ_UINT_FIELD(inputcollid, inputcollid, inputcollid);
  READ_LIST_FIELD(args, args, args);
  READ_INT_FIELD(location, location, location);
  return node;
}

static NullIfExpr *
_readNullIfExpr(OUT_TYPE(NullIfExpr, NullIfExpr) msg)
{
  NullIfExpr *node = makeNode(NullIfExpr);
  READ_UINT_FIELD(opno, opno, opno);
  READ_UINT_FIELD(opresulttype, opresulttype, opresulttype);
  READ_BOOL_FIELD(opretset, opretset, opretset);
  READ_UINT_FIELD(opcollid, opcollid, opcollid);
  READ_UINT_FIELD(inputcollid, inputcollid, inputcollid);
  READ_LIST_FIELD(args, args, args);
  READ_INT_FIELD(location, location, location);
  return node;
}

static ScalarArrayOpExpr *
_readScalarArrayOpExpr(OUT_TYPE(ScalarArrayOpExpr, ScalarArrayOpExpr) msg)
{
  ScalarArrayOpExpr *node = makeNode(ScalarArrayOpExpr);
  READ_UINT_FIELD(opno, opno, opno);
  READ_BOOL_FIELD(use_or, useOr, useOr);
  READ_UINT_FIELD(inputcollid, inputcollid, inputcollid);
  READ_LIST_FIELD(args, args, args);
  READ_INT_FIELD(location, location, location);
  return node;
}

static BoolExpr *
_readBoolExpr(OUT_TYPE(BoolExpr, BoolExpr) msg)
{
  BoolExpr *node = makeNode(BoolExpr);
  READ_ENUM_FIELD(BoolExprType, boolop, boolop, boolop);
  READ_LIST_FIELD(args, args, args);
  READ_INT_FIELD(location, location, location);
  return node;
}

static SubLink *
_readSubLink(OUT_TYPE(SubLink, SubLink) msg)
{
  SubLink *node = makeNode(SubLink);
  READ_ENUM_FIELD(SubLinkType, sub_link_type, subLinkType, subLinkType);
  READ_INT_FIELD(sub_link_id, subLinkId, subLinkId);
  READ_NODE_PTR_FIELD(testexpr, testexpr, testexpr);
  READ_LIST_FIELD(oper_name, operName, operName);
  READ_NODE_PTR_FIELD(subselect, subselect, subselect);
  READ_INT_FIELD(location, location, location);
  return node;
}

static SubPlan *
_readSubPlan(OUT_TYPE(SubPlan, SubPlan) msg)
{
  SubPlan *node = makeNode(SubPlan);
  READ_ENUM_FIELD(SubLinkType, sub_link_type, subLinkType, subLinkType);
  READ_NODE_PTR_FIELD(testexpr, testexpr, testexpr);
  READ_LIST_FIELD(param_ids, paramIds, paramIds);
  READ_INT_FIELD(plan_id, plan_id, plan_id);
  READ_STRING_FIELD(plan_name, plan_name, plan_name);
  READ_UINT_FIELD(first_col_type, firstColType, firstColType);
  READ_INT_FIELD(first_col_typmod, firstColTypmod, firstColTypmod);
  READ_UINT_FIELD(first_col_collation, firstColCollation, firstColCollation);
  READ_BOOL_FIELD(use_hash_table, useHashTable, useHashTable);
  READ_BOOL_FIELD(unknown_eq_false, unknownEqFalse, unknownEqFalse);
  READ_BOOL_FIELD(parallel_safe, parallel_safe, parallel_safe);
  READ_LIST_FIELD(set_param, setParam, setParam);
  READ_LIST_FIELD(par_param, parParam, parParam);
  READ_LIST_FIELD(args, args, args);
  READ_FLOAT_FIELD(startup_cost, startup_cost, startup_cost);
  READ_FLOAT_FIELD(per_call_cost, per_call_cost, per_call_cost);
  return node;
}

static AlternativeSubPlan *
_readAlternativeSubPlan(OUT_TYPE(AlternativeSubPlan, AlternativeSubPlan) msg)
{
  AlternativeSubPlan *node = makeNode(AlternativeSubPlan);
  READ_LIST_FIELD(subplans, subplans, subplans);
  return node;
}

static FieldSelect *
_readFieldSelect(OUT_TYPE(FieldSelect, FieldSelect) msg)
{
  FieldSelect *node = makeNode(FieldSelect);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_INT_FIELD(fieldnum, fieldnum, fieldnum);
  READ_UINT_FIELD(resulttype, resulttype, resulttype);
  READ_INT_FIELD(resulttypmod, resulttypmod, resulttypmod);
  READ_UINT_FIELD(resultcollid, resultcollid, resultcollid);
  return node;
}

static FieldStore *
_readFieldStore(OUT_TYPE(FieldStore, FieldStore) msg)
{
  FieldStore *node = makeNode(FieldStore);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_LIST_FIELD(newvals, newvals, newvals);
  READ_LIST_FIELD(fieldnums, fieldnums, fieldnums);
  READ_UINT_FIELD(resulttype, resulttype, resulttype);
  return node;
}

static RelabelType *
_readRelabelType(OUT_TYPE(RelabelType, RelabelType) msg)
{
  RelabelType *node = makeNode(RelabelType);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_UINT_FIELD(resulttype, resulttype, resulttype);
  READ_INT_FIELD(resulttypmod, resulttypmod, resulttypmod);
  READ_UINT_FIELD(resultcollid, resultcollid, resultcollid);
  READ_ENUM_FIELD(CoercionForm, relabelformat, relabelformat, relabelformat);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CoerceViaIO *
_readCoerceViaIO(OUT_TYPE(CoerceViaIO, CoerceViaIO) msg)
{
  CoerceViaIO *node = makeNode(CoerceViaIO);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_UINT_FIELD(resulttype, resulttype, resulttype);
  READ_UINT_FIELD(resultcollid, resultcollid, resultcollid);
  READ_ENUM_FIELD(CoercionForm, coerceformat, coerceformat, coerceformat);
  READ_INT_FIELD(location, location, location);
  return node;
}

static ArrayCoerceExpr *
_readArrayCoerceExpr(OUT_TYPE(ArrayCoerceExpr, ArrayCoerceExpr) msg)
{
  ArrayCoerceExpr *node = makeNode(ArrayCoerceExpr);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_ABSTRACT_PTR_FIELD(elemexpr, elemexpr, elemexpr, Expr*);
  READ_UINT_FIELD(resulttype, resulttype, resulttype);
  READ_INT_FIELD(resulttypmod, resulttypmod, resulttypmod);
  READ_UINT_FIELD(resultcollid, resultcollid, resultcollid);
  READ_ENUM_FIELD(CoercionForm, coerceformat, coerceformat, coerceformat);
  READ_INT_FIELD(location, location, location);
  return node;
}

static ConvertRowtypeExpr *
_readConvertRowtypeExpr(OUT_TYPE(ConvertRowtypeExpr, ConvertRowtypeExpr) msg)
{
  ConvertRowtypeExpr *node = makeNode(ConvertRowtypeExpr);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_UINT_FIELD(resulttype, resulttype, resulttype);
  READ_ENUM_FIELD(CoercionForm, convertformat, convertformat, convertformat);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CollateExpr *
_readCollateExpr(OUT_TYPE(CollateExpr, CollateExpr) msg)
{
  CollateExpr *node = makeNode(CollateExpr);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_UINT_FIELD(coll_oid, collOid, collOid);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CaseExpr *
_readCaseExpr(OUT_TYPE(CaseExpr, CaseExpr) msg)
{
  CaseExpr *node = makeNode(CaseExpr);
  READ_UINT_FIELD(casetype, casetype, casetype);
  READ_UINT_FIELD(casecollid, casecollid, casecollid);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_LIST_FIELD(args, args, args);
  READ_ABSTRACT_PTR_FIELD(defresult, defresult, defresult, Expr*);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CaseWhen *
_readCaseWhen(OUT_TYPE(CaseWhen, CaseWhen) msg)
{
  CaseWhen *node = makeNode(CaseWhen);
  READ_ABSTRACT_PTR_FIELD(expr, expr, expr, Expr*);
  READ_ABSTRACT_PTR_FIELD(result, result, result, Expr*);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CaseTestExpr *
_readCaseTestExpr(OUT_TYPE(CaseTestExpr, CaseTestExpr) msg)
{
  CaseTestExpr *node = makeNode(CaseTestExpr);
  READ_UINT_FIELD(type_id, typeId, typeId);
  READ_INT_FIELD(type_mod, typeMod, typeMod);
  READ_UINT_FIELD(collation, collation, collation);
  return node;
}

static ArrayExpr *
_readArrayExpr(OUT_TYPE(ArrayExpr, ArrayExpr) msg)
{
  ArrayExpr *node = makeNode(ArrayExpr);
  READ_UINT_FIELD(array_typeid, array_typeid, array_typeid);
  READ_UINT_FIELD(array_collid, array_collid, array_collid);
  READ_UINT_FIELD(element_typeid, element_typeid, element_typeid);
  READ_LIST_FIELD(elements, elements, elements);
  READ_BOOL_FIELD(multidims, multidims, multidims);
  READ_INT_FIELD(location, location, location);
  return node;
}

static RowExpr *
_readRowExpr(OUT_TYPE(RowExpr, RowExpr) msg)
{
  RowExpr *node = makeNode(RowExpr);
  READ_LIST_FIELD(args, args, args);
  READ_UINT_FIELD(row_typeid, row_typeid, row_typeid);
  READ_ENUM_FIELD(CoercionForm, row_format, row_format, row_format);
  READ_LIST_FIELD(colnames, colnames, colnames);
  READ_INT_FIELD(location, location, location);
  return node;
}

static RowCompareExpr *
_readRowCompareExpr(OUT_TYPE(RowCompareExpr, RowCompareExpr) msg)
{
  RowCompareExpr *node = makeNode(RowCompareExpr);
  READ_ENUM_FIELD(RowCompareType, rctype, rctype, rctype);
  READ_LIST_FIELD(opnos, opnos, opnos);
  READ_LIST_FIELD(opfamilies, opfamilies, opfamilies);
  READ_LIST_FIELD(inputcollids, inputcollids, inputcollids);
  READ_LIST_FIELD(largs, largs, largs);
  READ_LIST_FIELD(rargs, rargs, rargs);
  return node;
}

static CoalesceExpr *
_readCoalesceExpr(OUT_TYPE(CoalesceExpr, CoalesceExpr) msg)
{
  CoalesceExpr *node = makeNode(CoalesceExpr);
  READ_UINT_FIELD(coalescetype, coalescetype, coalescetype);
  READ_UINT_FIELD(coalescecollid, coalescecollid, coalescecollid);
  READ_LIST_FIELD(args, args, args);
  READ_INT_FIELD(location, location, location);
  return node;
}

static MinMaxExpr *
_readMinMaxExpr(OUT_TYPE(MinMaxExpr, MinMaxExpr) msg)
{
  MinMaxExpr *node = makeNode(MinMaxExpr);
  READ_UINT_FIELD(minmaxtype, minmaxtype, minmaxtype);
  READ_UINT_FIELD(minmaxcollid, minmaxcollid, minmaxcollid);
  READ_UINT_FIELD(inputcollid, inputcollid, inputcollid);
  READ_ENUM_FIELD(MinMaxOp, op, op, op);
  READ_LIST_FIELD(args, args, args);
  READ_INT_FIELD(location, location, location);
  return node;
}

static SQLValueFunction *
_readSQLValueFunction(OUT_TYPE(SQLValueFunction, SQLValueFunction) msg)
{
  SQLValueFunction *node = makeNode(SQLValueFunction);
  READ_ENUM_FIELD(SQLValueFunctionOp, op, op, op);
  READ_UINT_FIELD(type, type, type);
  READ_INT_FIELD(typmod, typmod, typmod);
  READ_INT_FIELD(location, location, location);
  return node;
}

static XmlExpr *
_readXmlExpr(OUT_TYPE(XmlExpr, XmlExpr) msg)
{
  XmlExpr *node = makeNode(XmlExpr);
  READ_ENUM_FIELD(XmlExprOp, op, op, op);
  READ_STRING_FIELD(name, name, name);
  READ_LIST_FIELD(named_args, named_args, named_args);
  READ_LIST_FIELD(arg_names, arg_names, arg_names);
  READ_LIST_FIELD(args, args, args);
  READ_ENUM_FIELD(XmlOptionType, xmloption, xmloption, xmloption);
  READ_BOOL_FIELD(indent, indent, indent);
  READ_UINT_FIELD(type, type, type);
  READ_INT_FIELD(typmod, typmod, typmod);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonFormat *
_readJsonFormat(OUT_TYPE(JsonFormat, JsonFormat) msg)
{
  JsonFormat *node = makeNode(JsonFormat);
  READ_ENUM_FIELD(JsonFormatType, format_type, format_type, format_type);
  READ_ENUM_FIELD(JsonEncoding, encoding, encoding, encoding);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonReturning *
_readJsonReturning(OUT_TYPE(JsonReturning, JsonReturning) msg)
{
  JsonReturning *node = makeNode(JsonReturning);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonFormat, json_format, format, format, format);
  READ_UINT_FIELD(typid, typid, typid);
  READ_INT_FIELD(typmod, typmod, typmod);
  return node;
}

static JsonValueExpr *
_readJsonValueExpr(OUT_TYPE(JsonValueExpr, JsonValueExpr) msg)
{
  JsonValueExpr *node = makeNode(JsonValueExpr);
  READ_ABSTRACT_PTR_FIELD(raw_expr, raw_expr, raw_expr, Expr*);
  READ_ABSTRACT_PTR_FIELD(formatted_expr, formatted_expr, formatted_expr, Expr*);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonFormat, json_format, format, format, format);
  return node;
}

static JsonConstructorExpr *
_readJsonConstructorExpr(OUT_TYPE(JsonConstructorExpr, JsonConstructorExpr) msg)
{
  JsonConstructorExpr *node = makeNode(JsonConstructorExpr);
  READ_ENUM_FIELD(JsonConstructorType, type, type, type);
  READ_LIST_FIELD(args, args, args);
  READ_ABSTRACT_PTR_FIELD(func, func, func, Expr*);
  READ_ABSTRACT_PTR_FIELD(coercion, coercion, coercion, Expr*);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonReturning, json_returning, returning, returning, returning);
  READ_BOOL_FIELD(absent_on_null, absent_on_null, absent_on_null);
  READ_BOOL_FIELD(unique, unique, unique);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonIsPredicate *
_readJsonIsPredicate(OUT_TYPE(JsonIsPredicate, JsonIsPredicate) msg)
{
  JsonIsPredicate *node = makeNode(JsonIsPredicate);
  READ_NODE_PTR_FIELD(expr, expr, expr);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonFormat, json_format, format, format, format);
  READ_ENUM_FIELD(JsonValueType, item_type, item_type, item_type);
  READ_BOOL_FIELD(unique_keys, unique_keys, unique_keys);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonBehavior *
_readJsonBehavior(OUT_TYPE(JsonBehavior, JsonBehavior) msg)
{
  JsonBehavior *node = makeNode(JsonBehavior);
  READ_ENUM_FIELD(JsonBehaviorType, btype, btype, btype);
  READ_NODE_PTR_FIELD(expr, expr, expr);
  READ_BOOL_FIELD(coerce, coerce, coerce);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonExpr *
_readJsonExpr(OUT_TYPE(JsonExpr, JsonExpr) msg)
{
  JsonExpr *node = makeNode(JsonExpr);
  READ_ENUM_FIELD(JsonExprOp, op, op, op);
  READ_STRING_FIELD(column_name, column_name, column_name);
  READ_NODE_PTR_FIELD(formatted_expr, formatted_expr, formatted_expr);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonFormat, json_format, format, format, format);
  READ_NODE_PTR_FIELD(path_spec, path_spec, path_spec);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonReturning, json_returning, returning, returning, returning);
  READ_LIST_FIELD(passing_names, passing_names, passing_names);
  READ_LIST_FIELD(passing_values, passing_values, passing_values);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonBehavior, json_behavior, on_empty, on_empty, on_empty);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonBehavior, json_behavior, on_error, on_error, on_error);
  READ_BOOL_FIELD(use_io_coercion, use_io_coercion, use_io_coercion);
  READ_BOOL_FIELD(use_json_coercion, use_json_coercion, use_json_coercion);
  READ_ENUM_FIELD(JsonWrapper, wrapper, wrapper, wrapper);
  READ_BOOL_FIELD(omit_quotes, omit_quotes, omit_quotes);
  READ_UINT_FIELD(collation, collation, collation);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonTablePath *
_readJsonTablePath(OUT_TYPE(JsonTablePath, JsonTablePath) msg)
{
  JsonTablePath *node = makeNode(JsonTablePath);
  READ_STRING_FIELD(name, name, name);
  return node;
}

static JsonTablePathScan *
_readJsonTablePathScan(OUT_TYPE(JsonTablePathScan, JsonTablePathScan) msg)
{
  JsonTablePathScan *node = makeNode(JsonTablePathScan);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonTablePath, json_table_path, path, path, path);
  READ_BOOL_FIELD(error_on_error, errorOnError, errorOnError);
  READ_ABSTRACT_PTR_FIELD(child, child, child, JsonTablePlan*);
  READ_INT_FIELD(col_min, colMin, colMin);
  READ_INT_FIELD(col_max, colMax, colMax);
  return node;
}

static JsonTableSiblingJoin *
_readJsonTableSiblingJoin(OUT_TYPE(JsonTableSiblingJoin, JsonTableSiblingJoin) msg)
{
  JsonTableSiblingJoin *node = makeNode(JsonTableSiblingJoin);
  READ_ABSTRACT_PTR_FIELD(lplan, lplan, lplan, JsonTablePlan*);
  READ_ABSTRACT_PTR_FIELD(rplan, rplan, rplan, JsonTablePlan*);
  return node;
}

static NullTest *
_readNullTest(OUT_TYPE(NullTest, NullTest) msg)
{
  NullTest *node = makeNode(NullTest);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_ENUM_FIELD(NullTestType, nulltesttype, nulltesttype, nulltesttype);
  READ_BOOL_FIELD(argisrow, argisrow, argisrow);
  READ_INT_FIELD(location, location, location);
  return node;
}

static BooleanTest *
_readBooleanTest(OUT_TYPE(BooleanTest, BooleanTest) msg)
{
  BooleanTest *node = makeNode(BooleanTest);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_ENUM_FIELD(BoolTestType, booltesttype, booltesttype, booltesttype);
  READ_INT_FIELD(location, location, location);
  return node;
}

static MergeAction *
_readMergeAction(OUT_TYPE(MergeAction, MergeAction) msg)
{
  MergeAction *node = makeNode(MergeAction);
  READ_ENUM_FIELD(MergeMatchKind, match_kind, matchKind, matchKind);
  READ_ENUM_FIELD(CmdType, command_type, commandType, commandType);
  READ_ENUM_FIELD(OverridingKind, override, override, override);
  READ_NODE_PTR_FIELD(qual, qual, qual);
  READ_LIST_FIELD(target_list, targetList, targetList);
  READ_LIST_FIELD(update_colnos, updateColnos, updateColnos);
  return node;
}

static CoerceToDomain *
_readCoerceToDomain(OUT_TYPE(CoerceToDomain, CoerceToDomain) msg)
{
  CoerceToDomain *node = makeNode(CoerceToDomain);
  READ_ABSTRACT_PTR_FIELD(arg, arg, arg, Expr*);
  READ_UINT_FIELD(resulttype, resulttype, resulttype);
  READ_INT_FIELD(resulttypmod, resulttypmod, resulttypmod);
  READ_UINT_FIELD(resultcollid, resultcollid, resultcollid);
  READ_ENUM_FIELD(CoercionForm, coercionformat, coercionformat, coercionformat);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CoerceToDomainValue *
_readCoerceToDomainValue(OUT_TYPE(CoerceToDomainValue, CoerceToDomainValue) msg)
{
  CoerceToDomainValue *node = makeNode(CoerceToDomainValue);
  READ_UINT_FIELD(type_id, typeId, typeId);
  READ_INT_FIELD(type_mod, typeMod, typeMod);
  READ_UINT_FIELD(collation, collation, collation);
  READ_INT_FIELD(location, location, location);
  return node;
}

static SetToDefault *
_readSetToDefault(OUT_TYPE(SetToDefault, SetToDefault) msg)
{
  SetToDefault *node = makeNode(SetToDefault);
  READ_UINT_FIELD(type_id, typeId, typeId);
  READ_INT_FIELD(type_mod, typeMod, typeMod);
  READ_UINT_FIELD(collation, collation, collation);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CurrentOfExpr *
_readCurrentOfExpr(OUT_TYPE(CurrentOfExpr, CurrentOfExpr) msg)
{
  CurrentOfExpr *node = makeNode(CurrentOfExpr);
  READ_UINT_FIELD(cvarno, cvarno, cvarno);
  READ_STRING_FIELD(cursor_name, cursor_name, cursor_name);
  READ_INT_FIELD(cursor_param, cursor_param, cursor_param);
  return node;
}

static NextValueExpr *
_readNextValueExpr(OUT_TYPE(NextValueExpr, NextValueExpr) msg)
{
  NextValueExpr *node = makeNode(NextValueExpr);
  READ_UINT_FIELD(seqid, seqid, seqid);
  READ_UINT_FIELD(type_id, typeId, typeId);
  return node;
}

static InferenceElem *
_readInferenceElem(OUT_TYPE(InferenceElem, InferenceElem) msg)
{
  InferenceElem *node = makeNode(InferenceElem);
  READ_NODE_PTR_FIELD(expr, expr, expr);
  READ_UINT_FIELD(infercollid, infercollid, infercollid);
  READ_UINT_FIELD(inferopclass, inferopclass, inferopclass);
  return node;
}

static TargetEntry *
_readTargetEntry(OUT_TYPE(TargetEntry, TargetEntry) msg)
{
  TargetEntry *node = makeNode(TargetEntry);
  READ_ABSTRACT_PTR_FIELD(expr, expr, expr, Expr*);
  READ_INT_FIELD(resno, resno, resno);
  READ_STRING_FIELD(resname, resname, resname);
  READ_UINT_FIELD(ressortgroupref, ressortgroupref, ressortgroupref);
  READ_UINT_FIELD(resorigtbl, resorigtbl, resorigtbl);
  READ_INT_FIELD(resorigcol, resorigcol, resorigcol);
  READ_BOOL_FIELD(resjunk, resjunk, resjunk);
  return node;
}

static RangeTblRef *
_readRangeTblRef(OUT_TYPE(RangeTblRef, RangeTblRef) msg)
{
  RangeTblRef *node = makeNode(RangeTblRef);
  READ_INT_FIELD(rtindex, rtindex, rtindex);
  return node;
}

static JoinExpr *
_readJoinExpr(OUT_TYPE(JoinExpr, JoinExpr) msg)
{
  JoinExpr *node = makeNode(JoinExpr);
  READ_ENUM_FIELD(JoinType, jointype, jointype, jointype);
  READ_BOOL_FIELD(is_natural, isNatural, isNatural);
  READ_NODE_PTR_FIELD(larg, larg, larg);
  READ_NODE_PTR_FIELD(rarg, rarg, rarg);
  READ_LIST_FIELD(using_clause, usingClause, usingClause);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, join_using_alias, join_using_alias, join_using_alias);
  READ_NODE_PTR_FIELD(quals, quals, quals);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, alias, alias, alias);
  READ_INT_FIELD(rtindex, rtindex, rtindex);
  return node;
}

static FromExpr *
_readFromExpr(OUT_TYPE(FromExpr, FromExpr) msg)
{
  FromExpr *node = makeNode(FromExpr);
  READ_LIST_FIELD(fromlist, fromlist, fromlist);
  READ_NODE_PTR_FIELD(quals, quals, quals);
  return node;
}

static OnConflictExpr *
_readOnConflictExpr(OUT_TYPE(OnConflictExpr, OnConflictExpr) msg)
{
  OnConflictExpr *node = makeNode(OnConflictExpr);
  READ_ENUM_FIELD(OnConflictAction, action, action, action);
  READ_LIST_FIELD(arbiter_elems, arbiterElems, arbiterElems);
  READ_NODE_PTR_FIELD(arbiter_where, arbiterWhere, arbiterWhere);
  READ_UINT_FIELD(constraint, constraint, constraint);
  READ_LIST_FIELD(on_conflict_set, onConflictSet, onConflictSet);
  READ_NODE_PTR_FIELD(on_conflict_where, onConflictWhere, onConflictWhere);
  READ_INT_FIELD(excl_rel_index, exclRelIndex, exclRelIndex);
  READ_LIST_FIELD(excl_rel_tlist, exclRelTlist, exclRelTlist);
  return node;
}

static Query *
_readQuery(OUT_TYPE(Query, Query) msg)
{
  Query *node = makeNode(Query);
  READ_ENUM_FIELD(CmdType, command_type, commandType, commandType);
  READ_ENUM_FIELD(QuerySource, query_source, querySource, querySource);
  READ_BOOL_FIELD(can_set_tag, canSetTag, canSetTag);
  READ_NODE_PTR_FIELD(utility_stmt, utilityStmt, utilityStmt);
  READ_INT_FIELD(result_relation, resultRelation, resultRelation);
  READ_BOOL_FIELD(has_aggs, hasAggs, hasAggs);
  READ_BOOL_FIELD(has_window_funcs, hasWindowFuncs, hasWindowFuncs);
  READ_BOOL_FIELD(has_target_srfs, hasTargetSRFs, hasTargetSRFs);
  READ_BOOL_FIELD(has_sub_links, hasSubLinks, hasSubLinks);
  READ_BOOL_FIELD(has_distinct_on, hasDistinctOn, hasDistinctOn);
  READ_BOOL_FIELD(has_recursive, hasRecursive, hasRecursive);
  READ_BOOL_FIELD(has_modifying_cte, hasModifyingCTE, hasModifyingCTE);
  READ_BOOL_FIELD(has_for_update, hasForUpdate, hasForUpdate);
  READ_BOOL_FIELD(has_row_security, hasRowSecurity, hasRowSecurity);
  READ_BOOL_FIELD(is_return, isReturn, isReturn);
  READ_LIST_FIELD(cte_list, cteList, cteList);
  READ_LIST_FIELD(rtable, rtable, rtable);
  READ_LIST_FIELD(rteperminfos, rteperminfos, rteperminfos);
  READ_SPECIFIC_NODE_PTR_FIELD(FromExpr, from_expr, jointree, jointree, jointree);
  READ_LIST_FIELD(merge_action_list, mergeActionList, mergeActionList);
  READ_INT_FIELD(merge_target_relation, mergeTargetRelation, mergeTargetRelation);
  READ_NODE_PTR_FIELD(merge_join_condition, mergeJoinCondition, mergeJoinCondition);
  READ_LIST_FIELD(target_list, targetList, targetList);
  READ_ENUM_FIELD(OverridingKind, override, override, override);
  READ_SPECIFIC_NODE_PTR_FIELD(OnConflictExpr, on_conflict_expr, on_conflict, onConflict, onConflict);
  READ_LIST_FIELD(returning_list, returningList, returningList);
  READ_LIST_FIELD(group_clause, groupClause, groupClause);
  READ_BOOL_FIELD(group_distinct, groupDistinct, groupDistinct);
  READ_LIST_FIELD(grouping_sets, groupingSets, groupingSets);
  READ_NODE_PTR_FIELD(having_qual, havingQual, havingQual);
  READ_LIST_FIELD(window_clause, windowClause, windowClause);
  READ_LIST_FIELD(distinct_clause, distinctClause, distinctClause);
  READ_LIST_FIELD(sort_clause, sortClause, sortClause);
  READ_NODE_PTR_FIELD(limit_offset, limitOffset, limitOffset);
  READ_NODE_PTR_FIELD(limit_count, limitCount, limitCount);
  READ_ENUM_FIELD(LimitOption, limit_option, limitOption, limitOption);
  READ_LIST_FIELD(row_marks, rowMarks, rowMarks);
  READ_NODE_PTR_FIELD(set_operations, setOperations, setOperations);
  READ_LIST_FIELD(constraint_deps, constraintDeps, constraintDeps);
  READ_LIST_FIELD(with_check_options, withCheckOptions, withCheckOptions);
  READ_INT_FIELD(stmt_location, stmt_location, stmt_location);
  READ_INT_FIELD(stmt_len, stmt_len, stmt_len);
  return node;
}

static TypeName *
_readTypeName(OUT_TYPE(TypeName, TypeName) msg)
{
  TypeName *node = makeNode(TypeName);
  READ_LIST_FIELD(names, names, names);
  READ_UINT_FIELD(type_oid, typeOid, typeOid);
  READ_BOOL_FIELD(setof, setof, setof);
  READ_BOOL_FIELD(pct_type, pct_type, pct_type);
  READ_LIST_FIELD(typmods, typmods, typmods);
  READ_INT_FIELD(typemod, typemod, typemod);
  READ_LIST_FIELD(array_bounds, arrayBounds, arrayBounds);
  READ_INT_FIELD(location, location, location);
  return node;
}

static ColumnRef *
_readColumnRef(OUT_TYPE(ColumnRef, ColumnRef) msg)
{
  ColumnRef *node = makeNode(ColumnRef);
  READ_LIST_FIELD(fields, fields, fields);
  READ_INT_FIELD(location, location, location);
  return node;
}

static ParamRef *
_readParamRef(OUT_TYPE(ParamRef, ParamRef) msg)
{
  ParamRef *node = makeNode(ParamRef);
  READ_INT_FIELD(number, number, number);
  READ_INT_FIELD(location, location, location);
  return node;
}

static A_Expr *
_readAExpr(OUT_TYPE(A_Expr, AExpr) msg)
{
  A_Expr *node = makeNode(A_Expr);
  READ_ENUM_FIELD(A_Expr_Kind, kind, kind, kind);
  READ_LIST_FIELD(name, name, name);
  READ_NODE_PTR_FIELD(lexpr, lexpr, lexpr);
  READ_NODE_PTR_FIELD(rexpr, rexpr, rexpr);
  READ_INT_FIELD(location, location, location);
  return node;
}

static TypeCast *
_readTypeCast(OUT_TYPE(TypeCast, TypeCast) msg)
{
  TypeCast *node = makeNode(TypeCast);
  READ_NODE_PTR_FIELD(arg, arg, arg);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, type_name, typeName, typeName);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CollateClause *
_readCollateClause(OUT_TYPE(CollateClause, CollateClause) msg)
{
  CollateClause *node = makeNode(CollateClause);
  READ_NODE_PTR_FIELD(arg, arg, arg);
  READ_LIST_FIELD(collname, collname, collname);
  READ_INT_FIELD(location, location, location);
  return node;
}

static RoleSpec *
_readRoleSpec(OUT_TYPE(RoleSpec, RoleSpec) msg)
{
  RoleSpec *node = makeNode(RoleSpec);
  READ_ENUM_FIELD(RoleSpecType, roletype, roletype, roletype);
  READ_STRING_FIELD(rolename, rolename, rolename);
  READ_INT_FIELD(location, location, location);
  return node;
}

static FuncCall *
_readFuncCall(OUT_TYPE(FuncCall, FuncCall) msg)
{
  FuncCall *node = makeNode(FuncCall);
  READ_LIST_FIELD(funcname, funcname, funcname);
  READ_LIST_FIELD(args, args, args);
  READ_LIST_FIELD(agg_order, agg_order, agg_order);
  READ_NODE_PTR_FIELD(agg_filter, agg_filter, agg_filter);
  READ_SPECIFIC_NODE_PTR_FIELD(WindowDef, window_def, over, over, over);
  READ_BOOL_FIELD(agg_within_group, agg_within_group, agg_within_group);
  READ_BOOL_FIELD(agg_star, agg_star, agg_star);
  READ_BOOL_FIELD(agg_distinct, agg_distinct, agg_distinct);
  READ_BOOL_FIELD(func_variadic, func_variadic, func_variadic);
  READ_ENUM_FIELD(CoercionForm, funcformat, funcformat, funcformat);
  READ_INT_FIELD(location, location, location);
  return node;
}

static A_Star *
_readAStar(OUT_TYPE(A_Star, AStar) msg)
{
  A_Star *node = makeNode(A_Star);
  return node;
}

static A_Indices *
_readAIndices(OUT_TYPE(A_Indices, AIndices) msg)
{
  A_Indices *node = makeNode(A_Indices);
  READ_BOOL_FIELD(is_slice, is_slice, is_slice);
  READ_NODE_PTR_FIELD(lidx, lidx, lidx);
  READ_NODE_PTR_FIELD(uidx, uidx, uidx);
  return node;
}

static A_Indirection *
_readAIndirection(OUT_TYPE(A_Indirection, AIndirection) msg)
{
  A_Indirection *node = makeNode(A_Indirection);
  READ_NODE_PTR_FIELD(arg, arg, arg);
  READ_LIST_FIELD(indirection, indirection, indirection);
  return node;
}

static A_ArrayExpr *
_readAArrayExpr(OUT_TYPE(A_ArrayExpr, AArrayExpr) msg)
{
  A_ArrayExpr *node = makeNode(A_ArrayExpr);
  READ_LIST_FIELD(elements, elements, elements);
  READ_INT_FIELD(location, location, location);
  return node;
}

static ResTarget *
_readResTarget(OUT_TYPE(ResTarget, ResTarget) msg)
{
  ResTarget *node = makeNode(ResTarget);
  READ_STRING_FIELD(name, name, name);
  READ_LIST_FIELD(indirection, indirection, indirection);
  READ_NODE_PTR_FIELD(val, val, val);
  READ_INT_FIELD(location, location, location);
  return node;
}

static MultiAssignRef *
_readMultiAssignRef(OUT_TYPE(MultiAssignRef, MultiAssignRef) msg)
{
  MultiAssignRef *node = makeNode(MultiAssignRef);
  READ_NODE_PTR_FIELD(source, source, source);
  READ_INT_FIELD(colno, colno, colno);
  READ_INT_FIELD(ncolumns, ncolumns, ncolumns);
  return node;
}

static SortBy *
_readSortBy(OUT_TYPE(SortBy, SortBy) msg)
{
  SortBy *node = makeNode(SortBy);
  READ_NODE_PTR_FIELD(node, node, node);
  READ_ENUM_FIELD(SortByDir, sortby_dir, sortby_dir, sortby_dir);
  READ_ENUM_FIELD(SortByNulls, sortby_nulls, sortby_nulls, sortby_nulls);
  READ_LIST_FIELD(use_op, useOp, useOp);
  READ_INT_FIELD(location, location, location);
  return node;
}

static WindowDef *
_readWindowDef(OUT_TYPE(WindowDef, WindowDef) msg)
{
  WindowDef *node = makeNode(WindowDef);
  READ_STRING_FIELD(name, name, name);
  READ_STRING_FIELD(refname, refname, refname);
  READ_LIST_FIELD(partition_clause, partitionClause, partitionClause);
  READ_LIST_FIELD(order_clause, orderClause, orderClause);
  READ_INT_FIELD(frame_options, frameOptions, frameOptions);
  READ_NODE_PTR_FIELD(start_offset, startOffset, startOffset);
  READ_NODE_PTR_FIELD(end_offset, endOffset, endOffset);
  READ_INT_FIELD(location, location, location);
  return node;
}

static RangeSubselect *
_readRangeSubselect(OUT_TYPE(RangeSubselect, RangeSubselect) msg)
{
  RangeSubselect *node = makeNode(RangeSubselect);
  READ_BOOL_FIELD(lateral, lateral, lateral);
  READ_NODE_PTR_FIELD(subquery, subquery, subquery);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, alias, alias, alias);
  return node;
}

static RangeFunction *
_readRangeFunction(OUT_TYPE(RangeFunction, RangeFunction) msg)
{
  RangeFunction *node = makeNode(RangeFunction);
  READ_BOOL_FIELD(lateral, lateral, lateral);
  READ_BOOL_FIELD(ordinality, ordinality, ordinality);
  READ_BOOL_FIELD(is_rowsfrom, is_rowsfrom, is_rowsfrom);
  READ_LIST_FIELD(functions, functions, functions);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, alias, alias, alias);
  READ_LIST_FIELD(coldeflist, coldeflist, coldeflist);
  return node;
}

static RangeTableFunc *
_readRangeTableFunc(OUT_TYPE(RangeTableFunc, RangeTableFunc) msg)
{
  RangeTableFunc *node = makeNode(RangeTableFunc);
  READ_BOOL_FIELD(lateral, lateral, lateral);
  READ_NODE_PTR_FIELD(docexpr, docexpr, docexpr);
  READ_NODE_PTR_FIELD(rowexpr, rowexpr, rowexpr);
  READ_LIST_FIELD(namespaces, namespaces, namespaces);
  READ_LIST_FIELD(columns, columns, columns);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, alias, alias, alias);
  READ_INT_FIELD(location, location, location);
  return node;
}

static RangeTableFuncCol *
_readRangeTableFuncCol(OUT_TYPE(RangeTableFuncCol, RangeTableFuncCol) msg)
{
  RangeTableFuncCol *node = makeNode(RangeTableFuncCol);
  READ_STRING_FIELD(colname, colname, colname);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, type_name, typeName, typeName);
  READ_BOOL_FIELD(for_ordinality, for_ordinality, for_ordinality);
  READ_BOOL_FIELD(is_not_null, is_not_null, is_not_null);
  READ_NODE_PTR_FIELD(colexpr, colexpr, colexpr);
  READ_NODE_PTR_FIELD(coldefexpr, coldefexpr, coldefexpr);
  READ_INT_FIELD(location, location, location);
  return node;
}

static RangeTableSample *
_readRangeTableSample(OUT_TYPE(RangeTableSample, RangeTableSample) msg)
{
  RangeTableSample *node = makeNode(RangeTableSample);
  READ_NODE_PTR_FIELD(relation, relation, relation);
  READ_LIST_FIELD(method, method, method);
  READ_LIST_FIELD(args, args, args);
  READ_NODE_PTR_FIELD(repeatable, repeatable, repeatable);
  READ_INT_FIELD(location, location, location);
  return node;
}

static ColumnDef *
_readColumnDef(OUT_TYPE(ColumnDef, ColumnDef) msg)
{
  ColumnDef *node = makeNode(ColumnDef);
  READ_STRING_FIELD(colname, colname, colname);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, type_name, typeName, typeName);
  READ_STRING_FIELD(compression, compression, compression);
  READ_INT_FIELD(inhcount, inhcount, inhcount);
  READ_BOOL_FIELD(is_local, is_local, is_local);
  READ_BOOL_FIELD(is_not_null, is_not_null, is_not_null);
  READ_BOOL_FIELD(is_from_type, is_from_type, is_from_type);
  READ_CHAR_FIELD(storage, storage, storage);
  READ_STRING_FIELD(storage_name, storage_name, storage_name);
  READ_NODE_PTR_FIELD(raw_default, raw_default, raw_default);
  READ_NODE_PTR_FIELD(cooked_default, cooked_default, cooked_default);
  READ_CHAR_FIELD(identity, identity, identity);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, identity_sequence, identitySequence, identitySequence);
  READ_CHAR_FIELD(generated, generated, generated);
  READ_SPECIFIC_NODE_PTR_FIELD(CollateClause, collate_clause, coll_clause, collClause, collClause);
  READ_UINT_FIELD(coll_oid, collOid, collOid);
  READ_LIST_FIELD(constraints, constraints, constraints);
  READ_LIST_FIELD(fdwoptions, fdwoptions, fdwoptions);
  READ_INT_FIELD(location, location, location);
  return node;
}

static TableLikeClause *
_readTableLikeClause(OUT_TYPE(TableLikeClause, TableLikeClause) msg)
{
  TableLikeClause *node = makeNode(TableLikeClause);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_UINT_FIELD(options, options, options);
  READ_UINT_FIELD(relation_oid, relationOid, relationOid);
  return node;
}

static IndexElem *
_readIndexElem(OUT_TYPE(IndexElem, IndexElem) msg)
{
  IndexElem *node = makeNode(IndexElem);
  READ_STRING_FIELD(name, name, name);
  READ_NODE_PTR_FIELD(expr, expr, expr);
  READ_STRING_FIELD(indexcolname, indexcolname, indexcolname);
  READ_LIST_FIELD(collation, collation, collation);
  READ_LIST_FIELD(opclass, opclass, opclass);
  READ_LIST_FIELD(opclassopts, opclassopts, opclassopts);
  READ_ENUM_FIELD(SortByDir, ordering, ordering, ordering);
  READ_ENUM_FIELD(SortByNulls, nulls_ordering, nulls_ordering, nulls_ordering);
  return node;
}

static DefElem *
_readDefElem(OUT_TYPE(DefElem, DefElem) msg)
{
  DefElem *node = makeNode(DefElem);
  READ_STRING_FIELD(defnamespace, defnamespace, defnamespace);
  READ_STRING_FIELD(defname, defname, defname);
  READ_NODE_PTR_FIELD(arg, arg, arg);
  READ_ENUM_FIELD(DefElemAction, defaction, defaction, defaction);
  READ_INT_FIELD(location, location, location);
  return node;
}

static LockingClause *
_readLockingClause(OUT_TYPE(LockingClause, LockingClause) msg)
{
  LockingClause *node = makeNode(LockingClause);
  READ_LIST_FIELD(locked_rels, lockedRels, lockedRels);
  READ_ENUM_FIELD(LockClauseStrength, strength, strength, strength);
  READ_ENUM_FIELD(LockWaitPolicy, wait_policy, waitPolicy, waitPolicy);
  return node;
}

static XmlSerialize *
_readXmlSerialize(OUT_TYPE(XmlSerialize, XmlSerialize) msg)
{
  XmlSerialize *node = makeNode(XmlSerialize);
  READ_ENUM_FIELD(XmlOptionType, xmloption, xmloption, xmloption);
  READ_NODE_PTR_FIELD(expr, expr, expr);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, type_name, typeName, typeName);
  READ_BOOL_FIELD(indent, indent, indent);
  READ_INT_FIELD(location, location, location);
  return node;
}

static PartitionElem *
_readPartitionElem(OUT_TYPE(PartitionElem, PartitionElem) msg)
{
  PartitionElem *node = makeNode(PartitionElem);
  READ_STRING_FIELD(name, name, name);
  READ_NODE_PTR_FIELD(expr, expr, expr);
  READ_LIST_FIELD(collation, collation, collation);
  READ_LIST_FIELD(opclass, opclass, opclass);
  READ_INT_FIELD(location, location, location);
  return node;
}

static PartitionSpec *
_readPartitionSpec(OUT_TYPE(PartitionSpec, PartitionSpec) msg)
{
  PartitionSpec *node = makeNode(PartitionSpec);
  READ_ENUM_FIELD(PartitionStrategy, strategy, strategy, strategy);
  READ_LIST_FIELD(part_params, partParams, partParams);
  READ_INT_FIELD(location, location, location);
  return node;
}

static PartitionBoundSpec *
_readPartitionBoundSpec(OUT_TYPE(PartitionBoundSpec, PartitionBoundSpec) msg)
{
  PartitionBoundSpec *node = makeNode(PartitionBoundSpec);
  READ_CHAR_FIELD(strategy, strategy, strategy);
  READ_BOOL_FIELD(is_default, is_default, is_default);
  READ_INT_FIELD(modulus, modulus, modulus);
  READ_INT_FIELD(remainder, remainder, remainder);
  READ_LIST_FIELD(listdatums, listdatums, listdatums);
  READ_LIST_FIELD(lowerdatums, lowerdatums, lowerdatums);
  READ_LIST_FIELD(upperdatums, upperdatums, upperdatums);
  READ_INT_FIELD(location, location, location);
  return node;
}

static PartitionRangeDatum *
_readPartitionRangeDatum(OUT_TYPE(PartitionRangeDatum, PartitionRangeDatum) msg)
{
  PartitionRangeDatum *node = makeNode(PartitionRangeDatum);
  READ_ENUM_FIELD(PartitionRangeDatumKind, kind, kind, kind);
  READ_NODE_PTR_FIELD(value, value, value);
  READ_INT_FIELD(location, location, location);
  return node;
}

static SinglePartitionSpec *
_readSinglePartitionSpec(OUT_TYPE(SinglePartitionSpec, SinglePartitionSpec) msg)
{
  SinglePartitionSpec *node = makeNode(SinglePartitionSpec);
  return node;
}

static PartitionCmd *
_readPartitionCmd(OUT_TYPE(PartitionCmd, PartitionCmd) msg)
{
  PartitionCmd *node = makeNode(PartitionCmd);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, name, name, name);
  READ_SPECIFIC_NODE_PTR_FIELD(PartitionBoundSpec, partition_bound_spec, bound, bound, bound);
  READ_BOOL_FIELD(concurrent, concurrent, concurrent);
  return node;
}

static RangeTblEntry *
_readRangeTblEntry(OUT_TYPE(RangeTblEntry, RangeTblEntry) msg)
{
  RangeTblEntry *node = makeNode(RangeTblEntry);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, alias, alias, alias);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, eref, eref, eref);
  READ_ENUM_FIELD(RTEKind, rtekind, rtekind, rtekind);
  READ_UINT_FIELD(relid, relid, relid);
  READ_BOOL_FIELD(inh, inh, inh);
  READ_CHAR_FIELD(relkind, relkind, relkind);
  READ_INT_FIELD(rellockmode, rellockmode, rellockmode);
  READ_UINT_FIELD(perminfoindex, perminfoindex, perminfoindex);
  READ_SPECIFIC_NODE_PTR_FIELD(TableSampleClause, table_sample_clause, tablesample, tablesample, tablesample);
  READ_SPECIFIC_NODE_PTR_FIELD(Query, query, subquery, subquery, subquery);
  READ_BOOL_FIELD(security_barrier, security_barrier, security_barrier);
  READ_ENUM_FIELD(JoinType, jointype, jointype, jointype);
  READ_INT_FIELD(joinmergedcols, joinmergedcols, joinmergedcols);
  READ_LIST_FIELD(joinaliasvars, joinaliasvars, joinaliasvars);
  READ_LIST_FIELD(joinleftcols, joinleftcols, joinleftcols);
  READ_LIST_FIELD(joinrightcols, joinrightcols, joinrightcols);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, join_using_alias, join_using_alias, join_using_alias);
  READ_LIST_FIELD(functions, functions, functions);
  READ_BOOL_FIELD(funcordinality, funcordinality, funcordinality);
  READ_SPECIFIC_NODE_PTR_FIELD(TableFunc, table_func, tablefunc, tablefunc, tablefunc);
  READ_LIST_FIELD(values_lists, values_lists, values_lists);
  READ_STRING_FIELD(ctename, ctename, ctename);
  READ_UINT_FIELD(ctelevelsup, ctelevelsup, ctelevelsup);
  READ_BOOL_FIELD(self_reference, self_reference, self_reference);
  READ_LIST_FIELD(coltypes, coltypes, coltypes);
  READ_LIST_FIELD(coltypmods, coltypmods, coltypmods);
  READ_LIST_FIELD(colcollations, colcollations, colcollations);
  READ_STRING_FIELD(enrname, enrname, enrname);
  READ_FLOAT_FIELD(enrtuples, enrtuples, enrtuples);
  READ_BOOL_FIELD(lateral, lateral, lateral);
  READ_BOOL_FIELD(in_from_cl, inFromCl, inFromCl);
  READ_LIST_FIELD(security_quals, securityQuals, securityQuals);
  return node;
}

static RTEPermissionInfo *
_readRTEPermissionInfo(OUT_TYPE(RTEPermissionInfo, RTEPermissionInfo) msg)
{
  RTEPermissionInfo *node = makeNode(RTEPermissionInfo);
  READ_UINT_FIELD(relid, relid, relid);
  READ_BOOL_FIELD(inh, inh, inh);
  READ_UINT64_FIELD(required_perms, requiredPerms, requiredPerms);
  READ_UINT_FIELD(check_as_user, checkAsUser, checkAsUser);
  READ_BITMAPSET_FIELD(selected_cols, selectedCols, selectedCols);
  READ_BITMAPSET_FIELD(inserted_cols, insertedCols, insertedCols);
  READ_BITMAPSET_FIELD(updated_cols, updatedCols, updatedCols);
  return node;
}

static RangeTblFunction *
_readRangeTblFunction(OUT_TYPE(RangeTblFunction, RangeTblFunction) msg)
{
  RangeTblFunction *node = makeNode(RangeTblFunction);
  READ_NODE_PTR_FIELD(funcexpr, funcexpr, funcexpr);
  READ_INT_FIELD(funccolcount, funccolcount, funccolcount);
  READ_LIST_FIELD(funccolnames, funccolnames, funccolnames);
  READ_LIST_FIELD(funccoltypes, funccoltypes, funccoltypes);
  READ_LIST_FIELD(funccoltypmods, funccoltypmods, funccoltypmods);
  READ_LIST_FIELD(funccolcollations, funccolcollations, funccolcollations);
  READ_BITMAPSET_FIELD(funcparams, funcparams, funcparams);
  return node;
}

static TableSampleClause *
_readTableSampleClause(OUT_TYPE(TableSampleClause, TableSampleClause) msg)
{
  TableSampleClause *node = makeNode(TableSampleClause);
  READ_UINT_FIELD(tsmhandler, tsmhandler, tsmhandler);
  READ_LIST_FIELD(args, args, args);
  READ_ABSTRACT_PTR_FIELD(repeatable, repeatable, repeatable, Expr*);
  return node;
}

static WithCheckOption *
_readWithCheckOption(OUT_TYPE(WithCheckOption, WithCheckOption) msg)
{
  WithCheckOption *node = makeNode(WithCheckOption);
  READ_ENUM_FIELD(WCOKind, kind, kind, kind);
  READ_STRING_FIELD(relname, relname, relname);
  READ_STRING_FIELD(polname, polname, polname);
  READ_NODE_PTR_FIELD(qual, qual, qual);
  READ_BOOL_FIELD(cascaded, cascaded, cascaded);
  return node;
}

static SortGroupClause *
_readSortGroupClause(OUT_TYPE(SortGroupClause, SortGroupClause) msg)
{
  SortGroupClause *node = makeNode(SortGroupClause);
  READ_UINT_FIELD(tle_sort_group_ref, tleSortGroupRef, tleSortGroupRef);
  READ_UINT_FIELD(eqop, eqop, eqop);
  READ_UINT_FIELD(sortop, sortop, sortop);
  READ_BOOL_FIELD(nulls_first, nulls_first, nulls_first);
  READ_BOOL_FIELD(hashable, hashable, hashable);
  return node;
}

static GroupingSet *
_readGroupingSet(OUT_TYPE(GroupingSet, GroupingSet) msg)
{
  GroupingSet *node = makeNode(GroupingSet);
  READ_ENUM_FIELD(GroupingSetKind, kind, kind, kind);
  READ_LIST_FIELD(content, content, content);
  READ_INT_FIELD(location, location, location);
  return node;
}

static WindowClause *
_readWindowClause(OUT_TYPE(WindowClause, WindowClause) msg)
{
  WindowClause *node = makeNode(WindowClause);
  READ_STRING_FIELD(name, name, name);
  READ_STRING_FIELD(refname, refname, refname);
  READ_LIST_FIELD(partition_clause, partitionClause, partitionClause);
  READ_LIST_FIELD(order_clause, orderClause, orderClause);
  READ_INT_FIELD(frame_options, frameOptions, frameOptions);
  READ_NODE_PTR_FIELD(start_offset, startOffset, startOffset);
  READ_NODE_PTR_FIELD(end_offset, endOffset, endOffset);
  READ_UINT_FIELD(start_in_range_func, startInRangeFunc, startInRangeFunc);
  READ_UINT_FIELD(end_in_range_func, endInRangeFunc, endInRangeFunc);
  READ_UINT_FIELD(in_range_coll, inRangeColl, inRangeColl);
  READ_BOOL_FIELD(in_range_asc, inRangeAsc, inRangeAsc);
  READ_BOOL_FIELD(in_range_nulls_first, inRangeNullsFirst, inRangeNullsFirst);
  READ_UINT_FIELD(winref, winref, winref);
  READ_BOOL_FIELD(copied_order, copiedOrder, copiedOrder);
  return node;
}

static RowMarkClause *
_readRowMarkClause(OUT_TYPE(RowMarkClause, RowMarkClause) msg)
{
  RowMarkClause *node = makeNode(RowMarkClause);
  READ_UINT_FIELD(rti, rti, rti);
  READ_ENUM_FIELD(LockClauseStrength, strength, strength, strength);
  READ_ENUM_FIELD(LockWaitPolicy, wait_policy, waitPolicy, waitPolicy);
  READ_BOOL_FIELD(pushed_down, pushedDown, pushedDown);
  return node;
}

static WithClause *
_readWithClause(OUT_TYPE(WithClause, WithClause) msg)
{
  WithClause *node = makeNode(WithClause);
  READ_LIST_FIELD(ctes, ctes, ctes);
  READ_BOOL_FIELD(recursive, recursive, recursive);
  READ_INT_FIELD(location, location, location);
  return node;
}

static InferClause *
_readInferClause(OUT_TYPE(InferClause, InferClause) msg)
{
  InferClause *node = makeNode(InferClause);
  READ_LIST_FIELD(index_elems, indexElems, indexElems);
  READ_NODE_PTR_FIELD(where_clause, whereClause, whereClause);
  READ_STRING_FIELD(conname, conname, conname);
  READ_INT_FIELD(location, location, location);
  return node;
}

static OnConflictClause *
_readOnConflictClause(OUT_TYPE(OnConflictClause, OnConflictClause) msg)
{
  OnConflictClause *node = makeNode(OnConflictClause);
  READ_ENUM_FIELD(OnConflictAction, action, action, action);
  READ_SPECIFIC_NODE_PTR_FIELD(InferClause, infer_clause, infer, infer, infer);
  READ_LIST_FIELD(target_list, targetList, targetList);
  READ_NODE_PTR_FIELD(where_clause, whereClause, whereClause);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CTESearchClause *
_readCTESearchClause(OUT_TYPE(CTESearchClause, CTESearchClause) msg)
{
  CTESearchClause *node = makeNode(CTESearchClause);
  READ_LIST_FIELD(search_col_list, search_col_list, search_col_list);
  READ_BOOL_FIELD(search_breadth_first, search_breadth_first, search_breadth_first);
  READ_STRING_FIELD(search_seq_column, search_seq_column, search_seq_column);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CTECycleClause *
_readCTECycleClause(OUT_TYPE(CTECycleClause, CTECycleClause) msg)
{
  CTECycleClause *node = makeNode(CTECycleClause);
  READ_LIST_FIELD(cycle_col_list, cycle_col_list, cycle_col_list);
  READ_STRING_FIELD(cycle_mark_column, cycle_mark_column, cycle_mark_column);
  READ_NODE_PTR_FIELD(cycle_mark_value, cycle_mark_value, cycle_mark_value);
  READ_NODE_PTR_FIELD(cycle_mark_default, cycle_mark_default, cycle_mark_default);
  READ_STRING_FIELD(cycle_path_column, cycle_path_column, cycle_path_column);
  READ_INT_FIELD(location, location, location);
  READ_UINT_FIELD(cycle_mark_type, cycle_mark_type, cycle_mark_type);
  READ_INT_FIELD(cycle_mark_typmod, cycle_mark_typmod, cycle_mark_typmod);
  READ_UINT_FIELD(cycle_mark_collation, cycle_mark_collation, cycle_mark_collation);
  READ_UINT_FIELD(cycle_mark_neop, cycle_mark_neop, cycle_mark_neop);
  return node;
}

static CommonTableExpr *
_readCommonTableExpr(OUT_TYPE(CommonTableExpr, CommonTableExpr) msg)
{
  CommonTableExpr *node = makeNode(CommonTableExpr);
  READ_STRING_FIELD(ctename, ctename, ctename);
  READ_LIST_FIELD(aliascolnames, aliascolnames, aliascolnames);
  READ_ENUM_FIELD(CTEMaterialize, ctematerialized, ctematerialized, ctematerialized);
  READ_NODE_PTR_FIELD(ctequery, ctequery, ctequery);
  READ_SPECIFIC_NODE_PTR_FIELD(CTESearchClause, ctesearch_clause, search_clause, search_clause, search_clause);
  READ_SPECIFIC_NODE_PTR_FIELD(CTECycleClause, ctecycle_clause, cycle_clause, cycle_clause, cycle_clause);
  READ_INT_FIELD(location, location, location);
  READ_BOOL_FIELD(cterecursive, cterecursive, cterecursive);
  READ_INT_FIELD(cterefcount, cterefcount, cterefcount);
  READ_LIST_FIELD(ctecolnames, ctecolnames, ctecolnames);
  READ_LIST_FIELD(ctecoltypes, ctecoltypes, ctecoltypes);
  READ_LIST_FIELD(ctecoltypmods, ctecoltypmods, ctecoltypmods);
  READ_LIST_FIELD(ctecolcollations, ctecolcollations, ctecolcollations);
  return node;
}

static MergeWhenClause *
_readMergeWhenClause(OUT_TYPE(MergeWhenClause, MergeWhenClause) msg)
{
  MergeWhenClause *node = makeNode(MergeWhenClause);
  READ_ENUM_FIELD(MergeMatchKind, match_kind, matchKind, matchKind);
  READ_ENUM_FIELD(CmdType, command_type, commandType, commandType);
  READ_ENUM_FIELD(OverridingKind, override, override, override);
  READ_NODE_PTR_FIELD(condition, condition, condition);
  READ_LIST_FIELD(target_list, targetList, targetList);
  READ_LIST_FIELD(values, values, values);
  return node;
}

static TriggerTransition *
_readTriggerTransition(OUT_TYPE(TriggerTransition, TriggerTransition) msg)
{
  TriggerTransition *node = makeNode(TriggerTransition);
  READ_STRING_FIELD(name, name, name);
  READ_BOOL_FIELD(is_new, isNew, isNew);
  READ_BOOL_FIELD(is_table, isTable, isTable);
  return node;
}

static JsonOutput *
_readJsonOutput(OUT_TYPE(JsonOutput, JsonOutput) msg)
{
  JsonOutput *node = makeNode(JsonOutput);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, type_name, typeName, typeName);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonReturning, json_returning, returning, returning, returning);
  return node;
}

static JsonArgument *
_readJsonArgument(OUT_TYPE(JsonArgument, JsonArgument) msg)
{
  JsonArgument *node = makeNode(JsonArgument);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonValueExpr, json_value_expr, val, val, val);
  READ_STRING_FIELD(name, name, name);
  return node;
}

static JsonFuncExpr *
_readJsonFuncExpr(OUT_TYPE(JsonFuncExpr, JsonFuncExpr) msg)
{
  JsonFuncExpr *node = makeNode(JsonFuncExpr);
  READ_ENUM_FIELD(JsonExprOp, op, op, op);
  READ_STRING_FIELD(column_name, column_name, column_name);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonValueExpr, json_value_expr, context_item, context_item, context_item);
  READ_NODE_PTR_FIELD(pathspec, pathspec, pathspec);
  READ_LIST_FIELD(passing, passing, passing);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonOutput, json_output, output, output, output);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonBehavior, json_behavior, on_empty, on_empty, on_empty);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonBehavior, json_behavior, on_error, on_error, on_error);
  READ_ENUM_FIELD(JsonWrapper, wrapper, wrapper, wrapper);
  READ_ENUM_FIELD(JsonQuotes, quotes, quotes, quotes);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonTablePathSpec *
_readJsonTablePathSpec(OUT_TYPE(JsonTablePathSpec, JsonTablePathSpec) msg)
{
  JsonTablePathSpec *node = makeNode(JsonTablePathSpec);
  READ_NODE_PTR_FIELD(string, string, string);
  READ_STRING_FIELD(name, name, name);
  READ_INT_FIELD(name_location, name_location, name_location);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonTable *
_readJsonTable(OUT_TYPE(JsonTable, JsonTable) msg)
{
  JsonTable *node = makeNode(JsonTable);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonValueExpr, json_value_expr, context_item, context_item, context_item);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonTablePathSpec, json_table_path_spec, pathspec, pathspec, pathspec);
  READ_LIST_FIELD(passing, passing, passing);
  READ_LIST_FIELD(columns, columns, columns);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonBehavior, json_behavior, on_error, on_error, on_error);
  READ_SPECIFIC_NODE_PTR_FIELD(Alias, alias, alias, alias, alias);
  READ_BOOL_FIELD(lateral, lateral, lateral);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonTableColumn *
_readJsonTableColumn(OUT_TYPE(JsonTableColumn, JsonTableColumn) msg)
{
  JsonTableColumn *node = makeNode(JsonTableColumn);
  READ_ENUM_FIELD(JsonTableColumnType, coltype, coltype, coltype);
  READ_STRING_FIELD(name, name, name);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, type_name, typeName, typeName);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonTablePathSpec, json_table_path_spec, pathspec, pathspec, pathspec);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonFormat, json_format, format, format, format);
  READ_ENUM_FIELD(JsonWrapper, wrapper, wrapper, wrapper);
  READ_ENUM_FIELD(JsonQuotes, quotes, quotes, quotes);
  READ_LIST_FIELD(columns, columns, columns);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonBehavior, json_behavior, on_empty, on_empty, on_empty);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonBehavior, json_behavior, on_error, on_error, on_error);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonKeyValue *
_readJsonKeyValue(OUT_TYPE(JsonKeyValue, JsonKeyValue) msg)
{
  JsonKeyValue *node = makeNode(JsonKeyValue);
  READ_ABSTRACT_PTR_FIELD(key, key, key, Expr*);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonValueExpr, json_value_expr, value, value, value);
  return node;
}

static JsonParseExpr *
_readJsonParseExpr(OUT_TYPE(JsonParseExpr, JsonParseExpr) msg)
{
  JsonParseExpr *node = makeNode(JsonParseExpr);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonValueExpr, json_value_expr, expr, expr, expr);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonOutput, json_output, output, output, output);
  READ_BOOL_FIELD(unique_keys, unique_keys, unique_keys);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonScalarExpr *
_readJsonScalarExpr(OUT_TYPE(JsonScalarExpr, JsonScalarExpr) msg)
{
  JsonScalarExpr *node = makeNode(JsonScalarExpr);
  READ_ABSTRACT_PTR_FIELD(expr, expr, expr, Expr*);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonOutput, json_output, output, output, output);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonSerializeExpr *
_readJsonSerializeExpr(OUT_TYPE(JsonSerializeExpr, JsonSerializeExpr) msg)
{
  JsonSerializeExpr *node = makeNode(JsonSerializeExpr);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonValueExpr, json_value_expr, expr, expr, expr);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonOutput, json_output, output, output, output);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonObjectConstructor *
_readJsonObjectConstructor(OUT_TYPE(JsonObjectConstructor, JsonObjectConstructor) msg)
{
  JsonObjectConstructor *node = makeNode(JsonObjectConstructor);
  READ_LIST_FIELD(exprs, exprs, exprs);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonOutput, json_output, output, output, output);
  READ_BOOL_FIELD(absent_on_null, absent_on_null, absent_on_null);
  READ_BOOL_FIELD(unique, unique, unique);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonArrayConstructor *
_readJsonArrayConstructor(OUT_TYPE(JsonArrayConstructor, JsonArrayConstructor) msg)
{
  JsonArrayConstructor *node = makeNode(JsonArrayConstructor);
  READ_LIST_FIELD(exprs, exprs, exprs);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonOutput, json_output, output, output, output);
  READ_BOOL_FIELD(absent_on_null, absent_on_null, absent_on_null);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonArrayQueryConstructor *
_readJsonArrayQueryConstructor(OUT_TYPE(JsonArrayQueryConstructor, JsonArrayQueryConstructor) msg)
{
  JsonArrayQueryConstructor *node = makeNode(JsonArrayQueryConstructor);
  READ_NODE_PTR_FIELD(query, query, query);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonOutput, json_output, output, output, output);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonFormat, json_format, format, format, format);
  READ_BOOL_FIELD(absent_on_null, absent_on_null, absent_on_null);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonAggConstructor *
_readJsonAggConstructor(OUT_TYPE(JsonAggConstructor, JsonAggConstructor) msg)
{
  JsonAggConstructor *node = makeNode(JsonAggConstructor);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonOutput, json_output, output, output, output);
  READ_NODE_PTR_FIELD(agg_filter, agg_filter, agg_filter);
  READ_LIST_FIELD(agg_order, agg_order, agg_order);
  READ_SPECIFIC_NODE_PTR_FIELD(WindowDef, window_def, over, over, over);
  READ_INT_FIELD(location, location, location);
  return node;
}

static JsonObjectAgg *
_readJsonObjectAgg(OUT_TYPE(JsonObjectAgg, JsonObjectAgg) msg)
{
  JsonObjectAgg *node = makeNode(JsonObjectAgg);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonAggConstructor, json_agg_constructor, constructor, constructor, constructor);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonKeyValue, json_key_value, arg, arg, arg);
  READ_BOOL_FIELD(absent_on_null, absent_on_null, absent_on_null);
  READ_BOOL_FIELD(unique, unique, unique);
  return node;
}

static JsonArrayAgg *
_readJsonArrayAgg(OUT_TYPE(JsonArrayAgg, JsonArrayAgg) msg)
{
  JsonArrayAgg *node = makeNode(JsonArrayAgg);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonAggConstructor, json_agg_constructor, constructor, constructor, constructor);
  READ_SPECIFIC_NODE_PTR_FIELD(JsonValueExpr, json_value_expr, arg, arg, arg);
  READ_BOOL_FIELD(absent_on_null, absent_on_null, absent_on_null);
  return node;
}

static RawStmt *
_readRawStmt(OUT_TYPE(RawStmt, RawStmt) msg)
{
  RawStmt *node = makeNode(RawStmt);
  READ_NODE_PTR_FIELD(stmt, stmt, stmt);
  READ_INT_FIELD(stmt_location, stmt_location, stmt_location);
  READ_INT_FIELD(stmt_len, stmt_len, stmt_len);
  return node;
}

static InsertStmt *
_readInsertStmt(OUT_TYPE(InsertStmt, InsertStmt) msg)
{
  InsertStmt *node = makeNode(InsertStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_LIST_FIELD(cols, cols, cols);
  READ_NODE_PTR_FIELD(select_stmt, selectStmt, selectStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(OnConflictClause, on_conflict_clause, on_conflict_clause, onConflictClause, onConflictClause);
  READ_LIST_FIELD(returning_list, returningList, returningList);
  READ_SPECIFIC_NODE_PTR_FIELD(WithClause, with_clause, with_clause, withClause, withClause);
  READ_ENUM_FIELD(OverridingKind, override, override, override);
  return node;
}

static DeleteStmt *
_readDeleteStmt(OUT_TYPE(DeleteStmt, DeleteStmt) msg)
{
  DeleteStmt *node = makeNode(DeleteStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_LIST_FIELD(using_clause, usingClause, usingClause);
  READ_NODE_PTR_FIELD(where_clause, whereClause, whereClause);
  READ_LIST_FIELD(returning_list, returningList, returningList);
  READ_SPECIFIC_NODE_PTR_FIELD(WithClause, with_clause, with_clause, withClause, withClause);
  return node;
}

static UpdateStmt *
_readUpdateStmt(OUT_TYPE(UpdateStmt, UpdateStmt) msg)
{
  UpdateStmt *node = makeNode(UpdateStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_LIST_FIELD(target_list, targetList, targetList);
  READ_NODE_PTR_FIELD(where_clause, whereClause, whereClause);
  READ_LIST_FIELD(from_clause, fromClause, fromClause);
  READ_LIST_FIELD(returning_list, returningList, returningList);
  READ_SPECIFIC_NODE_PTR_FIELD(WithClause, with_clause, with_clause, withClause, withClause);
  return node;
}

static MergeStmt *
_readMergeStmt(OUT_TYPE(MergeStmt, MergeStmt) msg)
{
  MergeStmt *node = makeNode(MergeStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_NODE_PTR_FIELD(source_relation, sourceRelation, sourceRelation);
  READ_NODE_PTR_FIELD(join_condition, joinCondition, joinCondition);
  READ_LIST_FIELD(merge_when_clauses, mergeWhenClauses, mergeWhenClauses);
  READ_LIST_FIELD(returning_list, returningList, returningList);
  READ_SPECIFIC_NODE_PTR_FIELD(WithClause, with_clause, with_clause, withClause, withClause);
  return node;
}

static SelectStmt *
_readSelectStmt(OUT_TYPE(SelectStmt, SelectStmt) msg)
{
  SelectStmt *node = makeNode(SelectStmt);
  READ_LIST_FIELD(distinct_clause, distinctClause, distinctClause);
  READ_SPECIFIC_NODE_PTR_FIELD(IntoClause, into_clause, into_clause, intoClause, intoClause);
  READ_LIST_FIELD(target_list, targetList, targetList);
  READ_LIST_FIELD(from_clause, fromClause, fromClause);
  READ_NODE_PTR_FIELD(where_clause, whereClause, whereClause);
  READ_LIST_FIELD(group_clause, groupClause, groupClause);
  READ_BOOL_FIELD(group_distinct, groupDistinct, groupDistinct);
  READ_NODE_PTR_FIELD(having_clause, havingClause, havingClause);
  READ_LIST_FIELD(window_clause, windowClause, windowClause);
  READ_LIST_FIELD(values_lists, valuesLists, valuesLists);
  READ_LIST_FIELD(sort_clause, sortClause, sortClause);
  READ_NODE_PTR_FIELD(limit_offset, limitOffset, limitOffset);
  READ_NODE_PTR_FIELD(limit_count, limitCount, limitCount);
  READ_ENUM_FIELD(LimitOption, limit_option, limitOption, limitOption);
  READ_LIST_FIELD(locking_clause, lockingClause, lockingClause);
  READ_SPECIFIC_NODE_PTR_FIELD(WithClause, with_clause, with_clause, withClause, withClause);
  READ_ENUM_FIELD(SetOperation, op, op, op);
  READ_BOOL_FIELD(all, all, all);
  READ_SPECIFIC_NODE_PTR_FIELD(SelectStmt, select_stmt, larg, larg, larg);
  READ_SPECIFIC_NODE_PTR_FIELD(SelectStmt, select_stmt, rarg, rarg, rarg);
  return node;
}

static SetOperationStmt *
_readSetOperationStmt(OUT_TYPE(SetOperationStmt, SetOperationStmt) msg)
{
  SetOperationStmt *node = makeNode(SetOperationStmt);
  READ_ENUM_FIELD(SetOperation, op, op, op);
  READ_BOOL_FIELD(all, all, all);
  READ_NODE_PTR_FIELD(larg, larg, larg);
  READ_NODE_PTR_FIELD(rarg, rarg, rarg);
  READ_LIST_FIELD(col_types, colTypes, colTypes);
  READ_LIST_FIELD(col_typmods, colTypmods, colTypmods);
  READ_LIST_FIELD(col_collations, colCollations, colCollations);
  READ_LIST_FIELD(group_clauses, groupClauses, groupClauses);
  return node;
}

static ReturnStmt *
_readReturnStmt(OUT_TYPE(ReturnStmt, ReturnStmt) msg)
{
  ReturnStmt *node = makeNode(ReturnStmt);
  READ_NODE_PTR_FIELD(returnval, returnval, returnval);
  return node;
}

static PLAssignStmt *
_readPLAssignStmt(OUT_TYPE(PLAssignStmt, PLAssignStmt) msg)
{
  PLAssignStmt *node = makeNode(PLAssignStmt);
  READ_STRING_FIELD(name, name, name);
  READ_LIST_FIELD(indirection, indirection, indirection);
  READ_INT_FIELD(nnames, nnames, nnames);
  READ_SPECIFIC_NODE_PTR_FIELD(SelectStmt, select_stmt, val, val, val);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CreateSchemaStmt *
_readCreateSchemaStmt(OUT_TYPE(CreateSchemaStmt, CreateSchemaStmt) msg)
{
  CreateSchemaStmt *node = makeNode(CreateSchemaStmt);
  READ_STRING_FIELD(schemaname, schemaname, schemaname);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, authrole, authrole, authrole);
  READ_LIST_FIELD(schema_elts, schemaElts, schemaElts);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  return node;
}

static AlterTableStmt *
_readAlterTableStmt(OUT_TYPE(AlterTableStmt, AlterTableStmt) msg)
{
  AlterTableStmt *node = makeNode(AlterTableStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_LIST_FIELD(cmds, cmds, cmds);
  READ_ENUM_FIELD(ObjectType, objtype, objtype, objtype);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static ReplicaIdentityStmt *
_readReplicaIdentityStmt(OUT_TYPE(ReplicaIdentityStmt, ReplicaIdentityStmt) msg)
{
  ReplicaIdentityStmt *node = makeNode(ReplicaIdentityStmt);
  READ_CHAR_FIELD(identity_type, identity_type, identity_type);
  READ_STRING_FIELD(name, name, name);
  return node;
}

static AlterTableCmd *
_readAlterTableCmd(OUT_TYPE(AlterTableCmd, AlterTableCmd) msg)
{
  AlterTableCmd *node = makeNode(AlterTableCmd);
  READ_ENUM_FIELD(AlterTableType, subtype, subtype, subtype);
  READ_STRING_FIELD(name, name, name);
  READ_INT_FIELD(num, num, num);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, newowner, newowner, newowner);
  READ_NODE_PTR_FIELD(def, def, def);
  READ_ENUM_FIELD(DropBehavior, behavior, behavior, behavior);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  READ_BOOL_FIELD(recurse, recurse, recurse);
  return node;
}

static AlterCollationStmt *
_readAlterCollationStmt(OUT_TYPE(AlterCollationStmt, AlterCollationStmt) msg)
{
  AlterCollationStmt *node = makeNode(AlterCollationStmt);
  READ_LIST_FIELD(collname, collname, collname);
  return node;
}

static AlterDomainStmt *
_readAlterDomainStmt(OUT_TYPE(AlterDomainStmt, AlterDomainStmt) msg)
{
  AlterDomainStmt *node = makeNode(AlterDomainStmt);
  READ_CHAR_FIELD(subtype, subtype, subtype);
  READ_LIST_FIELD(type_name, typeName, typeName);
  READ_STRING_FIELD(name, name, name);
  READ_NODE_PTR_FIELD(def, def, def);
  READ_ENUM_FIELD(DropBehavior, behavior, behavior, behavior);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static GrantStmt *
_readGrantStmt(OUT_TYPE(GrantStmt, GrantStmt) msg)
{
  GrantStmt *node = makeNode(GrantStmt);
  READ_BOOL_FIELD(is_grant, is_grant, is_grant);
  READ_ENUM_FIELD(GrantTargetType, targtype, targtype, targtype);
  READ_ENUM_FIELD(ObjectType, objtype, objtype, objtype);
  READ_LIST_FIELD(objects, objects, objects);
  READ_LIST_FIELD(privileges, privileges, privileges);
  READ_LIST_FIELD(grantees, grantees, grantees);
  READ_BOOL_FIELD(grant_option, grant_option, grant_option);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, grantor, grantor, grantor);
  READ_ENUM_FIELD(DropBehavior, behavior, behavior, behavior);
  return node;
}

static ObjectWithArgs *
_readObjectWithArgs(OUT_TYPE(ObjectWithArgs, ObjectWithArgs) msg)
{
  ObjectWithArgs *node = makeNode(ObjectWithArgs);
  READ_LIST_FIELD(objname, objname, objname);
  READ_LIST_FIELD(objargs, objargs, objargs);
  READ_LIST_FIELD(objfuncargs, objfuncargs, objfuncargs);
  READ_BOOL_FIELD(args_unspecified, args_unspecified, args_unspecified);
  return node;
}

static AccessPriv *
_readAccessPriv(OUT_TYPE(AccessPriv, AccessPriv) msg)
{
  AccessPriv *node = makeNode(AccessPriv);
  READ_STRING_FIELD(priv_name, priv_name, priv_name);
  READ_LIST_FIELD(cols, cols, cols);
  return node;
}

static GrantRoleStmt *
_readGrantRoleStmt(OUT_TYPE(GrantRoleStmt, GrantRoleStmt) msg)
{
  GrantRoleStmt *node = makeNode(GrantRoleStmt);
  READ_LIST_FIELD(granted_roles, granted_roles, granted_roles);
  READ_LIST_FIELD(grantee_roles, grantee_roles, grantee_roles);
  READ_BOOL_FIELD(is_grant, is_grant, is_grant);
  READ_LIST_FIELD(opt, opt, opt);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, grantor, grantor, grantor);
  READ_ENUM_FIELD(DropBehavior, behavior, behavior, behavior);
  return node;
}

static AlterDefaultPrivilegesStmt *
_readAlterDefaultPrivilegesStmt(OUT_TYPE(AlterDefaultPrivilegesStmt, AlterDefaultPrivilegesStmt) msg)
{
  AlterDefaultPrivilegesStmt *node = makeNode(AlterDefaultPrivilegesStmt);
  READ_LIST_FIELD(options, options, options);
  READ_SPECIFIC_NODE_PTR_FIELD(GrantStmt, grant_stmt, action, action, action);
  return node;
}

static CopyStmt *
_readCopyStmt(OUT_TYPE(CopyStmt, CopyStmt) msg)
{
  CopyStmt *node = makeNode(CopyStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_NODE_PTR_FIELD(query, query, query);
  READ_LIST_FIELD(attlist, attlist, attlist);
  READ_BOOL_FIELD(is_from, is_from, is_from);
  READ_BOOL_FIELD(is_program, is_program, is_program);
  READ_STRING_FIELD(filename, filename, filename);
  READ_LIST_FIELD(options, options, options);
  READ_NODE_PTR_FIELD(where_clause, whereClause, whereClause);
  return node;
}

static VariableSetStmt *
_readVariableSetStmt(OUT_TYPE(VariableSetStmt, VariableSetStmt) msg)
{
  VariableSetStmt *node = makeNode(VariableSetStmt);
  READ_ENUM_FIELD(VariableSetKind, kind, kind, kind);
  READ_STRING_FIELD(name, name, name);
  READ_LIST_FIELD(args, args, args);
  READ_BOOL_FIELD(is_local, is_local, is_local);
  return node;
}

static VariableShowStmt *
_readVariableShowStmt(OUT_TYPE(VariableShowStmt, VariableShowStmt) msg)
{
  VariableShowStmt *node = makeNode(VariableShowStmt);
  READ_STRING_FIELD(name, name, name);
  return node;
}

static CreateStmt *
_readCreateStmt(OUT_TYPE(CreateStmt, CreateStmt) msg)
{
  CreateStmt *node = makeNode(CreateStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_LIST_FIELD(table_elts, tableElts, tableElts);
  READ_LIST_FIELD(inh_relations, inhRelations, inhRelations);
  READ_SPECIFIC_NODE_PTR_FIELD(PartitionBoundSpec, partition_bound_spec, partbound, partbound, partbound);
  READ_SPECIFIC_NODE_PTR_FIELD(PartitionSpec, partition_spec, partspec, partspec, partspec);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, of_typename, ofTypename, ofTypename);
  READ_LIST_FIELD(constraints, constraints, constraints);
  READ_LIST_FIELD(options, options, options);
  READ_ENUM_FIELD(OnCommitAction, oncommit, oncommit, oncommit);
  READ_STRING_FIELD(tablespacename, tablespacename, tablespacename);
  READ_STRING_FIELD(access_method, accessMethod, accessMethod);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  return node;
}

static Constraint *
_readConstraint(OUT_TYPE(Constraint, Constraint) msg)
{
  Constraint *node = makeNode(Constraint);
  READ_ENUM_FIELD(ConstrType, contype, contype, contype);
  READ_STRING_FIELD(conname, conname, conname);
  READ_BOOL_FIELD(deferrable, deferrable, deferrable);
  READ_BOOL_FIELD(initdeferred, initdeferred, initdeferred);
  READ_BOOL_FIELD(skip_validation, skip_validation, skip_validation);
  READ_BOOL_FIELD(initially_valid, initially_valid, initially_valid);
  READ_BOOL_FIELD(is_no_inherit, is_no_inherit, is_no_inherit);
  READ_NODE_PTR_FIELD(raw_expr, raw_expr, raw_expr);
  READ_STRING_FIELD(cooked_expr, cooked_expr, cooked_expr);
  READ_CHAR_FIELD(generated_when, generated_when, generated_when);
  READ_INT_FIELD(inhcount, inhcount, inhcount);
  READ_BOOL_FIELD(nulls_not_distinct, nulls_not_distinct, nulls_not_distinct);
  READ_LIST_FIELD(keys, keys, keys);
  READ_LIST_FIELD(including, including, including);
  READ_LIST_FIELD(exclusions, exclusions, exclusions);
  READ_LIST_FIELD(options, options, options);
  READ_STRING_FIELD(indexname, indexname, indexname);
  READ_STRING_FIELD(indexspace, indexspace, indexspace);
  READ_BOOL_FIELD(reset_default_tblspc, reset_default_tblspc, reset_default_tblspc);
  READ_STRING_FIELD(access_method, access_method, access_method);
  READ_NODE_PTR_FIELD(where_clause, where_clause, where_clause);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, pktable, pktable, pktable);
  READ_LIST_FIELD(fk_attrs, fk_attrs, fk_attrs);
  READ_LIST_FIELD(pk_attrs, pk_attrs, pk_attrs);
  READ_CHAR_FIELD(fk_matchtype, fk_matchtype, fk_matchtype);
  READ_CHAR_FIELD(fk_upd_action, fk_upd_action, fk_upd_action);
  READ_CHAR_FIELD(fk_del_action, fk_del_action, fk_del_action);
  READ_LIST_FIELD(fk_del_set_cols, fk_del_set_cols, fk_del_set_cols);
  READ_LIST_FIELD(old_conpfeqop, old_conpfeqop, old_conpfeqop);
  READ_UINT_FIELD(old_pktable_oid, old_pktable_oid, old_pktable_oid);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CreateTableSpaceStmt *
_readCreateTableSpaceStmt(OUT_TYPE(CreateTableSpaceStmt, CreateTableSpaceStmt) msg)
{
  CreateTableSpaceStmt *node = makeNode(CreateTableSpaceStmt);
  READ_STRING_FIELD(tablespacename, tablespacename, tablespacename);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, owner, owner, owner);
  READ_STRING_FIELD(location, location, location);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static DropTableSpaceStmt *
_readDropTableSpaceStmt(OUT_TYPE(DropTableSpaceStmt, DropTableSpaceStmt) msg)
{
  DropTableSpaceStmt *node = makeNode(DropTableSpaceStmt);
  READ_STRING_FIELD(tablespacename, tablespacename, tablespacename);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static AlterTableSpaceOptionsStmt *
_readAlterTableSpaceOptionsStmt(OUT_TYPE(AlterTableSpaceOptionsStmt, AlterTableSpaceOptionsStmt) msg)
{
  AlterTableSpaceOptionsStmt *node = makeNode(AlterTableSpaceOptionsStmt);
  READ_STRING_FIELD(tablespacename, tablespacename, tablespacename);
  READ_LIST_FIELD(options, options, options);
  READ_BOOL_FIELD(is_reset, isReset, isReset);
  return node;
}

static AlterTableMoveAllStmt *
_readAlterTableMoveAllStmt(OUT_TYPE(AlterTableMoveAllStmt, AlterTableMoveAllStmt) msg)
{
  AlterTableMoveAllStmt *node = makeNode(AlterTableMoveAllStmt);
  READ_STRING_FIELD(orig_tablespacename, orig_tablespacename, orig_tablespacename);
  READ_ENUM_FIELD(ObjectType, objtype, objtype, objtype);
  READ_LIST_FIELD(roles, roles, roles);
  READ_STRING_FIELD(new_tablespacename, new_tablespacename, new_tablespacename);
  READ_BOOL_FIELD(nowait, nowait, nowait);
  return node;
}

static CreateExtensionStmt *
_readCreateExtensionStmt(OUT_TYPE(CreateExtensionStmt, CreateExtensionStmt) msg)
{
  CreateExtensionStmt *node = makeNode(CreateExtensionStmt);
  READ_STRING_FIELD(extname, extname, extname);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterExtensionStmt *
_readAlterExtensionStmt(OUT_TYPE(AlterExtensionStmt, AlterExtensionStmt) msg)
{
  AlterExtensionStmt *node = makeNode(AlterExtensionStmt);
  READ_STRING_FIELD(extname, extname, extname);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterExtensionContentsStmt *
_readAlterExtensionContentsStmt(OUT_TYPE(AlterExtensionContentsStmt, AlterExtensionContentsStmt) msg)
{
  AlterExtensionContentsStmt *node = makeNode(AlterExtensionContentsStmt);
  READ_STRING_FIELD(extname, extname, extname);
  READ_INT_FIELD(action, action, action);
  READ_ENUM_FIELD(ObjectType, objtype, objtype, objtype);
  READ_NODE_PTR_FIELD(object, object, object);
  return node;
}

static CreateFdwStmt *
_readCreateFdwStmt(OUT_TYPE(CreateFdwStmt, CreateFdwStmt) msg)
{
  CreateFdwStmt *node = makeNode(CreateFdwStmt);
  READ_STRING_FIELD(fdwname, fdwname, fdwname);
  READ_LIST_FIELD(func_options, func_options, func_options);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterFdwStmt *
_readAlterFdwStmt(OUT_TYPE(AlterFdwStmt, AlterFdwStmt) msg)
{
  AlterFdwStmt *node = makeNode(AlterFdwStmt);
  READ_STRING_FIELD(fdwname, fdwname, fdwname);
  READ_LIST_FIELD(func_options, func_options, func_options);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static CreateForeignServerStmt *
_readCreateForeignServerStmt(OUT_TYPE(CreateForeignServerStmt, CreateForeignServerStmt) msg)
{
  CreateForeignServerStmt *node = makeNode(CreateForeignServerStmt);
  READ_STRING_FIELD(servername, servername, servername);
  READ_STRING_FIELD(servertype, servertype, servertype);
  READ_STRING_FIELD(version, version, version);
  READ_STRING_FIELD(fdwname, fdwname, fdwname);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterForeignServerStmt *
_readAlterForeignServerStmt(OUT_TYPE(AlterForeignServerStmt, AlterForeignServerStmt) msg)
{
  AlterForeignServerStmt *node = makeNode(AlterForeignServerStmt);
  READ_STRING_FIELD(servername, servername, servername);
  READ_STRING_FIELD(version, version, version);
  READ_LIST_FIELD(options, options, options);
  READ_BOOL_FIELD(has_version, has_version, has_version);
  return node;
}

static CreateForeignTableStmt *
_readCreateForeignTableStmt(OUT_TYPE(CreateForeignTableStmt, CreateForeignTableStmt) msg)
{
  CreateForeignTableStmt *node = makeNode(CreateForeignTableStmt);
  READ_SPECIFIC_NODE_FIELD(CreateStmt, create_stmt, base_stmt, base, base);
  READ_STRING_FIELD(servername, servername, servername);
  READ_LIST_FIELD(options, options, options);
  NodeSetTag(node, T_CreateForeignTableStmt);
  return node;
}

static CreateUserMappingStmt *
_readCreateUserMappingStmt(OUT_TYPE(CreateUserMappingStmt, CreateUserMappingStmt) msg)
{
  CreateUserMappingStmt *node = makeNode(CreateUserMappingStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, user, user, user);
  READ_STRING_FIELD(servername, servername, servername);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterUserMappingStmt *
_readAlterUserMappingStmt(OUT_TYPE(AlterUserMappingStmt, AlterUserMappingStmt) msg)
{
  AlterUserMappingStmt *node = makeNode(AlterUserMappingStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, user, user, user);
  READ_STRING_FIELD(servername, servername, servername);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static DropUserMappingStmt *
_readDropUserMappingStmt(OUT_TYPE(DropUserMappingStmt, DropUserMappingStmt) msg)
{
  DropUserMappingStmt *node = makeNode(DropUserMappingStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, user, user, user);
  READ_STRING_FIELD(servername, servername, servername);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static ImportForeignSchemaStmt *
_readImportForeignSchemaStmt(OUT_TYPE(ImportForeignSchemaStmt, ImportForeignSchemaStmt) msg)
{
  ImportForeignSchemaStmt *node = makeNode(ImportForeignSchemaStmt);
  READ_STRING_FIELD(server_name, server_name, server_name);
  READ_STRING_FIELD(remote_schema, remote_schema, remote_schema);
  READ_STRING_FIELD(local_schema, local_schema, local_schema);
  READ_ENUM_FIELD(ImportForeignSchemaType, list_type, list_type, list_type);
  READ_LIST_FIELD(table_list, table_list, table_list);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static CreatePolicyStmt *
_readCreatePolicyStmt(OUT_TYPE(CreatePolicyStmt, CreatePolicyStmt) msg)
{
  CreatePolicyStmt *node = makeNode(CreatePolicyStmt);
  READ_STRING_FIELD(policy_name, policy_name, policy_name);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, table, table, table);
  READ_STRING_FIELD(cmd_name, cmd_name, cmd_name);
  READ_BOOL_FIELD(permissive, permissive, permissive);
  READ_LIST_FIELD(roles, roles, roles);
  READ_NODE_PTR_FIELD(qual, qual, qual);
  READ_NODE_PTR_FIELD(with_check, with_check, with_check);
  return node;
}

static AlterPolicyStmt *
_readAlterPolicyStmt(OUT_TYPE(AlterPolicyStmt, AlterPolicyStmt) msg)
{
  AlterPolicyStmt *node = makeNode(AlterPolicyStmt);
  READ_STRING_FIELD(policy_name, policy_name, policy_name);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, table, table, table);
  READ_LIST_FIELD(roles, roles, roles);
  READ_NODE_PTR_FIELD(qual, qual, qual);
  READ_NODE_PTR_FIELD(with_check, with_check, with_check);
  return node;
}

static CreateAmStmt *
_readCreateAmStmt(OUT_TYPE(CreateAmStmt, CreateAmStmt) msg)
{
  CreateAmStmt *node = makeNode(CreateAmStmt);
  READ_STRING_FIELD(amname, amname, amname);
  READ_LIST_FIELD(handler_name, handler_name, handler_name);
  READ_CHAR_FIELD(amtype, amtype, amtype);
  return node;
}

static CreateTrigStmt *
_readCreateTrigStmt(OUT_TYPE(CreateTrigStmt, CreateTrigStmt) msg)
{
  CreateTrigStmt *node = makeNode(CreateTrigStmt);
  READ_BOOL_FIELD(replace, replace, replace);
  READ_BOOL_FIELD(isconstraint, isconstraint, isconstraint);
  READ_STRING_FIELD(trigname, trigname, trigname);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_LIST_FIELD(funcname, funcname, funcname);
  READ_LIST_FIELD(args, args, args);
  READ_BOOL_FIELD(row, row, row);
  READ_INT_FIELD(timing, timing, timing);
  READ_INT_FIELD(events, events, events);
  READ_LIST_FIELD(columns, columns, columns);
  READ_NODE_PTR_FIELD(when_clause, whenClause, whenClause);
  READ_LIST_FIELD(transition_rels, transitionRels, transitionRels);
  READ_BOOL_FIELD(deferrable, deferrable, deferrable);
  READ_BOOL_FIELD(initdeferred, initdeferred, initdeferred);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, constrrel, constrrel, constrrel);
  return node;
}

static CreateEventTrigStmt *
_readCreateEventTrigStmt(OUT_TYPE(CreateEventTrigStmt, CreateEventTrigStmt) msg)
{
  CreateEventTrigStmt *node = makeNode(CreateEventTrigStmt);
  READ_STRING_FIELD(trigname, trigname, trigname);
  READ_STRING_FIELD(eventname, eventname, eventname);
  READ_LIST_FIELD(whenclause, whenclause, whenclause);
  READ_LIST_FIELD(funcname, funcname, funcname);
  return node;
}

static AlterEventTrigStmt *
_readAlterEventTrigStmt(OUT_TYPE(AlterEventTrigStmt, AlterEventTrigStmt) msg)
{
  AlterEventTrigStmt *node = makeNode(AlterEventTrigStmt);
  READ_STRING_FIELD(trigname, trigname, trigname);
  READ_CHAR_FIELD(tgenabled, tgenabled, tgenabled);
  return node;
}

static CreatePLangStmt *
_readCreatePLangStmt(OUT_TYPE(CreatePLangStmt, CreatePLangStmt) msg)
{
  CreatePLangStmt *node = makeNode(CreatePLangStmt);
  READ_BOOL_FIELD(replace, replace, replace);
  READ_STRING_FIELD(plname, plname, plname);
  READ_LIST_FIELD(plhandler, plhandler, plhandler);
  READ_LIST_FIELD(plinline, plinline, plinline);
  READ_LIST_FIELD(plvalidator, plvalidator, plvalidator);
  READ_BOOL_FIELD(pltrusted, pltrusted, pltrusted);
  return node;
}

static CreateRoleStmt *
_readCreateRoleStmt(OUT_TYPE(CreateRoleStmt, CreateRoleStmt) msg)
{
  CreateRoleStmt *node = makeNode(CreateRoleStmt);
  READ_ENUM_FIELD(RoleStmtType, stmt_type, stmt_type, stmt_type);
  READ_STRING_FIELD(role, role, role);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterRoleStmt *
_readAlterRoleStmt(OUT_TYPE(AlterRoleStmt, AlterRoleStmt) msg)
{
  AlterRoleStmt *node = makeNode(AlterRoleStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, role, role, role);
  READ_LIST_FIELD(options, options, options);
  READ_INT_FIELD(action, action, action);
  return node;
}

static AlterRoleSetStmt *
_readAlterRoleSetStmt(OUT_TYPE(AlterRoleSetStmt, AlterRoleSetStmt) msg)
{
  AlterRoleSetStmt *node = makeNode(AlterRoleSetStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, role, role, role);
  READ_STRING_FIELD(database, database, database);
  READ_SPECIFIC_NODE_PTR_FIELD(VariableSetStmt, variable_set_stmt, setstmt, setstmt, setstmt);
  return node;
}

static DropRoleStmt *
_readDropRoleStmt(OUT_TYPE(DropRoleStmt, DropRoleStmt) msg)
{
  DropRoleStmt *node = makeNode(DropRoleStmt);
  READ_LIST_FIELD(roles, roles, roles);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static CreateSeqStmt *
_readCreateSeqStmt(OUT_TYPE(CreateSeqStmt, CreateSeqStmt) msg)
{
  CreateSeqStmt *node = makeNode(CreateSeqStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, sequence, sequence, sequence);
  READ_LIST_FIELD(options, options, options);
  READ_UINT_FIELD(owner_id, ownerId, ownerId);
  READ_BOOL_FIELD(for_identity, for_identity, for_identity);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  return node;
}

static AlterSeqStmt *
_readAlterSeqStmt(OUT_TYPE(AlterSeqStmt, AlterSeqStmt) msg)
{
  AlterSeqStmt *node = makeNode(AlterSeqStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, sequence, sequence, sequence);
  READ_LIST_FIELD(options, options, options);
  READ_BOOL_FIELD(for_identity, for_identity, for_identity);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static DefineStmt *
_readDefineStmt(OUT_TYPE(DefineStmt, DefineStmt) msg)
{
  DefineStmt *node = makeNode(DefineStmt);
  READ_ENUM_FIELD(ObjectType, kind, kind, kind);
  READ_BOOL_FIELD(oldstyle, oldstyle, oldstyle);
  READ_LIST_FIELD(defnames, defnames, defnames);
  READ_LIST_FIELD(args, args, args);
  READ_LIST_FIELD(definition, definition, definition);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  READ_BOOL_FIELD(replace, replace, replace);
  return node;
}

static CreateDomainStmt *
_readCreateDomainStmt(OUT_TYPE(CreateDomainStmt, CreateDomainStmt) msg)
{
  CreateDomainStmt *node = makeNode(CreateDomainStmt);
  READ_LIST_FIELD(domainname, domainname, domainname);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, type_name, typeName, typeName);
  READ_SPECIFIC_NODE_PTR_FIELD(CollateClause, collate_clause, coll_clause, collClause, collClause);
  READ_LIST_FIELD(constraints, constraints, constraints);
  return node;
}

static CreateOpClassStmt *
_readCreateOpClassStmt(OUT_TYPE(CreateOpClassStmt, CreateOpClassStmt) msg)
{
  CreateOpClassStmt *node = makeNode(CreateOpClassStmt);
  READ_LIST_FIELD(opclassname, opclassname, opclassname);
  READ_LIST_FIELD(opfamilyname, opfamilyname, opfamilyname);
  READ_STRING_FIELD(amname, amname, amname);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, datatype, datatype, datatype);
  READ_LIST_FIELD(items, items, items);
  READ_BOOL_FIELD(is_default, isDefault, isDefault);
  return node;
}

static CreateOpClassItem *
_readCreateOpClassItem(OUT_TYPE(CreateOpClassItem, CreateOpClassItem) msg)
{
  CreateOpClassItem *node = makeNode(CreateOpClassItem);
  READ_INT_FIELD(itemtype, itemtype, itemtype);
  READ_SPECIFIC_NODE_PTR_FIELD(ObjectWithArgs, object_with_args, name, name, name);
  READ_INT_FIELD(number, number, number);
  READ_LIST_FIELD(order_family, order_family, order_family);
  READ_LIST_FIELD(class_args, class_args, class_args);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, storedtype, storedtype, storedtype);
  return node;
}

static CreateOpFamilyStmt *
_readCreateOpFamilyStmt(OUT_TYPE(CreateOpFamilyStmt, CreateOpFamilyStmt) msg)
{
  CreateOpFamilyStmt *node = makeNode(CreateOpFamilyStmt);
  READ_LIST_FIELD(opfamilyname, opfamilyname, opfamilyname);
  READ_STRING_FIELD(amname, amname, amname);
  return node;
}

static AlterOpFamilyStmt *
_readAlterOpFamilyStmt(OUT_TYPE(AlterOpFamilyStmt, AlterOpFamilyStmt) msg)
{
  AlterOpFamilyStmt *node = makeNode(AlterOpFamilyStmt);
  READ_LIST_FIELD(opfamilyname, opfamilyname, opfamilyname);
  READ_STRING_FIELD(amname, amname, amname);
  READ_BOOL_FIELD(is_drop, isDrop, isDrop);
  READ_LIST_FIELD(items, items, items);
  return node;
}

static DropStmt *
_readDropStmt(OUT_TYPE(DropStmt, DropStmt) msg)
{
  DropStmt *node = makeNode(DropStmt);
  READ_LIST_FIELD(objects, objects, objects);
  READ_ENUM_FIELD(ObjectType, remove_type, removeType, removeType);
  READ_ENUM_FIELD(DropBehavior, behavior, behavior, behavior);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  READ_BOOL_FIELD(concurrent, concurrent, concurrent);
  return node;
}

static TruncateStmt *
_readTruncateStmt(OUT_TYPE(TruncateStmt, TruncateStmt) msg)
{
  TruncateStmt *node = makeNode(TruncateStmt);
  READ_LIST_FIELD(relations, relations, relations);
  READ_BOOL_FIELD(restart_seqs, restart_seqs, restart_seqs);
  READ_ENUM_FIELD(DropBehavior, behavior, behavior, behavior);
  return node;
}

static CommentStmt *
_readCommentStmt(OUT_TYPE(CommentStmt, CommentStmt) msg)
{
  CommentStmt *node = makeNode(CommentStmt);
  READ_ENUM_FIELD(ObjectType, objtype, objtype, objtype);
  READ_NODE_PTR_FIELD(object, object, object);
  READ_STRING_FIELD(comment, comment, comment);
  return node;
}

static SecLabelStmt *
_readSecLabelStmt(OUT_TYPE(SecLabelStmt, SecLabelStmt) msg)
{
  SecLabelStmt *node = makeNode(SecLabelStmt);
  READ_ENUM_FIELD(ObjectType, objtype, objtype, objtype);
  READ_NODE_PTR_FIELD(object, object, object);
  READ_STRING_FIELD(provider, provider, provider);
  READ_STRING_FIELD(label, label, label);
  return node;
}

static DeclareCursorStmt *
_readDeclareCursorStmt(OUT_TYPE(DeclareCursorStmt, DeclareCursorStmt) msg)
{
  DeclareCursorStmt *node = makeNode(DeclareCursorStmt);
  READ_STRING_FIELD(portalname, portalname, portalname);
  READ_INT_FIELD(options, options, options);
  READ_NODE_PTR_FIELD(query, query, query);
  return node;
}

static ClosePortalStmt *
_readClosePortalStmt(OUT_TYPE(ClosePortalStmt, ClosePortalStmt) msg)
{
  ClosePortalStmt *node = makeNode(ClosePortalStmt);
  READ_STRING_FIELD(portalname, portalname, portalname);
  return node;
}

static FetchStmt *
_readFetchStmt(OUT_TYPE(FetchStmt, FetchStmt) msg)
{
  FetchStmt *node = makeNode(FetchStmt);
  READ_ENUM_FIELD(FetchDirection, direction, direction, direction);
  READ_LONG_FIELD(how_many, howMany, howMany);
  READ_STRING_FIELD(portalname, portalname, portalname);
  READ_BOOL_FIELD(ismove, ismove, ismove);
  return node;
}

static IndexStmt *
_readIndexStmt(OUT_TYPE(IndexStmt, IndexStmt) msg)
{
  IndexStmt *node = makeNode(IndexStmt);
  READ_STRING_FIELD(idxname, idxname, idxname);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_STRING_FIELD(access_method, accessMethod, accessMethod);
  READ_STRING_FIELD(table_space, tableSpace, tableSpace);
  READ_LIST_FIELD(index_params, indexParams, indexParams);
  READ_LIST_FIELD(index_including_params, indexIncludingParams, indexIncludingParams);
  READ_LIST_FIELD(options, options, options);
  READ_NODE_PTR_FIELD(where_clause, whereClause, whereClause);
  READ_LIST_FIELD(exclude_op_names, excludeOpNames, excludeOpNames);
  READ_STRING_FIELD(idxcomment, idxcomment, idxcomment);
  READ_UINT_FIELD(index_oid, indexOid, indexOid);
  READ_UINT_FIELD(old_number, oldNumber, oldNumber);
  READ_UINT_FIELD(old_create_subid, oldCreateSubid, oldCreateSubid);
  READ_UINT_FIELD(old_first_relfilelocator_subid, oldFirstRelfilelocatorSubid, oldFirstRelfilelocatorSubid);
  READ_BOOL_FIELD(unique, unique, unique);
  READ_BOOL_FIELD(nulls_not_distinct, nulls_not_distinct, nulls_not_distinct);
  READ_BOOL_FIELD(primary, primary, primary);
  READ_BOOL_FIELD(isconstraint, isconstraint, isconstraint);
  READ_BOOL_FIELD(deferrable, deferrable, deferrable);
  READ_BOOL_FIELD(initdeferred, initdeferred, initdeferred);
  READ_BOOL_FIELD(transformed, transformed, transformed);
  READ_BOOL_FIELD(concurrent, concurrent, concurrent);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  READ_BOOL_FIELD(reset_default_tblspc, reset_default_tblspc, reset_default_tblspc);
  return node;
}

static CreateStatsStmt *
_readCreateStatsStmt(OUT_TYPE(CreateStatsStmt, CreateStatsStmt) msg)
{
  CreateStatsStmt *node = makeNode(CreateStatsStmt);
  READ_LIST_FIELD(defnames, defnames, defnames);
  READ_LIST_FIELD(stat_types, stat_types, stat_types);
  READ_LIST_FIELD(exprs, exprs, exprs);
  READ_LIST_FIELD(relations, relations, relations);
  READ_STRING_FIELD(stxcomment, stxcomment, stxcomment);
  READ_BOOL_FIELD(transformed, transformed, transformed);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  return node;
}

static StatsElem *
_readStatsElem(OUT_TYPE(StatsElem, StatsElem) msg)
{
  StatsElem *node = makeNode(StatsElem);
  READ_STRING_FIELD(name, name, name);
  READ_NODE_PTR_FIELD(expr, expr, expr);
  return node;
}

static AlterStatsStmt *
_readAlterStatsStmt(OUT_TYPE(AlterStatsStmt, AlterStatsStmt) msg)
{
  AlterStatsStmt *node = makeNode(AlterStatsStmt);
  READ_LIST_FIELD(defnames, defnames, defnames);
  READ_NODE_PTR_FIELD(stxstattarget, stxstattarget, stxstattarget);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static CreateFunctionStmt *
_readCreateFunctionStmt(OUT_TYPE(CreateFunctionStmt, CreateFunctionStmt) msg)
{
  CreateFunctionStmt *node = makeNode(CreateFunctionStmt);
  READ_BOOL_FIELD(is_procedure, is_procedure, is_procedure);
  READ_BOOL_FIELD(replace, replace, replace);
  READ_LIST_FIELD(funcname, funcname, funcname);
  READ_LIST_FIELD(parameters, parameters, parameters);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, return_type, returnType, returnType);
  READ_LIST_FIELD(options, options, options);
  READ_NODE_PTR_FIELD(sql_body, sql_body, sql_body);
  return node;
}

static FunctionParameter *
_readFunctionParameter(OUT_TYPE(FunctionParameter, FunctionParameter) msg)
{
  FunctionParameter *node = makeNode(FunctionParameter);
  READ_STRING_FIELD(name, name, name);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, arg_type, argType, argType);
  READ_ENUM_FIELD(FunctionParameterMode, mode, mode, mode);
  READ_NODE_PTR_FIELD(defexpr, defexpr, defexpr);
  return node;
}

static AlterFunctionStmt *
_readAlterFunctionStmt(OUT_TYPE(AlterFunctionStmt, AlterFunctionStmt) msg)
{
  AlterFunctionStmt *node = makeNode(AlterFunctionStmt);
  READ_ENUM_FIELD(ObjectType, objtype, objtype, objtype);
  READ_SPECIFIC_NODE_PTR_FIELD(ObjectWithArgs, object_with_args, func, func, func);
  READ_LIST_FIELD(actions, actions, actions);
  return node;
}

static DoStmt *
_readDoStmt(OUT_TYPE(DoStmt, DoStmt) msg)
{
  DoStmt *node = makeNode(DoStmt);
  READ_LIST_FIELD(args, args, args);
  return node;
}

static InlineCodeBlock *
_readInlineCodeBlock(OUT_TYPE(InlineCodeBlock, InlineCodeBlock) msg)
{
  InlineCodeBlock *node = makeNode(InlineCodeBlock);
  READ_STRING_FIELD(source_text, source_text, source_text);
  READ_UINT_FIELD(lang_oid, langOid, langOid);
  READ_BOOL_FIELD(lang_is_trusted, langIsTrusted, langIsTrusted);
  READ_BOOL_FIELD(atomic, atomic, atomic);
  return node;
}

static CallStmt *
_readCallStmt(OUT_TYPE(CallStmt, CallStmt) msg)
{
  CallStmt *node = makeNode(CallStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(FuncCall, func_call, funccall, funccall, funccall);
  READ_SPECIFIC_NODE_PTR_FIELD(FuncExpr, func_expr, funcexpr, funcexpr, funcexpr);
  READ_LIST_FIELD(outargs, outargs, outargs);
  return node;
}

static CallContext *
_readCallContext(OUT_TYPE(CallContext, CallContext) msg)
{
  CallContext *node = makeNode(CallContext);
  READ_BOOL_FIELD(atomic, atomic, atomic);
  return node;
}

static RenameStmt *
_readRenameStmt(OUT_TYPE(RenameStmt, RenameStmt) msg)
{
  RenameStmt *node = makeNode(RenameStmt);
  READ_ENUM_FIELD(ObjectType, rename_type, renameType, renameType);
  READ_ENUM_FIELD(ObjectType, relation_type, relationType, relationType);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_NODE_PTR_FIELD(object, object, object);
  READ_STRING_FIELD(subname, subname, subname);
  READ_STRING_FIELD(newname, newname, newname);
  READ_ENUM_FIELD(DropBehavior, behavior, behavior, behavior);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static AlterObjectDependsStmt *
_readAlterObjectDependsStmt(OUT_TYPE(AlterObjectDependsStmt, AlterObjectDependsStmt) msg)
{
  AlterObjectDependsStmt *node = makeNode(AlterObjectDependsStmt);
  READ_ENUM_FIELD(ObjectType, object_type, objectType, objectType);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_NODE_PTR_FIELD(object, object, object);
  READ_SPECIFIC_NODE_PTR_FIELD(String, string, extname, extname, extname);
  READ_BOOL_FIELD(remove, remove, remove);
  return node;
}

static AlterObjectSchemaStmt *
_readAlterObjectSchemaStmt(OUT_TYPE(AlterObjectSchemaStmt, AlterObjectSchemaStmt) msg)
{
  AlterObjectSchemaStmt *node = makeNode(AlterObjectSchemaStmt);
  READ_ENUM_FIELD(ObjectType, object_type, objectType, objectType);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_NODE_PTR_FIELD(object, object, object);
  READ_STRING_FIELD(newschema, newschema, newschema);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static AlterOwnerStmt *
_readAlterOwnerStmt(OUT_TYPE(AlterOwnerStmt, AlterOwnerStmt) msg)
{
  AlterOwnerStmt *node = makeNode(AlterOwnerStmt);
  READ_ENUM_FIELD(ObjectType, object_type, objectType, objectType);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_NODE_PTR_FIELD(object, object, object);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, newowner, newowner, newowner);
  return node;
}

static AlterOperatorStmt *
_readAlterOperatorStmt(OUT_TYPE(AlterOperatorStmt, AlterOperatorStmt) msg)
{
  AlterOperatorStmt *node = makeNode(AlterOperatorStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(ObjectWithArgs, object_with_args, opername, opername, opername);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterTypeStmt *
_readAlterTypeStmt(OUT_TYPE(AlterTypeStmt, AlterTypeStmt) msg)
{
  AlterTypeStmt *node = makeNode(AlterTypeStmt);
  READ_LIST_FIELD(type_name, typeName, typeName);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static RuleStmt *
_readRuleStmt(OUT_TYPE(RuleStmt, RuleStmt) msg)
{
  RuleStmt *node = makeNode(RuleStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_STRING_FIELD(rulename, rulename, rulename);
  READ_NODE_PTR_FIELD(where_clause, whereClause, whereClause);
  READ_ENUM_FIELD(CmdType, event, event, event);
  READ_BOOL_FIELD(instead, instead, instead);
  READ_LIST_FIELD(actions, actions, actions);
  READ_BOOL_FIELD(replace, replace, replace);
  return node;
}

static NotifyStmt *
_readNotifyStmt(OUT_TYPE(NotifyStmt, NotifyStmt) msg)
{
  NotifyStmt *node = makeNode(NotifyStmt);
  READ_STRING_FIELD(conditionname, conditionname, conditionname);
  READ_STRING_FIELD(payload, payload, payload);
  return node;
}

static ListenStmt *
_readListenStmt(OUT_TYPE(ListenStmt, ListenStmt) msg)
{
  ListenStmt *node = makeNode(ListenStmt);
  READ_STRING_FIELD(conditionname, conditionname, conditionname);
  return node;
}

static UnlistenStmt *
_readUnlistenStmt(OUT_TYPE(UnlistenStmt, UnlistenStmt) msg)
{
  UnlistenStmt *node = makeNode(UnlistenStmt);
  READ_STRING_FIELD(conditionname, conditionname, conditionname);
  return node;
}

static TransactionStmt *
_readTransactionStmt(OUT_TYPE(TransactionStmt, TransactionStmt) msg)
{
  TransactionStmt *node = makeNode(TransactionStmt);
  READ_ENUM_FIELD(TransactionStmtKind, kind, kind, kind);
  READ_LIST_FIELD(options, options, options);
  READ_STRING_FIELD(savepoint_name, savepoint_name, savepoint_name);
  READ_STRING_FIELD(gid, gid, gid);
  READ_BOOL_FIELD(chain, chain, chain);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CompositeTypeStmt *
_readCompositeTypeStmt(OUT_TYPE(CompositeTypeStmt, CompositeTypeStmt) msg)
{
  CompositeTypeStmt *node = makeNode(CompositeTypeStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, typevar, typevar, typevar);
  READ_LIST_FIELD(coldeflist, coldeflist, coldeflist);
  return node;
}

static CreateEnumStmt *
_readCreateEnumStmt(OUT_TYPE(CreateEnumStmt, CreateEnumStmt) msg)
{
  CreateEnumStmt *node = makeNode(CreateEnumStmt);
  READ_LIST_FIELD(type_name, typeName, typeName);
  READ_LIST_FIELD(vals, vals, vals);
  return node;
}

static CreateRangeStmt *
_readCreateRangeStmt(OUT_TYPE(CreateRangeStmt, CreateRangeStmt) msg)
{
  CreateRangeStmt *node = makeNode(CreateRangeStmt);
  READ_LIST_FIELD(type_name, typeName, typeName);
  READ_LIST_FIELD(params, params, params);
  return node;
}

static AlterEnumStmt *
_readAlterEnumStmt(OUT_TYPE(AlterEnumStmt, AlterEnumStmt) msg)
{
  AlterEnumStmt *node = makeNode(AlterEnumStmt);
  READ_LIST_FIELD(type_name, typeName, typeName);
  READ_STRING_FIELD(old_val, oldVal, oldVal);
  READ_STRING_FIELD(new_val, newVal, newVal);
  READ_STRING_FIELD(new_val_neighbor, newValNeighbor, newValNeighbor);
  READ_BOOL_FIELD(new_val_is_after, newValIsAfter, newValIsAfter);
  READ_BOOL_FIELD(skip_if_new_val_exists, skipIfNewValExists, skipIfNewValExists);
  return node;
}

static ViewStmt *
_readViewStmt(OUT_TYPE(ViewStmt, ViewStmt) msg)
{
  ViewStmt *node = makeNode(ViewStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, view, view, view);
  READ_LIST_FIELD(aliases, aliases, aliases);
  READ_NODE_PTR_FIELD(query, query, query);
  READ_BOOL_FIELD(replace, replace, replace);
  READ_LIST_FIELD(options, options, options);
  READ_ENUM_FIELD(ViewCheckOption, with_check_option, withCheckOption, withCheckOption);
  return node;
}

static LoadStmt *
_readLoadStmt(OUT_TYPE(LoadStmt, LoadStmt) msg)
{
  LoadStmt *node = makeNode(LoadStmt);
  READ_STRING_FIELD(filename, filename, filename);
  return node;
}

static CreatedbStmt *
_readCreatedbStmt(OUT_TYPE(CreatedbStmt, CreatedbStmt) msg)
{
  CreatedbStmt *node = makeNode(CreatedbStmt);
  READ_STRING_FIELD(dbname, dbname, dbname);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterDatabaseStmt *
_readAlterDatabaseStmt(OUT_TYPE(AlterDatabaseStmt, AlterDatabaseStmt) msg)
{
  AlterDatabaseStmt *node = makeNode(AlterDatabaseStmt);
  READ_STRING_FIELD(dbname, dbname, dbname);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterDatabaseRefreshCollStmt *
_readAlterDatabaseRefreshCollStmt(OUT_TYPE(AlterDatabaseRefreshCollStmt, AlterDatabaseRefreshCollStmt) msg)
{
  AlterDatabaseRefreshCollStmt *node = makeNode(AlterDatabaseRefreshCollStmt);
  READ_STRING_FIELD(dbname, dbname, dbname);
  return node;
}

static AlterDatabaseSetStmt *
_readAlterDatabaseSetStmt(OUT_TYPE(AlterDatabaseSetStmt, AlterDatabaseSetStmt) msg)
{
  AlterDatabaseSetStmt *node = makeNode(AlterDatabaseSetStmt);
  READ_STRING_FIELD(dbname, dbname, dbname);
  READ_SPECIFIC_NODE_PTR_FIELD(VariableSetStmt, variable_set_stmt, setstmt, setstmt, setstmt);
  return node;
}

static DropdbStmt *
_readDropdbStmt(OUT_TYPE(DropdbStmt, DropdbStmt) msg)
{
  DropdbStmt *node = makeNode(DropdbStmt);
  READ_STRING_FIELD(dbname, dbname, dbname);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterSystemStmt *
_readAlterSystemStmt(OUT_TYPE(AlterSystemStmt, AlterSystemStmt) msg)
{
  AlterSystemStmt *node = makeNode(AlterSystemStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(VariableSetStmt, variable_set_stmt, setstmt, setstmt, setstmt);
  return node;
}

static ClusterStmt *
_readClusterStmt(OUT_TYPE(ClusterStmt, ClusterStmt) msg)
{
  ClusterStmt *node = makeNode(ClusterStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_STRING_FIELD(indexname, indexname, indexname);
  READ_LIST_FIELD(params, params, params);
  return node;
}

static VacuumStmt *
_readVacuumStmt(OUT_TYPE(VacuumStmt, VacuumStmt) msg)
{
  VacuumStmt *node = makeNode(VacuumStmt);
  READ_LIST_FIELD(options, options, options);
  READ_LIST_FIELD(rels, rels, rels);
  READ_BOOL_FIELD(is_vacuumcmd, is_vacuumcmd, is_vacuumcmd);
  return node;
}

static VacuumRelation *
_readVacuumRelation(OUT_TYPE(VacuumRelation, VacuumRelation) msg)
{
  VacuumRelation *node = makeNode(VacuumRelation);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_UINT_FIELD(oid, oid, oid);
  READ_LIST_FIELD(va_cols, va_cols, va_cols);
  return node;
}

static ExplainStmt *
_readExplainStmt(OUT_TYPE(ExplainStmt, ExplainStmt) msg)
{
  ExplainStmt *node = makeNode(ExplainStmt);
  READ_NODE_PTR_FIELD(query, query, query);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static CreateTableAsStmt *
_readCreateTableAsStmt(OUT_TYPE(CreateTableAsStmt, CreateTableAsStmt) msg)
{
  CreateTableAsStmt *node = makeNode(CreateTableAsStmt);
  READ_NODE_PTR_FIELD(query, query, query);
  READ_SPECIFIC_NODE_PTR_FIELD(IntoClause, into_clause, into, into, into);
  READ_ENUM_FIELD(ObjectType, objtype, objtype, objtype);
  READ_BOOL_FIELD(is_select_into, is_select_into, is_select_into);
  READ_BOOL_FIELD(if_not_exists, if_not_exists, if_not_exists);
  return node;
}

static RefreshMatViewStmt *
_readRefreshMatViewStmt(OUT_TYPE(RefreshMatViewStmt, RefreshMatViewStmt) msg)
{
  RefreshMatViewStmt *node = makeNode(RefreshMatViewStmt);
  READ_BOOL_FIELD(concurrent, concurrent, concurrent);
  READ_BOOL_FIELD(skip_data, skipData, skipData);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  return node;
}

static CheckPointStmt *
_readCheckPointStmt(OUT_TYPE(CheckPointStmt, CheckPointStmt) msg)
{
  CheckPointStmt *node = makeNode(CheckPointStmt);
  return node;
}

static DiscardStmt *
_readDiscardStmt(OUT_TYPE(DiscardStmt, DiscardStmt) msg)
{
  DiscardStmt *node = makeNode(DiscardStmt);
  READ_ENUM_FIELD(DiscardMode, target, target, target);
  return node;
}

static LockStmt *
_readLockStmt(OUT_TYPE(LockStmt, LockStmt) msg)
{
  LockStmt *node = makeNode(LockStmt);
  READ_LIST_FIELD(relations, relations, relations);
  READ_INT_FIELD(mode, mode, mode);
  READ_BOOL_FIELD(nowait, nowait, nowait);
  return node;
}

static ConstraintsSetStmt *
_readConstraintsSetStmt(OUT_TYPE(ConstraintsSetStmt, ConstraintsSetStmt) msg)
{
  ConstraintsSetStmt *node = makeNode(ConstraintsSetStmt);
  READ_LIST_FIELD(constraints, constraints, constraints);
  READ_BOOL_FIELD(deferred, deferred, deferred);
  return node;
}

static ReindexStmt *
_readReindexStmt(OUT_TYPE(ReindexStmt, ReindexStmt) msg)
{
  ReindexStmt *node = makeNode(ReindexStmt);
  READ_ENUM_FIELD(ReindexObjectType, kind, kind, kind);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_STRING_FIELD(name, name, name);
  READ_LIST_FIELD(params, params, params);
  return node;
}

static CreateConversionStmt *
_readCreateConversionStmt(OUT_TYPE(CreateConversionStmt, CreateConversionStmt) msg)
{
  CreateConversionStmt *node = makeNode(CreateConversionStmt);
  READ_LIST_FIELD(conversion_name, conversion_name, conversion_name);
  READ_STRING_FIELD(for_encoding_name, for_encoding_name, for_encoding_name);
  READ_STRING_FIELD(to_encoding_name, to_encoding_name, to_encoding_name);
  READ_LIST_FIELD(func_name, func_name, func_name);
  READ_BOOL_FIELD(def, def, def);
  return node;
}

static CreateCastStmt *
_readCreateCastStmt(OUT_TYPE(CreateCastStmt, CreateCastStmt) msg)
{
  CreateCastStmt *node = makeNode(CreateCastStmt);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, sourcetype, sourcetype, sourcetype);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, targettype, targettype, targettype);
  READ_SPECIFIC_NODE_PTR_FIELD(ObjectWithArgs, object_with_args, func, func, func);
  READ_ENUM_FIELD(CoercionContext, context, context, context);
  READ_BOOL_FIELD(inout, inout, inout);
  return node;
}

static CreateTransformStmt *
_readCreateTransformStmt(OUT_TYPE(CreateTransformStmt, CreateTransformStmt) msg)
{
  CreateTransformStmt *node = makeNode(CreateTransformStmt);
  READ_BOOL_FIELD(replace, replace, replace);
  READ_SPECIFIC_NODE_PTR_FIELD(TypeName, type_name, type_name, type_name, type_name);
  READ_STRING_FIELD(lang, lang, lang);
  READ_SPECIFIC_NODE_PTR_FIELD(ObjectWithArgs, object_with_args, fromsql, fromsql, fromsql);
  READ_SPECIFIC_NODE_PTR_FIELD(ObjectWithArgs, object_with_args, tosql, tosql, tosql);
  return node;
}

static PrepareStmt *
_readPrepareStmt(OUT_TYPE(PrepareStmt, PrepareStmt) msg)
{
  PrepareStmt *node = makeNode(PrepareStmt);
  READ_STRING_FIELD(name, name, name);
  READ_LIST_FIELD(argtypes, argtypes, argtypes);
  READ_NODE_PTR_FIELD(query, query, query);
  return node;
}

static ExecuteStmt *
_readExecuteStmt(OUT_TYPE(ExecuteStmt, ExecuteStmt) msg)
{
  ExecuteStmt *node = makeNode(ExecuteStmt);
  READ_STRING_FIELD(name, name, name);
  READ_LIST_FIELD(params, params, params);
  return node;
}

static DeallocateStmt *
_readDeallocateStmt(OUT_TYPE(DeallocateStmt, DeallocateStmt) msg)
{
  DeallocateStmt *node = makeNode(DeallocateStmt);
  READ_STRING_FIELD(name, name, name);
  READ_BOOL_FIELD(isall, isall, isall);
  READ_INT_FIELD(location, location, location);
  return node;
}

static DropOwnedStmt *
_readDropOwnedStmt(OUT_TYPE(DropOwnedStmt, DropOwnedStmt) msg)
{
  DropOwnedStmt *node = makeNode(DropOwnedStmt);
  READ_LIST_FIELD(roles, roles, roles);
  READ_ENUM_FIELD(DropBehavior, behavior, behavior, behavior);
  return node;
}

static ReassignOwnedStmt *
_readReassignOwnedStmt(OUT_TYPE(ReassignOwnedStmt, ReassignOwnedStmt) msg)
{
  ReassignOwnedStmt *node = makeNode(ReassignOwnedStmt);
  READ_LIST_FIELD(roles, roles, roles);
  READ_SPECIFIC_NODE_PTR_FIELD(RoleSpec, role_spec, newrole, newrole, newrole);
  return node;
}

static AlterTSDictionaryStmt *
_readAlterTSDictionaryStmt(OUT_TYPE(AlterTSDictionaryStmt, AlterTSDictionaryStmt) msg)
{
  AlterTSDictionaryStmt *node = makeNode(AlterTSDictionaryStmt);
  READ_LIST_FIELD(dictname, dictname, dictname);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterTSConfigurationStmt *
_readAlterTSConfigurationStmt(OUT_TYPE(AlterTSConfigurationStmt, AlterTSConfigurationStmt) msg)
{
  AlterTSConfigurationStmt *node = makeNode(AlterTSConfigurationStmt);
  READ_ENUM_FIELD(AlterTSConfigType, kind, kind, kind);
  READ_LIST_FIELD(cfgname, cfgname, cfgname);
  READ_LIST_FIELD(tokentype, tokentype, tokentype);
  READ_LIST_FIELD(dicts, dicts, dicts);
  READ_BOOL_FIELD(override, override, override);
  READ_BOOL_FIELD(replace, replace, replace);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  return node;
}

static PublicationTable *
_readPublicationTable(OUT_TYPE(PublicationTable, PublicationTable) msg)
{
  PublicationTable *node = makeNode(PublicationTable);
  READ_SPECIFIC_NODE_PTR_FIELD(RangeVar, range_var, relation, relation, relation);
  READ_NODE_PTR_FIELD(where_clause, whereClause, whereClause);
  READ_LIST_FIELD(columns, columns, columns);
  return node;
}

static PublicationObjSpec *
_readPublicationObjSpec(OUT_TYPE(PublicationObjSpec, PublicationObjSpec) msg)
{
  PublicationObjSpec *node = makeNode(PublicationObjSpec);
  READ_ENUM_FIELD(PublicationObjSpecType, pubobjtype, pubobjtype, pubobjtype);
  READ_STRING_FIELD(name, name, name);
  READ_SPECIFIC_NODE_PTR_FIELD(PublicationTable, publication_table, pubtable, pubtable, pubtable);
  READ_INT_FIELD(location, location, location);
  return node;
}

static CreatePublicationStmt *
_readCreatePublicationStmt(OUT_TYPE(CreatePublicationStmt, CreatePublicationStmt) msg)
{
  CreatePublicationStmt *node = makeNode(CreatePublicationStmt);
  READ_STRING_FIELD(pubname, pubname, pubname);
  READ_LIST_FIELD(options, options, options);
  READ_LIST_FIELD(pubobjects, pubobjects, pubobjects);
  READ_BOOL_FIELD(for_all_tables, for_all_tables, for_all_tables);
  return node;
}

static AlterPublicationStmt *
_readAlterPublicationStmt(OUT_TYPE(AlterPublicationStmt, AlterPublicationStmt) msg)
{
  AlterPublicationStmt *node = makeNode(AlterPublicationStmt);
  READ_STRING_FIELD(pubname, pubname, pubname);
  READ_LIST_FIELD(options, options, options);
  READ_LIST_FIELD(pubobjects, pubobjects, pubobjects);
  READ_BOOL_FIELD(for_all_tables, for_all_tables, for_all_tables);
  READ_ENUM_FIELD(AlterPublicationAction, action, action, action);
  return node;
}

static CreateSubscriptionStmt *
_readCreateSubscriptionStmt(OUT_TYPE(CreateSubscriptionStmt, CreateSubscriptionStmt) msg)
{
  CreateSubscriptionStmt *node = makeNode(CreateSubscriptionStmt);
  READ_STRING_FIELD(subname, subname, subname);
  READ_STRING_FIELD(conninfo, conninfo, conninfo);
  READ_LIST_FIELD(publication, publication, publication);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static AlterSubscriptionStmt *
_readAlterSubscriptionStmt(OUT_TYPE(AlterSubscriptionStmt, AlterSubscriptionStmt) msg)
{
  AlterSubscriptionStmt *node = makeNode(AlterSubscriptionStmt);
  READ_ENUM_FIELD(AlterSubscriptionType, kind, kind, kind);
  READ_STRING_FIELD(subname, subname, subname);
  READ_STRING_FIELD(conninfo, conninfo, conninfo);
  READ_LIST_FIELD(publication, publication, publication);
  READ_LIST_FIELD(options, options, options);
  return node;
}

static DropSubscriptionStmt *
_readDropSubscriptionStmt(OUT_TYPE(DropSubscriptionStmt, DropSubscriptionStmt) msg)
{
  DropSubscriptionStmt *node = makeNode(DropSubscriptionStmt);
  READ_STRING_FIELD(subname, subname, subname);
  READ_BOOL_FIELD(missing_ok, missing_ok, missing_ok);
  READ_ENUM_FIELD(DropBehavior, behavior, behavior, behavior);
  return node;
}

