PostgreSQL Source Code git master
Loading...
Searching...
No Matches
parsenodes.h File Reference
#include "common/relpath.h"
#include "nodes/bitmapset.h"
#include "nodes/lockoptions.h"
#include "nodes/primnodes.h"
#include "nodes/value.h"
#include "partitioning/partdefs.h"
Include dependency graph for parsenodes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Query
 
struct  TypeName
 
struct  ColumnRef
 
struct  ParamRef
 
struct  A_Expr
 
union  ValUnion
 
struct  A_Const
 
struct  TypeCast
 
struct  CollateClause
 
struct  RoleSpec
 
struct  FuncCall
 
struct  A_Star
 
struct  A_Indices
 
struct  A_Indirection
 
struct  A_ArrayExpr
 
struct  ResTarget
 
struct  MultiAssignRef
 
struct  SortBy
 
struct  WindowDef
 
struct  RangeSubselect
 
struct  RangeFunction
 
struct  RangeTableFunc
 
struct  RangeTableFuncCol
 
struct  RangeGraphTable
 
struct  RangeTableSample
 
struct  ColumnDef
 
struct  TableLikeClause
 
struct  IndexElem
 
struct  DefElem
 
struct  LockingClause
 
struct  XmlSerialize
 
struct  PartitionElem
 
struct  PartitionSpec
 
struct  PartitionBoundSpec
 
struct  PartitionRangeDatum
 
struct  SinglePartitionSpec
 
struct  PartitionCmd
 
struct  GraphPattern
 
struct  GraphElementPattern
 
struct  RangeTblEntry
 
struct  RTEPermissionInfo
 
struct  RangeTblFunction
 
struct  TableSampleClause
 
struct  WithCheckOption
 
struct  SortGroupClause
 
struct  GroupingSet
 
struct  WindowClause
 
struct  RowMarkClause
 
struct  WithClause
 
struct  InferClause
 
struct  OnConflictClause
 
struct  CTESearchClause
 
struct  CTECycleClause
 
struct  CommonTableExpr
 
struct  MergeWhenClause
 
struct  ReturningOption
 
struct  ReturningClause
 
struct  TriggerTransition
 
struct  JsonOutput
 
struct  JsonArgument
 
struct  JsonFuncExpr
 
struct  JsonTablePathSpec
 
struct  JsonTable
 
struct  JsonTableColumn
 
struct  JsonKeyValue
 
struct  JsonParseExpr
 
struct  JsonScalarExpr
 
struct  JsonSerializeExpr
 
struct  JsonObjectConstructor
 
struct  JsonArrayConstructor
 
struct  JsonArrayQueryConstructor
 
struct  JsonAggConstructor
 
struct  JsonObjectAgg
 
struct  JsonArrayAgg
 
struct  RawStmt
 
struct  InsertStmt
 
struct  DeleteStmt
 
struct  UpdateStmt
 
struct  MergeStmt
 
struct  SelectStmt
 
struct  SetOperationStmt
 
struct  ReturnStmt
 
struct  PLAssignStmt
 
struct  CreateSchemaStmt
 
struct  AlterTableStmt
 
struct  AlterTableCmd
 
struct  ATAlterConstraint
 
struct  ReplicaIdentityStmt
 
struct  AlterCollationStmt
 
struct  AlterDomainStmt
 
struct  GrantStmt
 
struct  ObjectWithArgs
 
struct  AccessPriv
 
struct  GrantRoleStmt
 
struct  AlterDefaultPrivilegesStmt
 
struct  CopyStmt
 
struct  VariableSetStmt
 
struct  VariableShowStmt
 
struct  CreateStmt
 
struct  Constraint
 
struct  CreateTableSpaceStmt
 
struct  DropTableSpaceStmt
 
struct  AlterTableSpaceOptionsStmt
 
struct  AlterTableMoveAllStmt
 
struct  CreateExtensionStmt
 
struct  AlterExtensionStmt
 
struct  AlterExtensionContentsStmt
 
struct  CreateFdwStmt
 
struct  AlterFdwStmt
 
struct  CreateForeignServerStmt
 
struct  AlterForeignServerStmt
 
struct  CreateForeignTableStmt
 
struct  CreateUserMappingStmt
 
struct  AlterUserMappingStmt
 
struct  DropUserMappingStmt
 
struct  ImportForeignSchemaStmt
 
struct  CreatePolicyStmt
 
struct  AlterPolicyStmt
 
struct  CreateAmStmt
 
struct  CreateTrigStmt
 
struct  CreateEventTrigStmt
 
struct  AlterEventTrigStmt
 
struct  CreatePLangStmt
 
struct  CreateRoleStmt
 
struct  AlterRoleStmt
 
struct  AlterRoleSetStmt
 
struct  DropRoleStmt
 
struct  CreateSeqStmt
 
struct  AlterSeqStmt
 
struct  DefineStmt
 
struct  CreateDomainStmt
 
struct  CreateOpClassStmt
 
struct  CreateOpClassItem
 
struct  CreateOpFamilyStmt
 
struct  AlterOpFamilyStmt
 
struct  DropStmt
 
struct  TruncateStmt
 
struct  CommentStmt
 
struct  SecLabelStmt
 
struct  DeclareCursorStmt
 
struct  ClosePortalStmt
 
struct  FetchStmt
 
struct  IndexStmt
 
struct  CreateStatsStmt
 
struct  StatsElem
 
struct  AlterStatsStmt
 
struct  CreateFunctionStmt
 
struct  FunctionParameter
 
struct  AlterFunctionStmt
 
struct  DoStmt
 
struct  InlineCodeBlock
 
struct  CallStmt
 
struct  CallContext
 
struct  RenameStmt
 
struct  AlterObjectDependsStmt
 
struct  AlterObjectSchemaStmt
 
struct  AlterOwnerStmt
 
struct  AlterOperatorStmt
 
struct  AlterTypeStmt
 
struct  RuleStmt
 
struct  NotifyStmt
 
struct  ListenStmt
 
struct  UnlistenStmt
 
struct  TransactionStmt
 
struct  CompositeTypeStmt
 
struct  CreateEnumStmt
 
struct  CreateRangeStmt
 
struct  AlterEnumStmt
 
struct  ViewStmt
 
struct  LoadStmt
 
struct  CreatedbStmt
 
struct  AlterDatabaseStmt
 
struct  AlterDatabaseRefreshCollStmt
 
struct  AlterDatabaseSetStmt
 
struct  DropdbStmt
 
struct  AlterSystemStmt
 
struct  VacuumStmt
 
struct  VacuumRelation
 
struct  RepackStmt
 
struct  ExplainStmt
 
struct  CreateTableAsStmt
 
struct  RefreshMatViewStmt
 
struct  CheckPointStmt
 
struct  DiscardStmt
 
struct  LockStmt
 
struct  ConstraintsSetStmt
 
struct  ReindexStmt
 
struct  CreateConversionStmt
 
struct  CreateCastStmt
 
struct  CreatePropGraphStmt
 
struct  PropGraphVertex
 
struct  PropGraphEdge
 
struct  PropGraphLabelAndProperties
 
struct  PropGraphProperties
 
struct  AlterPropGraphStmt
 
struct  CreateTransformStmt
 
struct  PrepareStmt
 
struct  ExecuteStmt
 
struct  DeallocateStmt
 
struct  DropOwnedStmt
 
struct  ReassignOwnedStmt
 
struct  AlterTSDictionaryStmt
 
struct  AlterTSConfigurationStmt
 
struct  PublicationTable
 
struct  PublicationObjSpec
 
struct  PublicationAllObjSpec
 
struct  CreatePublicationStmt
 
struct  AlterPublicationStmt
 
struct  CreateSubscriptionStmt
 
struct  AlterSubscriptionStmt
 
struct  DropSubscriptionStmt
 
struct  WaitStmt
 

Macros

#define ACL_INSERT   (1<<0) /* for relations */
 
#define ACL_SELECT   (1<<1)
 
#define ACL_UPDATE   (1<<2)
 
#define ACL_DELETE   (1<<3)
 
#define ACL_TRUNCATE   (1<<4)
 
#define ACL_REFERENCES   (1<<5)
 
#define ACL_TRIGGER   (1<<6)
 
#define ACL_EXECUTE   (1<<7) /* for functions */
 
#define ACL_USAGE   (1<<8) /* for various object types */
 
#define ACL_CREATE   (1<<9) /* for namespaces and databases */
 
#define ACL_CREATE_TEMP   (1<<10) /* for databases */
 
#define ACL_CONNECT   (1<<11) /* for databases */
 
#define ACL_SET   (1<<12) /* for configuration parameters */
 
#define ACL_ALTER_SYSTEM   (1<<13) /* for configuration parameters */
 
#define ACL_MAINTAIN   (1<<14) /* for relations */
 
#define N_ACL_RIGHTS   15 /* 1 plus the last 1<<x */
 
#define ACL_NO_RIGHTS   0
 
#define ACL_SELECT_FOR_UPDATE   ACL_UPDATE
 
#define FRAMEOPTION_NONDEFAULT   0x00001 /* any specified? */
 
#define FRAMEOPTION_RANGE   0x00002 /* RANGE behavior */
 
#define FRAMEOPTION_ROWS   0x00004 /* ROWS behavior */
 
#define FRAMEOPTION_GROUPS   0x00008 /* GROUPS behavior */
 
#define FRAMEOPTION_BETWEEN   0x00010 /* BETWEEN given? */
 
#define FRAMEOPTION_START_UNBOUNDED_PRECEDING   0x00020 /* start is U. P. */
 
#define FRAMEOPTION_END_UNBOUNDED_PRECEDING   0x00040 /* (disallowed) */
 
#define FRAMEOPTION_START_UNBOUNDED_FOLLOWING   0x00080 /* (disallowed) */
 
#define FRAMEOPTION_END_UNBOUNDED_FOLLOWING   0x00100 /* end is U. F. */
 
#define FRAMEOPTION_START_CURRENT_ROW   0x00200 /* start is C. R. */
 
#define FRAMEOPTION_END_CURRENT_ROW   0x00400 /* end is C. R. */
 
#define FRAMEOPTION_START_OFFSET_PRECEDING   0x00800 /* start is O. P. */
 
#define FRAMEOPTION_END_OFFSET_PRECEDING   0x01000 /* end is O. P. */
 
#define FRAMEOPTION_START_OFFSET_FOLLOWING   0x02000 /* start is O. F. */
 
#define FRAMEOPTION_END_OFFSET_FOLLOWING   0x04000 /* end is O. F. */
 
#define FRAMEOPTION_EXCLUDE_CURRENT_ROW   0x08000 /* omit C.R. */
 
#define FRAMEOPTION_EXCLUDE_GROUP   0x10000 /* omit C.R. & peers */
 
#define FRAMEOPTION_EXCLUDE_TIES   0x20000 /* omit C.R.'s peers */
 
#define FRAMEOPTION_START_OFFSET    (FRAMEOPTION_START_OFFSET_PRECEDING | FRAMEOPTION_START_OFFSET_FOLLOWING)
 
#define FRAMEOPTION_END_OFFSET    (FRAMEOPTION_END_OFFSET_PRECEDING | FRAMEOPTION_END_OFFSET_FOLLOWING)
 
#define FRAMEOPTION_EXCLUSION
 
#define FRAMEOPTION_DEFAULTS
 
#define IS_EDGE_PATTERN(kind)
 
#define GetCTETargetList(cte)
 
#define FKCONSTR_ACTION_NOACTION   'a'
 
#define FKCONSTR_ACTION_RESTRICT   'r'
 
#define FKCONSTR_ACTION_CASCADE   'c'
 
#define FKCONSTR_ACTION_SETNULL   'n'
 
#define FKCONSTR_ACTION_SETDEFAULT   'd'
 
#define FKCONSTR_MATCH_FULL   'f'
 
#define FKCONSTR_MATCH_PARTIAL   'p'
 
#define FKCONSTR_MATCH_SIMPLE   's'
 
#define OPCLASS_ITEM_OPERATOR   1
 
#define OPCLASS_ITEM_FUNCTION   2
 
#define OPCLASS_ITEM_STORAGETYPE   3
 
#define CURSOR_OPT_BINARY   0x0001 /* BINARY */
 
#define CURSOR_OPT_SCROLL   0x0002 /* SCROLL explicitly given */
 
#define CURSOR_OPT_NO_SCROLL   0x0004 /* NO SCROLL explicitly given */
 
#define CURSOR_OPT_INSENSITIVE   0x0008 /* INSENSITIVE */
 
#define CURSOR_OPT_ASENSITIVE   0x0010 /* ASENSITIVE */
 
#define CURSOR_OPT_HOLD   0x0020 /* WITH HOLD */
 
#define CURSOR_OPT_FAST_PLAN   0x0100 /* prefer fast-start plan */
 
#define CURSOR_OPT_GENERIC_PLAN   0x0200 /* force use of generic plan */
 
#define CURSOR_OPT_CUSTOM_PLAN   0x0400 /* force use of custom plan */
 
#define CURSOR_OPT_PARALLEL_OK   0x0800 /* parallel mode OK */
 
#define FETCH_ALL   LONG_MAX
 

Typedefs

typedef enum QuerySource QuerySource
 
typedef enum SortByDir SortByDir
 
typedef enum SortByNulls SortByNulls
 
typedef enum SetQuantifier SetQuantifier
 
typedef uint64 AclMode
 
typedef struct Query Query
 
typedef struct TypeName TypeName
 
typedef struct ColumnRef ColumnRef
 
typedef struct ParamRef ParamRef
 
typedef enum A_Expr_Kind A_Expr_Kind
 
typedef struct A_Expr A_Expr
 
typedef struct A_Const A_Const
 
typedef struct TypeCast TypeCast
 
typedef struct CollateClause CollateClause
 
typedef enum RoleSpecType RoleSpecType
 
typedef struct RoleSpec RoleSpec
 
typedef struct FuncCall FuncCall
 
typedef struct A_Star A_Star
 
typedef struct A_Indices A_Indices
 
typedef struct A_Indirection A_Indirection
 
typedef struct A_ArrayExpr A_ArrayExpr
 
typedef struct ResTarget ResTarget
 
typedef struct MultiAssignRef MultiAssignRef
 
typedef struct SortBy SortBy
 
typedef struct WindowDef WindowDef
 
typedef struct RangeSubselect RangeSubselect
 
typedef struct RangeFunction RangeFunction
 
typedef struct RangeTableFunc RangeTableFunc
 
typedef struct RangeTableFuncCol RangeTableFuncCol
 
typedef struct RangeGraphTable RangeGraphTable
 
typedef struct RangeTableSample RangeTableSample
 
typedef struct ColumnDef ColumnDef
 
typedef struct TableLikeClause TableLikeClause
 
typedef enum TableLikeOption TableLikeOption
 
typedef struct IndexElem IndexElem
 
typedef enum DefElemAction DefElemAction
 
typedef struct DefElem DefElem
 
typedef struct LockingClause LockingClause
 
typedef struct XmlSerialize XmlSerialize
 
typedef struct PartitionElem PartitionElem
 
typedef enum PartitionStrategy PartitionStrategy
 
typedef struct PartitionSpec PartitionSpec
 
typedef enum PartitionRangeDatumKind PartitionRangeDatumKind
 
typedef struct PartitionRangeDatum PartitionRangeDatum
 
typedef struct SinglePartitionSpec SinglePartitionSpec
 
typedef struct PartitionCmd PartitionCmd
 
typedef struct GraphPattern GraphPattern
 
typedef enum GraphElementPatternKind GraphElementPatternKind
 
typedef struct GraphElementPattern GraphElementPattern
 
typedef enum RTEKind RTEKind
 
typedef struct RangeTblEntry RangeTblEntry
 
typedef struct RTEPermissionInfo RTEPermissionInfo
 
typedef struct RangeTblFunction RangeTblFunction
 
typedef struct TableSampleClause TableSampleClause
 
typedef enum WCOKind WCOKind
 
typedef struct WithCheckOption WithCheckOption
 
typedef struct SortGroupClause SortGroupClause
 
typedef enum GroupingSetKind GroupingSetKind
 
typedef struct GroupingSet GroupingSet
 
typedef struct WindowClause WindowClause
 
typedef struct RowMarkClause RowMarkClause
 
typedef struct WithClause WithClause
 
typedef struct InferClause InferClause
 
typedef struct OnConflictClause OnConflictClause
 
typedef enum CTEMaterialize CTEMaterialize
 
typedef struct CTESearchClause CTESearchClause
 
typedef struct CTECycleClause CTECycleClause
 
typedef struct CommonTableExpr CommonTableExpr
 
typedef struct MergeWhenClause MergeWhenClause
 
typedef enum ReturningOptionKind ReturningOptionKind
 
typedef struct ReturningOption ReturningOption
 
typedef struct ReturningClause ReturningClause
 
typedef struct TriggerTransition TriggerTransition
 
typedef struct JsonOutput JsonOutput
 
typedef struct JsonArgument JsonArgument
 
typedef enum JsonQuotes JsonQuotes
 
typedef struct JsonFuncExpr JsonFuncExpr
 
typedef struct JsonTablePathSpec JsonTablePathSpec
 
typedef struct JsonTable JsonTable
 
typedef enum JsonTableColumnType JsonTableColumnType
 
typedef struct JsonTableColumn JsonTableColumn
 
typedef struct JsonKeyValue JsonKeyValue
 
typedef struct JsonParseExpr JsonParseExpr
 
typedef struct JsonScalarExpr JsonScalarExpr
 
typedef struct JsonSerializeExpr JsonSerializeExpr
 
typedef struct JsonObjectConstructor JsonObjectConstructor
 
typedef struct JsonArrayConstructor JsonArrayConstructor
 
typedef struct JsonArrayQueryConstructor JsonArrayQueryConstructor
 
typedef struct JsonAggConstructor JsonAggConstructor
 
typedef struct JsonObjectAgg JsonObjectAgg
 
typedef struct JsonArrayAgg JsonArrayAgg
 
typedef struct RawStmt RawStmt
 
typedef struct InsertStmt InsertStmt
 
typedef struct DeleteStmt DeleteStmt
 
typedef struct UpdateStmt UpdateStmt
 
typedef struct MergeStmt MergeStmt
 
typedef enum SetOperation SetOperation
 
typedef struct SelectStmt SelectStmt
 
typedef struct SetOperationStmt SetOperationStmt
 
typedef struct ReturnStmt ReturnStmt
 
typedef struct PLAssignStmt PLAssignStmt
 
typedef enum ObjectType ObjectType
 
typedef struct CreateSchemaStmt CreateSchemaStmt
 
typedef enum DropBehavior DropBehavior
 
typedef struct AlterTableStmt AlterTableStmt
 
typedef enum AlterTableType AlterTableType
 
typedef struct AlterTableCmd AlterTableCmd
 
typedef struct ATAlterConstraint ATAlterConstraint
 
typedef struct ReplicaIdentityStmt ReplicaIdentityStmt
 
typedef struct AlterCollationStmt AlterCollationStmt
 
typedef enum AlterDomainType AlterDomainType
 
typedef struct AlterDomainStmt AlterDomainStmt
 
typedef enum GrantTargetType GrantTargetType
 
typedef struct GrantStmt GrantStmt
 
typedef struct ObjectWithArgs ObjectWithArgs
 
typedef struct AccessPriv AccessPriv
 
typedef struct GrantRoleStmt GrantRoleStmt
 
typedef struct AlterDefaultPrivilegesStmt AlterDefaultPrivilegesStmt
 
typedef struct CopyStmt CopyStmt
 
typedef enum VariableSetKind VariableSetKind
 
typedef struct VariableSetStmt VariableSetStmt
 
typedef struct VariableShowStmt VariableShowStmt
 
typedef struct CreateStmt CreateStmt
 
typedef enum ConstrType ConstrType
 
typedef struct Constraint Constraint
 
typedef struct CreateTableSpaceStmt CreateTableSpaceStmt
 
typedef struct DropTableSpaceStmt DropTableSpaceStmt
 
typedef struct AlterTableSpaceOptionsStmt AlterTableSpaceOptionsStmt
 
typedef struct AlterTableMoveAllStmt AlterTableMoveAllStmt
 
typedef struct CreateExtensionStmt CreateExtensionStmt
 
typedef struct AlterExtensionStmt AlterExtensionStmt
 
typedef struct AlterExtensionContentsStmt AlterExtensionContentsStmt
 
typedef struct CreateFdwStmt CreateFdwStmt
 
typedef struct AlterFdwStmt AlterFdwStmt
 
typedef struct CreateForeignServerStmt CreateForeignServerStmt
 
typedef struct AlterForeignServerStmt AlterForeignServerStmt
 
typedef struct CreateForeignTableStmt CreateForeignTableStmt
 
typedef struct CreateUserMappingStmt CreateUserMappingStmt
 
typedef struct AlterUserMappingStmt AlterUserMappingStmt
 
typedef struct DropUserMappingStmt DropUserMappingStmt
 
typedef enum ImportForeignSchemaType ImportForeignSchemaType
 
typedef struct ImportForeignSchemaStmt ImportForeignSchemaStmt
 
typedef struct CreatePolicyStmt CreatePolicyStmt
 
typedef struct AlterPolicyStmt AlterPolicyStmt
 
typedef struct CreateAmStmt CreateAmStmt
 
typedef struct CreateTrigStmt CreateTrigStmt
 
typedef struct CreateEventTrigStmt CreateEventTrigStmt
 
typedef struct AlterEventTrigStmt AlterEventTrigStmt
 
typedef struct CreatePLangStmt CreatePLangStmt
 
typedef enum RoleStmtType RoleStmtType
 
typedef struct CreateRoleStmt CreateRoleStmt
 
typedef struct AlterRoleStmt AlterRoleStmt
 
typedef struct AlterRoleSetStmt AlterRoleSetStmt
 
typedef struct DropRoleStmt DropRoleStmt
 
typedef struct CreateSeqStmt CreateSeqStmt
 
typedef struct AlterSeqStmt AlterSeqStmt
 
typedef struct DefineStmt DefineStmt
 
typedef struct CreateDomainStmt CreateDomainStmt
 
typedef struct CreateOpClassStmt CreateOpClassStmt
 
typedef struct CreateOpClassItem CreateOpClassItem
 
typedef struct CreateOpFamilyStmt CreateOpFamilyStmt
 
typedef struct AlterOpFamilyStmt AlterOpFamilyStmt
 
typedef struct DropStmt DropStmt
 
typedef struct TruncateStmt TruncateStmt
 
typedef struct CommentStmt CommentStmt
 
typedef struct SecLabelStmt SecLabelStmt
 
typedef struct DeclareCursorStmt DeclareCursorStmt
 
typedef struct ClosePortalStmt ClosePortalStmt
 
typedef enum FetchDirection FetchDirection
 
typedef enum FetchDirectionKeywords FetchDirectionKeywords
 
typedef struct FetchStmt FetchStmt
 
typedef struct IndexStmt IndexStmt
 
typedef struct CreateStatsStmt CreateStatsStmt
 
typedef struct StatsElem StatsElem
 
typedef struct AlterStatsStmt AlterStatsStmt
 
typedef struct CreateFunctionStmt CreateFunctionStmt
 
typedef enum FunctionParameterMode FunctionParameterMode
 
typedef struct FunctionParameter FunctionParameter
 
typedef struct AlterFunctionStmt AlterFunctionStmt
 
typedef struct DoStmt DoStmt
 
typedef struct InlineCodeBlock InlineCodeBlock
 
typedef struct CallStmt CallStmt
 
typedef struct CallContext CallContext
 
typedef struct RenameStmt RenameStmt
 
typedef struct AlterObjectDependsStmt AlterObjectDependsStmt
 
typedef struct AlterObjectSchemaStmt AlterObjectSchemaStmt
 
typedef struct AlterOwnerStmt AlterOwnerStmt
 
typedef struct AlterOperatorStmt AlterOperatorStmt
 
typedef struct AlterTypeStmt AlterTypeStmt
 
typedef struct RuleStmt RuleStmt
 
typedef struct NotifyStmt NotifyStmt
 
typedef struct ListenStmt ListenStmt
 
typedef struct UnlistenStmt UnlistenStmt
 
typedef enum TransactionStmtKind TransactionStmtKind
 
typedef struct TransactionStmt TransactionStmt
 
typedef struct CompositeTypeStmt CompositeTypeStmt
 
typedef struct CreateEnumStmt CreateEnumStmt
 
typedef struct CreateRangeStmt CreateRangeStmt
 
typedef struct AlterEnumStmt AlterEnumStmt
 
typedef enum ViewCheckOption ViewCheckOption
 
typedef struct ViewStmt ViewStmt
 
typedef struct LoadStmt LoadStmt
 
typedef struct CreatedbStmt CreatedbStmt
 
typedef struct AlterDatabaseStmt AlterDatabaseStmt
 
typedef struct AlterDatabaseRefreshCollStmt AlterDatabaseRefreshCollStmt
 
typedef struct AlterDatabaseSetStmt AlterDatabaseSetStmt
 
typedef struct DropdbStmt DropdbStmt
 
typedef struct AlterSystemStmt AlterSystemStmt
 
typedef struct VacuumStmt VacuumStmt
 
typedef struct VacuumRelation VacuumRelation
 
typedef enum RepackCommand RepackCommand
 
typedef struct RepackStmt RepackStmt
 
typedef struct ExplainStmt ExplainStmt
 
typedef struct CreateTableAsStmt CreateTableAsStmt
 
typedef struct RefreshMatViewStmt RefreshMatViewStmt
 
typedef struct CheckPointStmt CheckPointStmt
 
typedef enum DiscardMode DiscardMode
 
typedef struct DiscardStmt DiscardStmt
 
typedef struct LockStmt LockStmt
 
typedef struct ConstraintsSetStmt ConstraintsSetStmt
 
typedef enum ReindexObjectType ReindexObjectType
 
typedef struct ReindexStmt ReindexStmt
 
typedef struct CreateConversionStmt CreateConversionStmt
 
typedef struct CreateCastStmt CreateCastStmt
 
typedef struct CreatePropGraphStmt CreatePropGraphStmt
 
typedef struct PropGraphVertex PropGraphVertex
 
typedef struct PropGraphEdge PropGraphEdge
 
typedef struct PropGraphLabelAndProperties PropGraphLabelAndProperties
 
typedef struct PropGraphProperties PropGraphProperties
 
typedef enum AlterPropGraphElementKind AlterPropGraphElementKind
 
typedef struct AlterPropGraphStmt AlterPropGraphStmt
 
typedef struct CreateTransformStmt CreateTransformStmt
 
typedef struct PrepareStmt PrepareStmt
 
typedef struct ExecuteStmt ExecuteStmt
 
typedef struct DeallocateStmt DeallocateStmt
 
typedef struct DropOwnedStmt DropOwnedStmt
 
typedef struct ReassignOwnedStmt ReassignOwnedStmt
 
typedef struct AlterTSDictionaryStmt AlterTSDictionaryStmt
 
typedef enum AlterTSConfigType AlterTSConfigType
 
typedef struct AlterTSConfigurationStmt AlterTSConfigurationStmt
 
typedef struct PublicationTable PublicationTable
 
typedef enum PublicationObjSpecType PublicationObjSpecType
 
typedef struct PublicationObjSpec PublicationObjSpec
 
typedef enum PublicationAllObjType PublicationAllObjType
 
typedef struct PublicationAllObjSpec PublicationAllObjSpec
 
typedef struct CreatePublicationStmt CreatePublicationStmt
 
typedef enum AlterPublicationAction AlterPublicationAction
 
typedef struct AlterPublicationStmt AlterPublicationStmt
 
typedef struct CreateSubscriptionStmt CreateSubscriptionStmt
 
typedef enum AlterSubscriptionType AlterSubscriptionType
 
typedef struct AlterSubscriptionStmt AlterSubscriptionStmt
 
typedef struct DropSubscriptionStmt DropSubscriptionStmt
 
typedef struct WaitStmt WaitStmt
 

Enumerations

enum  QuerySource {
  QSRC_ORIGINAL , QSRC_PARSER , QSRC_INSTEAD_RULE , QSRC_QUAL_INSTEAD_RULE ,
  QSRC_NON_INSTEAD_RULE
}
 
enum  SortByDir { SORTBY_DEFAULT , SORTBY_ASC , SORTBY_DESC , SORTBY_USING }
 
enum  SortByNulls { SORTBY_NULLS_DEFAULT , SORTBY_NULLS_FIRST , SORTBY_NULLS_LAST }
 
enum  SetQuantifier { SET_QUANTIFIER_DEFAULT , SET_QUANTIFIER_ALL , SET_QUANTIFIER_DISTINCT }
 
enum  A_Expr_Kind {
  AEXPR_OP , AEXPR_OP_ANY , AEXPR_OP_ALL , AEXPR_DISTINCT ,
  AEXPR_NOT_DISTINCT , AEXPR_NULLIF , AEXPR_IN , AEXPR_LIKE ,
  AEXPR_ILIKE , AEXPR_SIMILAR , AEXPR_BETWEEN , AEXPR_NOT_BETWEEN ,
  AEXPR_BETWEEN_SYM , AEXPR_NOT_BETWEEN_SYM
}
 
enum  RoleSpecType {
  ROLESPEC_CSTRING , ROLESPEC_CURRENT_ROLE , ROLESPEC_CURRENT_USER , ROLESPEC_SESSION_USER ,
  ROLESPEC_PUBLIC
}
 
enum  TableLikeOption {
  CREATE_TABLE_LIKE_COMMENTS = 1 << 0 , CREATE_TABLE_LIKE_COMPRESSION = 1 << 1 , CREATE_TABLE_LIKE_CONSTRAINTS = 1 << 2 , CREATE_TABLE_LIKE_DEFAULTS = 1 << 3 ,
  CREATE_TABLE_LIKE_GENERATED = 1 << 4 , CREATE_TABLE_LIKE_IDENTITY = 1 << 5 , CREATE_TABLE_LIKE_INDEXES = 1 << 6 , CREATE_TABLE_LIKE_STATISTICS = 1 << 7 ,
  CREATE_TABLE_LIKE_STORAGE = 1 << 8 , CREATE_TABLE_LIKE_ALL = PG_INT32_MAX
}
 
enum  DefElemAction { DEFELEM_UNSPEC , DEFELEM_SET , DEFELEM_ADD , DEFELEM_DROP }
 
enum  PartitionStrategy { PARTITION_STRATEGY_LIST = 'l' , PARTITION_STRATEGY_RANGE = 'r' , PARTITION_STRATEGY_HASH = 'h' }
 
enum  PartitionRangeDatumKind { PARTITION_RANGE_DATUM_MINVALUE = -1 , PARTITION_RANGE_DATUM_VALUE = 0 , PARTITION_RANGE_DATUM_MAXVALUE = 1 }
 
enum  GraphElementPatternKind {
  VERTEX_PATTERN , EDGE_PATTERN_LEFT , EDGE_PATTERN_RIGHT , EDGE_PATTERN_ANY ,
  PAREN_EXPR
}
 
enum  RTEKind {
  RTE_RELATION , RTE_SUBQUERY , RTE_JOIN , RTE_FUNCTION ,
  RTE_TABLEFUNC , RTE_VALUES , RTE_CTE , RTE_NAMEDTUPLESTORE ,
  RTE_GRAPH_TABLE , RTE_RESULT , RTE_GROUP
}
 
enum  WCOKind {
  WCO_VIEW_CHECK , WCO_RLS_INSERT_CHECK , WCO_RLS_UPDATE_CHECK , WCO_RLS_CONFLICT_CHECK ,
  WCO_RLS_MERGE_UPDATE_CHECK , WCO_RLS_MERGE_DELETE_CHECK
}
 
enum  GroupingSetKind {
  GROUPING_SET_EMPTY , GROUPING_SET_SIMPLE , GROUPING_SET_ROLLUP , GROUPING_SET_CUBE ,
  GROUPING_SET_SETS
}
 
enum  CTEMaterialize { CTEMaterializeDefault , CTEMaterializeAlways , CTEMaterializeNever }
 
enum  ReturningOptionKind { RETURNING_OPTION_OLD , RETURNING_OPTION_NEW }
 
enum  JsonQuotes { JS_QUOTES_UNSPEC , JS_QUOTES_KEEP , JS_QUOTES_OMIT }
 
enum  JsonTableColumnType {
  JTC_FOR_ORDINALITY , JTC_REGULAR , JTC_EXISTS , JTC_FORMATTED ,
  JTC_NESTED
}
 
enum  SetOperation { SETOP_NONE = 0 , SETOP_UNION , SETOP_INTERSECT , SETOP_EXCEPT }
 
enum  ObjectType {
  OBJECT_ACCESS_METHOD , OBJECT_AGGREGATE , OBJECT_AMOP , OBJECT_AMPROC ,
  OBJECT_ATTRIBUTE , OBJECT_CAST , OBJECT_COLUMN , OBJECT_COLLATION ,
  OBJECT_CONVERSION , OBJECT_DATABASE , OBJECT_DEFAULT , OBJECT_DEFACL ,
  OBJECT_DOMAIN , OBJECT_DOMCONSTRAINT , OBJECT_EVENT_TRIGGER , OBJECT_EXTENSION ,
  OBJECT_FDW , OBJECT_FOREIGN_SERVER , OBJECT_FOREIGN_TABLE , OBJECT_FUNCTION ,
  OBJECT_INDEX , OBJECT_LANGUAGE , OBJECT_LARGEOBJECT , OBJECT_MATVIEW ,
  OBJECT_OPCLASS , OBJECT_OPERATOR , OBJECT_OPFAMILY , OBJECT_PARAMETER_ACL ,
  OBJECT_POLICY , OBJECT_PROCEDURE , OBJECT_PROPGRAPH , OBJECT_PUBLICATION ,
  OBJECT_PUBLICATION_NAMESPACE , OBJECT_PUBLICATION_REL , OBJECT_ROLE , OBJECT_ROUTINE ,
  OBJECT_RULE , OBJECT_SCHEMA , OBJECT_SEQUENCE , OBJECT_SUBSCRIPTION ,
  OBJECT_STATISTIC_EXT , OBJECT_TABCONSTRAINT , OBJECT_TABLE , OBJECT_TABLESPACE ,
  OBJECT_TRANSFORM , OBJECT_TRIGGER , OBJECT_TSCONFIGURATION , OBJECT_TSDICTIONARY ,
  OBJECT_TSPARSER , OBJECT_TSTEMPLATE , OBJECT_TYPE , OBJECT_USER_MAPPING ,
  OBJECT_VIEW
}
 
enum  DropBehavior { DROP_RESTRICT , DROP_CASCADE }
 
enum  AlterTableType {
  AT_AddColumn , AT_AddColumnToView , AT_ColumnDefault , AT_CookedColumnDefault ,
  AT_DropNotNull , AT_SetNotNull , AT_SetExpression , AT_DropExpression ,
  AT_SetStatistics , AT_SetOptions , AT_ResetOptions , AT_SetStorage ,
  AT_SetCompression , AT_DropColumn , AT_AddIndex , AT_ReAddIndex ,
  AT_AddConstraint , AT_ReAddConstraint , AT_ReAddDomainConstraint , AT_AlterConstraint ,
  AT_ValidateConstraint , AT_AddIndexConstraint , AT_DropConstraint , AT_ReAddComment ,
  AT_AlterColumnType , AT_AlterColumnGenericOptions , AT_ChangeOwner , AT_ClusterOn ,
  AT_DropCluster , AT_SetLogged , AT_SetUnLogged , AT_DropOids ,
  AT_SetAccessMethod , AT_SetTableSpace , AT_SetRelOptions , AT_ResetRelOptions ,
  AT_ReplaceRelOptions , AT_EnableTrig , AT_EnableAlwaysTrig , AT_EnableReplicaTrig ,
  AT_DisableTrig , AT_EnableTrigAll , AT_DisableTrigAll , AT_EnableTrigUser ,
  AT_DisableTrigUser , AT_EnableRule , AT_EnableAlwaysRule , AT_EnableReplicaRule ,
  AT_DisableRule , AT_AddInherit , AT_DropInherit , AT_AddOf ,
  AT_DropOf , AT_ReplicaIdentity , AT_EnableRowSecurity , AT_DisableRowSecurity ,
  AT_ForceRowSecurity , AT_NoForceRowSecurity , AT_GenericOptions , AT_AttachPartition ,
  AT_DetachPartition , AT_DetachPartitionFinalize , AT_SplitPartition , AT_MergePartitions ,
  AT_AddIdentity , AT_SetIdentity , AT_DropIdentity , AT_ReAddStatistics
}
 
enum  AlterDomainType {
  AD_AlterDefault = 'T' , AD_DropNotNull = 'N' , AD_SetNotNull = 'O' , AD_AddConstraint = 'C' ,
  AD_DropConstraint = 'X' , AD_ValidateConstraint = 'V'
}
 
enum  GrantTargetType { ACL_TARGET_OBJECT , ACL_TARGET_ALL_IN_SCHEMA , ACL_TARGET_DEFAULTS }
 
enum  VariableSetKind {
  VAR_SET_VALUE , VAR_SET_DEFAULT , VAR_SET_CURRENT , VAR_SET_MULTI ,
  VAR_RESET , VAR_RESET_ALL
}
 
enum  ConstrType {
  CONSTR_NULL , CONSTR_NOTNULL , CONSTR_DEFAULT , CONSTR_IDENTITY ,
  CONSTR_GENERATED , CONSTR_CHECK , CONSTR_PRIMARY , CONSTR_UNIQUE ,
  CONSTR_EXCLUSION , CONSTR_FOREIGN , CONSTR_ATTR_DEFERRABLE , CONSTR_ATTR_NOT_DEFERRABLE ,
  CONSTR_ATTR_DEFERRED , CONSTR_ATTR_IMMEDIATE , CONSTR_ATTR_ENFORCED , CONSTR_ATTR_NOT_ENFORCED
}
 
enum  ImportForeignSchemaType { FDW_IMPORT_SCHEMA_ALL , FDW_IMPORT_SCHEMA_LIMIT_TO , FDW_IMPORT_SCHEMA_EXCEPT }
 
enum  RoleStmtType { ROLESTMT_ROLE , ROLESTMT_USER , ROLESTMT_GROUP }
 
enum  FetchDirection { FETCH_FORWARD , FETCH_BACKWARD , FETCH_ABSOLUTE , FETCH_RELATIVE }
 
enum  FetchDirectionKeywords {
  FETCH_KEYWORD_NONE = 0 , FETCH_KEYWORD_NEXT , FETCH_KEYWORD_PRIOR , FETCH_KEYWORD_FIRST ,
  FETCH_KEYWORD_LAST , FETCH_KEYWORD_ABSOLUTE , FETCH_KEYWORD_RELATIVE , FETCH_KEYWORD_ALL ,
  FETCH_KEYWORD_FORWARD , FETCH_KEYWORD_FORWARD_ALL , FETCH_KEYWORD_BACKWARD , FETCH_KEYWORD_BACKWARD_ALL
}
 
enum  FunctionParameterMode {
  FUNC_PARAM_IN = 'i' , FUNC_PARAM_OUT = 'o' , FUNC_PARAM_INOUT = 'b' , FUNC_PARAM_VARIADIC = 'v' ,
  FUNC_PARAM_TABLE = 't' , FUNC_PARAM_DEFAULT = 'd'
}
 
enum  TransactionStmtKind {
  TRANS_STMT_BEGIN , TRANS_STMT_START , TRANS_STMT_COMMIT , TRANS_STMT_ROLLBACK ,
  TRANS_STMT_SAVEPOINT , TRANS_STMT_RELEASE , TRANS_STMT_ROLLBACK_TO , TRANS_STMT_PREPARE ,
  TRANS_STMT_COMMIT_PREPARED , TRANS_STMT_ROLLBACK_PREPARED
}
 
enum  ViewCheckOption { NO_CHECK_OPTION , LOCAL_CHECK_OPTION , CASCADED_CHECK_OPTION }
 
enum  RepackCommand { REPACK_COMMAND_CLUSTER = 1 , REPACK_COMMAND_REPACK , REPACK_COMMAND_VACUUMFULL }
 
enum  DiscardMode { DISCARD_ALL , DISCARD_PLANS , DISCARD_SEQUENCES , DISCARD_TEMP }
 
enum  ReindexObjectType {
  REINDEX_OBJECT_INDEX , REINDEX_OBJECT_TABLE , REINDEX_OBJECT_SCHEMA , REINDEX_OBJECT_SYSTEM ,
  REINDEX_OBJECT_DATABASE
}
 
enum  AlterPropGraphElementKind { PROPGRAPH_ELEMENT_KIND_VERTEX = 1 , PROPGRAPH_ELEMENT_KIND_EDGE = 2 }
 
enum  AlterTSConfigType {
  ALTER_TSCONFIG_ADD_MAPPING , ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN , ALTER_TSCONFIG_REPLACE_DICT , ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN ,
  ALTER_TSCONFIG_DROP_MAPPING
}
 
enum  PublicationObjSpecType {
  PUBLICATIONOBJ_TABLE , PUBLICATIONOBJ_EXCEPT_TABLE , PUBLICATIONOBJ_TABLES_IN_SCHEMA , PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA ,
  PUBLICATIONOBJ_CONTINUATION
}
 
enum  PublicationAllObjType { PUBLICATION_ALL_TABLES , PUBLICATION_ALL_SEQUENCES }
 
enum  AlterPublicationAction { AP_AddObjects , AP_DropObjects , AP_SetObjects }
 
enum  AlterSubscriptionType {
  ALTER_SUBSCRIPTION_OPTIONS , ALTER_SUBSCRIPTION_SERVER , ALTER_SUBSCRIPTION_CONNECTION , ALTER_SUBSCRIPTION_SET_PUBLICATION ,
  ALTER_SUBSCRIPTION_ADD_PUBLICATION , ALTER_SUBSCRIPTION_DROP_PUBLICATION , ALTER_SUBSCRIPTION_REFRESH_PUBLICATION , ALTER_SUBSCRIPTION_REFRESH_SEQUENCES ,
  ALTER_SUBSCRIPTION_ENABLED , ALTER_SUBSCRIPTION_SKIP
}
 

Macro Definition Documentation

◆ ACL_ALTER_SYSTEM

#define ACL_ALTER_SYSTEM   (1<<13) /* for configuration parameters */

Definition at line 89 of file parsenodes.h.

◆ ACL_CONNECT

#define ACL_CONNECT   (1<<11) /* for databases */

Definition at line 87 of file parsenodes.h.

◆ ACL_CREATE

#define ACL_CREATE   (1<<9) /* for namespaces and databases */

Definition at line 85 of file parsenodes.h.

◆ ACL_CREATE_TEMP

#define ACL_CREATE_TEMP   (1<<10) /* for databases */

Definition at line 86 of file parsenodes.h.

◆ ACL_DELETE

#define ACL_DELETE   (1<<3)

Definition at line 79 of file parsenodes.h.

◆ ACL_EXECUTE

#define ACL_EXECUTE   (1<<7) /* for functions */

Definition at line 83 of file parsenodes.h.

◆ ACL_INSERT

#define ACL_INSERT   (1<<0) /* for relations */

Definition at line 76 of file parsenodes.h.

◆ ACL_MAINTAIN

#define ACL_MAINTAIN   (1<<14) /* for relations */

Definition at line 90 of file parsenodes.h.

◆ ACL_NO_RIGHTS

#define ACL_NO_RIGHTS   0

Definition at line 92 of file parsenodes.h.

◆ ACL_REFERENCES

#define ACL_REFERENCES   (1<<5)

Definition at line 81 of file parsenodes.h.

◆ ACL_SELECT

#define ACL_SELECT   (1<<1)

Definition at line 77 of file parsenodes.h.

◆ ACL_SELECT_FOR_UPDATE

#define ACL_SELECT_FOR_UPDATE   ACL_UPDATE

Definition at line 94 of file parsenodes.h.

◆ ACL_SET

#define ACL_SET   (1<<12) /* for configuration parameters */

Definition at line 88 of file parsenodes.h.

◆ ACL_TRIGGER

#define ACL_TRIGGER   (1<<6)

Definition at line 82 of file parsenodes.h.

◆ ACL_TRUNCATE

#define ACL_TRUNCATE   (1<<4)

Definition at line 80 of file parsenodes.h.

◆ ACL_UPDATE

#define ACL_UPDATE   (1<<2)

Definition at line 78 of file parsenodes.h.

◆ ACL_USAGE

#define ACL_USAGE   (1<<8) /* for various object types */

Definition at line 84 of file parsenodes.h.

◆ CURSOR_OPT_ASENSITIVE

#define CURSOR_OPT_ASENSITIVE   0x0010 /* ASENSITIVE */

Definition at line 3478 of file parsenodes.h.

◆ CURSOR_OPT_BINARY

#define CURSOR_OPT_BINARY   0x0001 /* BINARY */

Definition at line 3474 of file parsenodes.h.

◆ CURSOR_OPT_CUSTOM_PLAN

#define CURSOR_OPT_CUSTOM_PLAN   0x0400 /* force use of custom plan */

Definition at line 3483 of file parsenodes.h.

◆ CURSOR_OPT_FAST_PLAN

#define CURSOR_OPT_FAST_PLAN   0x0100 /* prefer fast-start plan */

Definition at line 3481 of file parsenodes.h.

◆ CURSOR_OPT_GENERIC_PLAN

#define CURSOR_OPT_GENERIC_PLAN   0x0200 /* force use of generic plan */

Definition at line 3482 of file parsenodes.h.

◆ CURSOR_OPT_HOLD

#define CURSOR_OPT_HOLD   0x0020 /* WITH HOLD */

Definition at line 3479 of file parsenodes.h.

◆ CURSOR_OPT_INSENSITIVE

#define CURSOR_OPT_INSENSITIVE   0x0008 /* INSENSITIVE */

Definition at line 3477 of file parsenodes.h.

◆ CURSOR_OPT_NO_SCROLL

#define CURSOR_OPT_NO_SCROLL   0x0004 /* NO SCROLL explicitly given */

Definition at line 3476 of file parsenodes.h.

◆ CURSOR_OPT_PARALLEL_OK

#define CURSOR_OPT_PARALLEL_OK   0x0800 /* parallel mode OK */

Definition at line 3484 of file parsenodes.h.

◆ CURSOR_OPT_SCROLL

#define CURSOR_OPT_SCROLL   0x0002 /* SCROLL explicitly given */

Definition at line 3475 of file parsenodes.h.

◆ FETCH_ALL

#define FETCH_ALL   LONG_MAX

Definition at line 3535 of file parsenodes.h.

◆ FKCONSTR_ACTION_CASCADE

#define FKCONSTR_ACTION_CASCADE   'c'

Definition at line 2909 of file parsenodes.h.

◆ FKCONSTR_ACTION_NOACTION

#define FKCONSTR_ACTION_NOACTION   'a'

Definition at line 2907 of file parsenodes.h.

◆ FKCONSTR_ACTION_RESTRICT

#define FKCONSTR_ACTION_RESTRICT   'r'

Definition at line 2908 of file parsenodes.h.

◆ FKCONSTR_ACTION_SETDEFAULT

#define FKCONSTR_ACTION_SETDEFAULT   'd'

Definition at line 2911 of file parsenodes.h.

◆ FKCONSTR_ACTION_SETNULL

#define FKCONSTR_ACTION_SETNULL   'n'

Definition at line 2910 of file parsenodes.h.

◆ FKCONSTR_MATCH_FULL

#define FKCONSTR_MATCH_FULL   'f'

Definition at line 2914 of file parsenodes.h.

◆ FKCONSTR_MATCH_PARTIAL

#define FKCONSTR_MATCH_PARTIAL   'p'

Definition at line 2915 of file parsenodes.h.

◆ FKCONSTR_MATCH_SIMPLE

#define FKCONSTR_MATCH_SIMPLE   's'

Definition at line 2916 of file parsenodes.h.

◆ FRAMEOPTION_BETWEEN

#define FRAMEOPTION_BETWEEN   0x00010 /* BETWEEN given? */

Definition at line 613 of file parsenodes.h.

◆ FRAMEOPTION_DEFAULTS

#define FRAMEOPTION_DEFAULTS
Value:
#define FRAMEOPTION_END_CURRENT_ROW
Definition parsenodes.h:619
#define FRAMEOPTION_START_UNBOUNDED_PRECEDING
Definition parsenodes.h:614
#define FRAMEOPTION_RANGE
Definition parsenodes.h:610

Definition at line 636 of file parsenodes.h.

643{
645 bool lateral; /* does it have LATERAL prefix? */
646 Node *subquery; /* the untransformed sub-select clause */
647 Alias *alias; /* table alias & optional column aliases */
649
650/*
651 * RangeFunction - function call appearing in a FROM clause
652 *
653 * functions is a List because we use this to represent the construct
654 * ROWS FROM(func1(...), func2(...), ...). Each element of this list is a
655 * two-element sublist, the first element being the untransformed function
656 * call tree, and the second element being a possibly-empty list of ColumnDef
657 * nodes representing any columndef list attached to that function within the
658 * ROWS FROM() syntax.
659 *
660 * alias and coldeflist represent any alias and/or columndef list attached
661 * at the top level. (We disallow coldeflist appearing both here and
662 * per-function, but that's checked in parse analysis, not by the grammar.)
663 */
664typedef struct RangeFunction
665{
667 bool lateral; /* does it have LATERAL prefix? */
668 bool ordinality; /* does it have WITH ORDINALITY suffix? */
669 bool is_rowsfrom; /* is result of ROWS FROM() syntax? */
670 List *functions; /* per-function information, see above */
671 Alias *alias; /* table alias & optional column aliases */
672 List *coldeflist; /* list of ColumnDef nodes to describe result
673 * of function returning RECORD */
675
676/*
677 * RangeTableFunc - raw form of "table functions" such as XMLTABLE
678 *
679 * Note: JSON_TABLE is also a "table function", but it uses JsonTable node,
680 * not RangeTableFunc.
681 */
682typedef struct RangeTableFunc
683{
685 bool lateral; /* does it have LATERAL prefix? */
686 Node *docexpr; /* document expression */
687 Node *rowexpr; /* row generator expression */
688 List *namespaces; /* list of namespaces as ResTarget */
689 List *columns; /* list of RangeTableFuncCol */
690 Alias *alias; /* table alias & optional column aliases */
691 ParseLoc location; /* token location, or -1 if unknown */
693
694/*
695 * RangeTableFuncCol - one column in a RangeTableFunc->columns
696 *
697 * If for_ordinality is true (FOR ORDINALITY), then the column is an int4
698 * column and the rest of the fields are ignored.
699 */
700typedef struct RangeTableFuncCol
701{
703 char *colname; /* name of generated column */
704 TypeName *typeName; /* type of generated column */
705 bool for_ordinality; /* does it have FOR ORDINALITY? */
706 bool is_not_null; /* does it have NOT NULL? */
707 Node *colexpr; /* column filter expression */
708 Node *coldefexpr; /* column default value expression */
709 ParseLoc location; /* token location, or -1 if unknown */
711
712/*
713 * RangeGraphTable - raw form of GRAPH_TABLE clause
714 */
715typedef struct RangeGraphTable
716{
720 List *columns;
721 Alias *alias; /* table alias & optional column aliases */
722 ParseLoc location; /* token location, or -1 if unknown */
724
725/*
726 * RangeTableSample - TABLESAMPLE appearing in a raw FROM clause
727 *
728 * This node, appearing only in raw parse trees, represents
729 * <relation> TABLESAMPLE <method> (<params>) REPEATABLE (<num>)
730 * Currently, the <relation> can only be a RangeVar, but we might in future
731 * allow RangeSubselect and other options. Note that the RangeTableSample
732 * is wrapped around the node representing the <relation>, rather than being
733 * a subfield of it.
734 */
735typedef struct RangeTableSample
736{
738 Node *relation; /* relation to be sampled */
739 List *method; /* sampling method name (possibly qualified) */
740 List *args; /* argument(s) for sampling method */
741 Node *repeatable; /* REPEATABLE expression, or NULL if none */
742 ParseLoc location; /* method name location, or -1 if unknown */
744
745/*
746 * ColumnDef - column definition (used in various creates)
747 *
748 * If the column has a default value, we may have the value expression
749 * in either "raw" form (an untransformed parse tree) or "cooked" form
750 * (a post-parse-analysis, executable expression tree), depending on
751 * how this ColumnDef node was created (by parsing, or by inheritance
752 * from an existing relation). We should never have both in the same node!
753 *
754 * Similarly, we may have a COLLATE specification in either raw form
755 * (represented as a CollateClause with arg==NULL) or cooked form
756 * (the collation's OID).
757 *
758 * The constraints list may contain a CONSTR_DEFAULT item in a raw
759 * parsetree produced by gram.y, but transformCreateStmt will remove
760 * the item and set raw_default instead. CONSTR_DEFAULT items
761 * should not appear in any subsequent processing.
762 */
763typedef struct ColumnDef
764{
766 char *colname; /* name of column */
767 TypeName *typeName; /* type of column */
768 char *compression; /* compression method for column */
769 int16 inhcount; /* number of times column is inherited */
770 bool is_local; /* column has local (non-inherited) def'n */
771 bool is_not_null; /* NOT NULL constraint specified? */
772 bool is_from_type; /* column definition came from table type */
773 char storage; /* attstorage setting, or 0 for default */
774 char *storage_name; /* attstorage setting name or NULL for default */
775 Node *raw_default; /* default value (untransformed parse tree) */
776 Node *cooked_default; /* default value (transformed expr tree) */
777 char identity; /* attidentity setting */
778 RangeVar *identitySequence; /* to store identity sequence name for
779 * ALTER TABLE ... ADD COLUMN */
780 char generated; /* attgenerated setting */
781 CollateClause *collClause; /* untransformed COLLATE spec, if any */
782 Oid collOid; /* collation OID (InvalidOid if not set) */
783 List *constraints; /* other constraints on column */
784 List *fdwoptions; /* per-column FDW options */
785 ParseLoc location; /* parse location, or -1 if none/unknown */
786} ColumnDef;
787
788/*
789 * TableLikeClause - CREATE TABLE ( ... LIKE ... ) clause
790 */
791typedef struct TableLikeClause
792{
795 bits32 options; /* OR of TableLikeOption flags */
796 Oid relationOid; /* If table has been looked up, its OID */
798
799typedef enum TableLikeOption
800{
812
813/*
814 * IndexElem - index parameters (used in CREATE INDEX, and in ON CONFLICT)
815 *
816 * For a plain index attribute, 'name' is the name of the table column to
817 * index, and 'expr' is NULL. For an index expression, 'name' is NULL and
818 * 'expr' is the expression tree.
819 */
820typedef struct IndexElem
821{
823 char *name; /* name of attribute to index, or NULL */
824 Node *expr; /* expression to index, or NULL */
825 char *indexcolname; /* name for index column; NULL = default */
826 List *collation; /* name of collation; NIL = default */
827 List *opclass; /* name of desired opclass; NIL = default */
828 List *opclassopts; /* opclass-specific options, or NIL */
829 SortByDir ordering; /* ASC/DESC/default */
830 SortByNulls nulls_ordering; /* FIRST/LAST/default */
831 ParseLoc location; /* token location, or -1 if unknown */
832} IndexElem;
833
834/*
835 * DefElem - a generic "name = value" option definition
836 *
837 * In some contexts the name can be qualified. Also, certain SQL commands
838 * allow a SET/ADD/DROP action to be attached to option settings, so it's
839 * convenient to carry a field for that too. (Note: currently, it is our
840 * practice that the grammar allows namespace and action only in statements
841 * where they are relevant; C code can just ignore those fields in other
842 * statements.)
843 */
844typedef enum DefElemAction
845{
846 DEFELEM_UNSPEC, /* no action given */
851
852typedef struct DefElem
853{
855 char *defnamespace; /* NULL if unqualified name */
856 char *defname;
857 Node *arg; /* typically Integer, Float, String, or
858 * TypeName */
859 DefElemAction defaction; /* unspecified action, or SET/ADD/DROP */
860 ParseLoc location; /* token location, or -1 if unknown */
861} DefElem;
862
863/*
864 * LockingClause - raw representation of FOR [NO KEY] UPDATE/[KEY] SHARE
865 * options
866 *
867 * Note: lockedRels == NIL means "all relations in query". Otherwise it
868 * is a list of RangeVar nodes. (We use RangeVar mainly because it carries
869 * a location field --- currently, parse analysis insists on unqualified
870 * names in LockingClause.)
871 */
872typedef struct LockingClause
873{
875 List *lockedRels; /* FOR [KEY] UPDATE/SHARE relations */
877 LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED */
879
880/*
881 * XMLSERIALIZE (in raw parse tree only)
882 */
883typedef struct XmlSerialize
884{
886 XmlOptionType xmloption; /* DOCUMENT or CONTENT */
887 Node *expr;
889 bool indent; /* [NO] INDENT */
890 ParseLoc location; /* token location, or -1 if unknown */
892
893/* Partitioning related definitions */
894
895/*
896 * PartitionElem - parse-time representation of a single partition key
897 *
898 * expr can be either a raw expression tree or a parse-analyzed expression.
899 * We don't store these on-disk, though.
900 */
901typedef struct PartitionElem
902{
904 char *name; /* name of column to partition on, or NULL */
905 Node *expr; /* expression to partition on, or NULL */
906 List *collation; /* name of collation; NIL = default */
907 List *opclass; /* name of desired opclass; NIL = default */
908 ParseLoc location; /* token location, or -1 if unknown */
910
911typedef enum PartitionStrategy
912{
917
918/*
919 * PartitionSpec - parse-time representation of a partition key specification
920 *
921 * This represents the key space we will be partitioning on.
922 */
923typedef struct PartitionSpec
924{
927 List *partParams; /* List of PartitionElems */
928 ParseLoc location; /* token location, or -1 if unknown */
930
931/*
932 * PartitionBoundSpec - a partition bound specification
933 *
934 * This represents the portion of the partition key space assigned to a
935 * particular partition. These are stored on disk in pg_class.relpartbound.
936 */
938{
940
941 char strategy; /* see PARTITION_STRATEGY codes above */
942 bool is_default; /* is it a default partition bound? */
943
944 /* Partitioning info for HASH strategy: */
945 int modulus;
946 int remainder;
947
948 /* Partitioning info for LIST strategy: */
949 List *listdatums; /* List of Consts (or A_Consts in raw tree) */
950
951 /* Partitioning info for RANGE strategy: */
952 List *lowerdatums; /* List of PartitionRangeDatums */
953 List *upperdatums; /* List of PartitionRangeDatums */
954
955 ParseLoc location; /* token location, or -1 if unknown */
956};
957
958/*
959 * PartitionRangeDatum - one of the values in a range partition bound
960 *
961 * This can be MINVALUE, MAXVALUE or a specific bounded value.
962 */
963typedef enum PartitionRangeDatumKind
964{
965 PARTITION_RANGE_DATUM_MINVALUE = -1, /* less than any other value */
966 PARTITION_RANGE_DATUM_VALUE = 0, /* a specific (bounded) value */
967 PARTITION_RANGE_DATUM_MAXVALUE = 1, /* greater than any other value */
969
970typedef struct PartitionRangeDatum
971{
973
975 Node *value; /* Const (or A_Const in raw tree), if kind is
976 * PARTITION_RANGE_DATUM_VALUE, else NULL */
977
978 ParseLoc location; /* token location, or -1 if unknown */
980
981/*
982 * PartitionDesc - info about a single partition for the ALTER TABLE SPLIT
983 * PARTITION command
984 */
985typedef struct SinglePartitionSpec
986{
988
989 RangeVar *name; /* name of partition */
990 PartitionBoundSpec *bound; /* FOR VALUES, if attaching */
992
993/*
994 * PartitionCmd - info for ALTER TABLE/INDEX ATTACH/DETACH PARTITION and for
995 * ALTER TABLE SPLIT/MERGE PARTITION(S) commands
996 */
997typedef struct PartitionCmd
998{
1000
1001 /* name of partition to attach/detach/merge/split */
1002 RangeVar *name;
1003
1004 /* FOR VALUES, if attaching */
1006
1007 /*
1008 * list of partitions to be split/merged, used in ALTER TABLE MERGE
1009 * PARTITIONS and ALTER TABLE SPLIT PARTITIONS. For merge partitions,
1010 * partlist is a list of RangeVar; For split partition, it is a list of
1011 * SinglePartitionSpec.
1012 */
1013 List *partlist;
1014
1015 bool concurrent;
1016} PartitionCmd;
1017
1018/*
1019 * Nodes for graph pattern
1020 */
1021
1022typedef struct GraphPattern
1023{
1024 NodeTag type;
1027} GraphPattern;
1028
1029typedef enum GraphElementPatternKind
1030{
1035 PAREN_EXPR,
1037
1038#define IS_EDGE_PATTERN(kind) ((kind) == EDGE_PATTERN_ANY || \
1039 (kind) == EDGE_PATTERN_RIGHT || \
1040 (kind) == EDGE_PATTERN_LEFT)
1041
1042typedef struct GraphElementPattern
1043{
1044 NodeTag type;
1046 const char *variable;
1047 Node *labelexpr;
1048 List *subexpr;
1053
1054/****************************************************************************
1055 * Nodes for a Query tree
1056 ****************************************************************************/
1057
1058/*--------------------
1059 * RangeTblEntry -
1060 * A range table is a List of RangeTblEntry nodes.
1061 *
1062 * A range table entry may represent a plain relation, a sub-select in
1063 * FROM, or the result of a JOIN clause. (Only explicit JOIN syntax
1064 * produces an RTE, not the implicit join resulting from multiple FROM
1065 * items. This is because we only need the RTE to deal with SQL features
1066 * like outer joins and join-output-column aliasing.) Other special
1067 * RTE types also exist, as indicated by RTEKind.
1068 *
1069 * Note that we consider RTE_RELATION to cover anything that has a pg_class
1070 * entry. relkind distinguishes the sub-cases.
1071 *
1072 * alias is an Alias node representing the AS alias-clause attached to the
1073 * FROM expression, or NULL if no clause.
1074 *
1075 * eref is the table reference name and column reference names (either
1076 * real or aliases). Note that system columns (OID etc) are not included
1077 * in the column list.
1078 * eref->aliasname is required to be present, and should generally be used
1079 * to identify the RTE for error messages etc.
1080 *
1081 * In RELATION RTEs, the colnames in both alias and eref are indexed by
1082 * physical attribute number; this means there must be colname entries for
1083 * dropped columns. When building an RTE we insert empty strings ("") for
1084 * dropped columns. Note however that a stored rule may have nonempty
1085 * colnames for columns dropped since the rule was created (and for that
1086 * matter the colnames might be out of date due to column renamings).
1087 * The same comments apply to FUNCTION RTEs when a function's return type
1088 * is a named composite type.
1089 *
1090 * In JOIN RTEs, the colnames in both alias and eref are one-to-one with
1091 * joinaliasvars entries. A JOIN RTE will omit columns of its inputs when
1092 * those columns are known to be dropped at parse time. Again, however,
1093 * a stored rule might contain entries for columns dropped since the rule
1094 * was created. (This is only possible for columns not actually referenced
1095 * in the rule.) When loading a stored rule, we replace the joinaliasvars
1096 * items for any such columns with null pointers. (We can't simply delete
1097 * them from the joinaliasvars list, because that would affect the attnums
1098 * of Vars referencing the rest of the list.)
1099 *
1100 * inFromCl marks those range variables that are listed in the FROM clause.
1101 * It's false for RTEs that are added to a query behind the scenes, such
1102 * as the NEW and OLD variables for a rule, or the subqueries of a UNION.
1103 * This flag is not used during parsing (except in transformLockingClause,
1104 * q.v.); the parser now uses a separate "namespace" data structure to
1105 * control visibility. But it is needed by ruleutils.c to determine
1106 * whether RTEs should be shown in decompiled queries.
1107 *
1108 * securityQuals is a list of security barrier quals (boolean expressions),
1109 * to be tested in the listed order before returning a row from the
1110 * relation. It is always NIL in parser output. Entries are added by the
1111 * rewriter to implement security-barrier views and/or row-level security.
1112 * Note that the planner turns each boolean expression into an implicitly
1113 * AND'ed sublist, as is its usual habit with qualification expressions.
1114 *--------------------
1115 */
1116typedef enum RTEKind
1117{
1118 RTE_RELATION, /* ordinary relation reference */
1119 RTE_SUBQUERY, /* subquery in FROM */
1120 RTE_JOIN, /* join */
1121 RTE_FUNCTION, /* function in FROM */
1122 RTE_TABLEFUNC, /* TableFunc(.., column list) */
1123 RTE_VALUES, /* VALUES (<exprlist>), (<exprlist>), ... */
1124 RTE_CTE, /* common table expr (WITH list element) */
1125 RTE_NAMEDTUPLESTORE, /* tuplestore, e.g. for AFTER triggers */
1126 RTE_GRAPH_TABLE, /* GRAPH_TABLE clause */
1127 RTE_RESULT, /* RTE represents an empty FROM clause; such
1128 * RTEs are added by the planner, they're not
1129 * present during parsing or rewriting */
1130 RTE_GROUP, /* the grouping step */
1131} RTEKind;
1132
1133typedef struct RangeTblEntry
1134{
1136
1137 NodeTag type;
1138
1139 /*
1140 * Fields valid in all RTEs:
1141 *
1142 * put alias + eref first to make dump more legible
1143 */
1144 /* user-written alias clause, if any */
1146
1147 /*
1148 * Expanded reference names. This uses a custom query jumble function so
1149 * that the table name is included in the computation, but not its list of
1150 * columns.
1151 */
1153
1154 RTEKind rtekind; /* see above */
1155
1156 /*
1157 * Fields valid for a plain relation RTE (else zero):
1158 *
1159 * inh is true for relation references that should be expanded to include
1160 * inheritance children, if the rel has any. In the parser, this will
1161 * only be true for RTE_RELATION entries. The planner also uses this
1162 * field to mark RTE_SUBQUERY entries that contain UNION ALL queries that
1163 * it has flattened into pulled-up subqueries (creating a structure much
1164 * like the effects of inheritance).
1165 *
1166 * rellockmode is really LOCKMODE, but it's declared int to avoid having
1167 * to include lock-related headers here. It must be RowExclusiveLock if
1168 * the RTE is an INSERT/UPDATE/DELETE/MERGE target, else RowShareLock if
1169 * the RTE is a SELECT FOR UPDATE/FOR SHARE target, else AccessShareLock.
1170 *
1171 * Note: in some cases, rule expansion may result in RTEs that are marked
1172 * with RowExclusiveLock even though they are not the target of the
1173 * current query; this happens if a DO ALSO rule simply scans the original
1174 * target table. We leave such RTEs with their original lockmode so as to
1175 * avoid getting an additional, lesser lock.
1176 *
1177 * perminfoindex is 1-based index of the RTEPermissionInfo belonging to
1178 * this RTE in the containing struct's list of same; 0 if permissions need
1179 * not be checked for this RTE.
1180 *
1181 * As a special case, relid, relkind, rellockmode, and perminfoindex can
1182 * also be set (nonzero) in an RTE_SUBQUERY RTE. This occurs when we
1183 * convert an RTE_RELATION RTE naming a view into an RTE_SUBQUERY
1184 * containing the view's query. We still need to perform run-time locking
1185 * and permission checks on the view, even though it's not directly used
1186 * in the query anymore, and the most expedient way to do that is to
1187 * retain these fields from the old state of the RTE.
1188 *
1189 * As a special case, RTE_NAMEDTUPLESTORE can also set relid to indicate
1190 * that the tuple format of the tuplestore is the same as the referenced
1191 * relation. This allows plans referencing AFTER trigger transition
1192 * tables to be invalidated if the underlying table is altered.
1193 */
1194 /* OID of the relation */
1196 /* inheritance requested? */
1197 bool inh;
1198 /* relation kind (see pg_class.relkind) */
1199 char relkind pg_node_attr(query_jumble_ignore);
1200 /* lock level that query requires on the rel */
1202 /* index of RTEPermissionInfo entry, or 0 */
1204 /* sampling info, or NULL */
1206
1207 /*
1208 * Fields valid for a subquery RTE (else NULL):
1209 */
1210 /* the sub-query */
1211 Query *subquery;
1212 /* is from security_barrier view? */
1213 bool security_barrier pg_node_attr(query_jumble_ignore);
1214
1215 /*
1216 * Fields valid for a join RTE (else NULL/zero):
1217 *
1218 * joinaliasvars is a list of (usually) Vars corresponding to the columns
1219 * of the join result. An alias Var referencing column K of the join
1220 * result can be replaced by the K'th element of joinaliasvars --- but to
1221 * simplify the task of reverse-listing aliases correctly, we do not do
1222 * that until planning time. In detail: an element of joinaliasvars can
1223 * be a Var of one of the join's input relations, or such a Var with an
1224 * implicit coercion to the join's output column type, or a COALESCE
1225 * expression containing the two input column Vars (possibly coerced).
1226 * Elements beyond the first joinmergedcols entries are always just Vars,
1227 * and are never referenced from elsewhere in the query (that is, join
1228 * alias Vars are generated only for merged columns). We keep these
1229 * entries only because they're needed in expandRTE() and similar code.
1230 *
1231 * Vars appearing within joinaliasvars are marked with varnullingrels sets
1232 * that describe the nulling effects of this join and lower ones. This is
1233 * essential for FULL JOIN cases, because the COALESCE expression only
1234 * describes the semantics correctly if its inputs have been nulled by the
1235 * join. For other cases, it allows expandRTE() to generate a valid
1236 * representation of the join's output without consulting additional
1237 * parser state.
1238 *
1239 * Within a Query loaded from a stored rule, it is possible for non-merged
1240 * joinaliasvars items to be null pointers, which are placeholders for
1241 * (necessarily unreferenced) columns dropped since the rule was made.
1242 * Also, once planning begins, joinaliasvars items can be almost anything,
1243 * as a result of subquery-flattening substitutions.
1244 *
1245 * joinleftcols is an integer list of physical column numbers of the left
1246 * join input rel that are included in the join; likewise joinrighttcols
1247 * for the right join input rel. (Which rels those are can be determined
1248 * from the associated JoinExpr.) If the join is USING/NATURAL, then the
1249 * first joinmergedcols entries in each list identify the merged columns.
1250 * The merged columns come first in the join output, then remaining
1251 * columns of the left input, then remaining columns of the right.
1252 *
1253 * Note that input columns could have been dropped after creation of a
1254 * stored rule, if they are not referenced in the query (in particular,
1255 * merged columns could not be dropped); this is not accounted for in
1256 * joinleftcols/joinrighttcols.
1257 */
1259 /* number of merged (JOIN USING) columns */
1261 /* list of alias-var expansions */
1263 /* left-side input column numbers */
1265 /* right-side input column numbers */
1267
1268 /*
1269 * join_using_alias is an alias clause attached directly to JOIN/USING. It
1270 * is different from the alias field (above) in that it does not hide the
1271 * range variables of the tables being joined.
1272 */
1274
1275 /*
1276 * Fields valid for a function RTE (else NIL/zero):
1277 *
1278 * When funcordinality is true, the eref->colnames list includes an alias
1279 * for the ordinality column. The ordinality column is otherwise
1280 * implicit, and must be accounted for "by hand" in places such as
1281 * expandRTE().
1282 */
1283 /* list of RangeTblFunction nodes */
1284 List *functions;
1285 /* is this called WITH ORDINALITY? */
1286 bool funcordinality;
1287
1288 /*
1289 * Fields valid for a TableFunc RTE (else NULL):
1290 */
1292
1293 /*
1294 * Fields valid for a graph table RTE (else NULL):
1295 */
1298
1299 /*
1300 * Fields valid for a values RTE (else NIL):
1301 */
1302 /* list of expression lists */
1304
1305 /*
1306 * Fields valid for a CTE RTE (else NULL/zero):
1307 */
1308 /* name of the WITH list item */
1309 char *ctename;
1310 /* number of query levels up */
1312 /* is this a recursive self-reference? */
1314
1315 /*
1316 * Fields valid for CTE, VALUES, ENR, and TableFunc RTEs (else NIL):
1317 *
1318 * We need these for CTE RTEs so that the types of self-referential
1319 * columns are well-defined. For VALUES RTEs, storing these explicitly
1320 * saves having to re-determine the info by scanning the values_lists. For
1321 * ENRs, we store the types explicitly here (we could get the information
1322 * from the catalogs if 'relid' was supplied, but we'd still need these
1323 * for TupleDesc-based ENRs, so we might as well always store the type
1324 * info here). For TableFuncs, these fields are redundant with data in
1325 * the TableFunc node, but keeping them here allows some code sharing with
1326 * the other cases.
1327 *
1328 * For ENRs only, we have to consider the possibility of dropped columns.
1329 * A dropped column is included in these lists, but it will have zeroes in
1330 * all three lists (as well as an empty-string entry in eref). Testing
1331 * for zero coltype is the standard way to detect a dropped column.
1332 */
1333 /* OID list of column type OIDs */
1335 /* integer list of column typmods */
1337 /* OID list of column collation OIDs */
1339
1340 /*
1341 * Fields valid for ENR RTEs (else NULL/zero):
1342 */
1343 /* name of ephemeral named relation */
1344 char *enrname;
1345 /* estimated or actual from caller */
1347
1348 /*
1349 * Fields valid for a GROUP RTE (else NIL):
1350 */
1351 /* list of grouping expressions */
1353
1354 /*
1355 * Fields valid in all RTEs:
1356 */
1357 /* was LATERAL specified? */
1358 bool lateral pg_node_attr(query_jumble_ignore);
1359 /* present in FROM clause? */
1361 /* security barrier quals to apply, if any */
1364
1365/*
1366 * RTEPermissionInfo
1367 * Per-relation information for permission checking. Added to the Query
1368 * node by the parser when adding the corresponding RTE to the query
1369 * range table and subsequently editorialized on by the rewriter if
1370 * needed after rule expansion.
1371 *
1372 * Only the relations directly mentioned in the query are checked for
1373 * access permissions by the core executor, so only their RTEPermissionInfos
1374 * are present in the Query. However, extensions may want to check inheritance
1375 * children too, depending on the value of rte->inh, so it's copied in 'inh'
1376 * for their perusal.
1377 *
1378 * requiredPerms and checkAsUser specify run-time access permissions checks
1379 * to be performed at query startup. The user must have *all* of the
1380 * permissions that are OR'd together in requiredPerms (never 0!). If
1381 * checkAsUser is not zero, then do the permissions checks using the access
1382 * rights of that user, not the current effective user ID. (This allows rules
1383 * to act as setuid gateways.)
1384 *
1385 * For SELECT/INSERT/UPDATE permissions, if the user doesn't have table-wide
1386 * permissions then it is sufficient to have the permissions on all columns
1387 * identified in selectedCols (for SELECT) and/or insertedCols and/or
1388 * updatedCols (INSERT with ON CONFLICT DO UPDATE may have all 3).
1389 * selectedCols, insertedCols and updatedCols are bitmapsets, which cannot have
1390 * negative integer members, so we subtract FirstLowInvalidHeapAttributeNumber
1391 * from column numbers before storing them in these fields. A whole-row Var
1392 * reference is represented by setting the bit for InvalidAttrNumber.
1393 *
1394 * updatedCols is also used in some other places, for example, to determine
1395 * which triggers to fire and in FDWs to know which changed columns they need
1396 * to ship off.
1397 */
1398typedef struct RTEPermissionInfo
1399{
1400 NodeTag type;
1401
1402 Oid relid; /* relation OID */
1403 bool inh; /* separately check inheritance children? */
1404 AclMode requiredPerms; /* bitmask of required access permissions */
1405 Oid checkAsUser; /* if valid, check access as this role */
1406 Bitmapset *selectedCols; /* columns needing SELECT permission */
1407 Bitmapset *insertedCols; /* columns needing INSERT permission */
1408 Bitmapset *updatedCols; /* columns needing UPDATE permission */
1410
1411/*
1412 * RangeTblFunction -
1413 * RangeTblEntry subsidiary data for one function in a FUNCTION RTE.
1414 *
1415 * If the function had a column definition list (required for an
1416 * otherwise-unspecified RECORD result), funccolnames lists the names given
1417 * in the definition list, funccoltypes lists their declared column types,
1418 * funccoltypmods lists their typmods, funccolcollations their collations.
1419 * Otherwise, those fields are NIL.
1420 *
1421 * Notice we don't attempt to store info about the results of functions
1422 * returning named composite types, because those can change from time to
1423 * time. We do however remember how many columns we thought the type had
1424 * (including dropped columns!), so that we can successfully ignore any
1425 * columns added after the query was parsed.
1426 *
1427 * The query jumbling only needs to track the function expression.
1428 */
1429typedef struct RangeTblFunction
1430{
1431 NodeTag type;
1432
1433 Node *funcexpr; /* expression tree for func call */
1434 /* number of columns it contributes to RTE */
1436 /* These fields record the contents of a column definition list, if any: */
1437 /* column names (list of String) */
1439 /* OID list of column type OIDs */
1441 /* integer list of column typmods */
1443 /* OID list of column collation OIDs */
1445
1446 /* This is set during planning for use by the executor: */
1447 /* PARAM_EXEC Param IDs affecting this func */
1450
1451/*
1452 * TableSampleClause - TABLESAMPLE appearing in a transformed FROM clause
1453 *
1454 * Unlike RangeTableSample, this is a subnode of the relevant RangeTblEntry.
1455 */
1456typedef struct TableSampleClause
1457{
1458 NodeTag type;
1459 Oid tsmhandler; /* OID of the tablesample handler function */
1460 List *args; /* tablesample argument expression(s) */
1461 Expr *repeatable; /* REPEATABLE expression, or NULL if none */
1463
1464/*
1465 * WithCheckOption -
1466 * representation of WITH CHECK OPTION checks to be applied to new tuples
1467 * when inserting/updating an auto-updatable view, or RLS WITH CHECK
1468 * policies to be applied when inserting/updating a relation with RLS.
1469 */
1470typedef enum WCOKind
1471{
1472 WCO_VIEW_CHECK, /* WCO on an auto-updatable view */
1473 WCO_RLS_INSERT_CHECK, /* RLS INSERT WITH CHECK policy */
1474 WCO_RLS_UPDATE_CHECK, /* RLS UPDATE WITH CHECK policy */
1475 WCO_RLS_CONFLICT_CHECK, /* RLS ON CONFLICT DO SELECT/UPDATE USING
1476 * policy */
1477 WCO_RLS_MERGE_UPDATE_CHECK, /* RLS MERGE UPDATE USING policy */
1478 WCO_RLS_MERGE_DELETE_CHECK, /* RLS MERGE DELETE USING policy */
1479} WCOKind;
1480
1481typedef struct WithCheckOption
1482{
1483 NodeTag type;
1484 WCOKind kind; /* kind of WCO */
1485 char *relname; /* name of relation that specified the WCO */
1486 char *polname; /* name of RLS policy being checked */
1487 Node *qual; /* constraint qual to check */
1488 bool cascaded; /* true for a cascaded WCO on a view */
1490
1491/*
1492 * SortGroupClause -
1493 * representation of ORDER BY, GROUP BY, PARTITION BY,
1494 * DISTINCT, DISTINCT ON items
1495 *
1496 * You might think that ORDER BY is only interested in defining ordering,
1497 * and GROUP/DISTINCT are only interested in defining equality. However,
1498 * one way to implement grouping is to sort and then apply a "uniq"-like
1499 * filter. So it's also interesting to keep track of possible sort operators
1500 * for GROUP/DISTINCT, and in particular to try to sort for the grouping
1501 * in a way that will also yield a requested ORDER BY ordering. So we need
1502 * to be able to compare ORDER BY and GROUP/DISTINCT lists, which motivates
1503 * the decision to give them the same representation.
1504 *
1505 * tleSortGroupRef must match ressortgroupref of exactly one entry of the
1506 * query's targetlist; that is the expression to be sorted or grouped by.
1507 * eqop is the OID of the equality operator.
1508 * sortop is the OID of the ordering operator (a "<" or ">" operator),
1509 * or InvalidOid if not available.
1510 * nulls_first means about what you'd expect. If sortop is InvalidOid
1511 * then nulls_first is meaningless and should be set to false.
1512 * hashable is true if eqop is hashable (note this condition also depends
1513 * on the datatype of the input expression).
1514 *
1515 * In an ORDER BY item, all fields must be valid. (The eqop isn't essential
1516 * here, but it's cheap to get it along with the sortop, and requiring it
1517 * to be valid eases comparisons to grouping items.) Note that this isn't
1518 * actually enough information to determine an ordering: if the sortop is
1519 * collation-sensitive, a collation OID is needed too. We don't store the
1520 * collation in SortGroupClause because it's not available at the time the
1521 * parser builds the SortGroupClause; instead, consult the exposed collation
1522 * of the referenced targetlist expression to find out what it is.
1523 *
1524 * In a grouping item, eqop must be valid. If the eqop is a btree equality
1525 * operator, then sortop should be set to a compatible ordering operator.
1526 * We prefer to set eqop/sortop/nulls_first to match any ORDER BY item that
1527 * the query presents for the same tlist item. If there is none, we just
1528 * use the default ordering op for the datatype.
1529 *
1530 * If the tlist item's type has a hash opclass but no btree opclass, then
1531 * we will set eqop to the hash equality operator, sortop to InvalidOid,
1532 * and nulls_first to false. A grouping item of this kind can only be
1533 * implemented by hashing, and of course it'll never match an ORDER BY item.
1534 *
1535 * The hashable flag is provided since we generally have the requisite
1536 * information readily available when the SortGroupClause is constructed,
1537 * and it's relatively expensive to get it again later. Note there is no
1538 * need for a "sortable" flag since OidIsValid(sortop) serves the purpose.
1539 *
1540 * A query might have both ORDER BY and DISTINCT (or DISTINCT ON) clauses.
1541 * In SELECT DISTINCT, the distinctClause list is as long or longer than the
1542 * sortClause list, while in SELECT DISTINCT ON it's typically shorter.
1543 * The two lists must match up to the end of the shorter one --- the parser
1544 * rearranges the distinctClause if necessary to make this true. (This
1545 * restriction ensures that only one sort step is needed to both satisfy the
1546 * ORDER BY and set up for the Unique step. This is semantically necessary
1547 * for DISTINCT ON, and presents no real drawback for DISTINCT.)
1548 */
1549typedef struct SortGroupClause
1550{
1551 NodeTag type;
1552 Index tleSortGroupRef; /* reference into targetlist */
1553 Oid eqop; /* the equality operator ('=' op) */
1554 Oid sortop; /* the ordering operator ('<' op), or 0 */
1555 bool reverse_sort; /* is sortop a "greater than" operator? */
1556 bool nulls_first; /* do NULLs come before normal values? */
1557 /* can eqop be implemented by hashing? */
1558 bool hashable pg_node_attr(query_jumble_ignore);
1560
1561/*
1562 * GroupingSet -
1563 * representation of CUBE, ROLLUP and GROUPING SETS clauses
1564 *
1565 * In a Query with grouping sets, the groupClause contains a flat list of
1566 * SortGroupClause nodes for each distinct expression used. The actual
1567 * structure of the GROUP BY clause is given by the groupingSets tree.
1568 *
1569 * In the raw parser output, GroupingSet nodes (of all types except SIMPLE
1570 * which is not used) are potentially mixed in with the expressions in the
1571 * groupClause of the SelectStmt. (An expression can't contain a GroupingSet,
1572 * but a list may mix GroupingSet and expression nodes.) At this stage, the
1573 * content of each node is a list of expressions, some of which may be RowExprs
1574 * which represent sublists rather than actual row constructors, and nested
1575 * GroupingSet nodes where legal in the grammar. The structure directly
1576 * reflects the query syntax.
1577 *
1578 * In parse analysis, the transformed expressions are used to build the tlist
1579 * and groupClause list (of SortGroupClause nodes), and the groupingSets tree
1580 * is eventually reduced to a fixed format:
1581 *
1582 * EMPTY nodes represent (), and obviously have no content
1583 *
1584 * SIMPLE nodes represent a list of one or more expressions to be treated as an
1585 * atom by the enclosing structure; the content is an integer list of
1586 * ressortgroupref values (see SortGroupClause)
1587 *
1588 * CUBE and ROLLUP nodes contain a list of one or more SIMPLE nodes.
1589 *
1590 * SETS nodes contain a list of EMPTY, SIMPLE, CUBE or ROLLUP nodes, but after
1591 * parse analysis they cannot contain more SETS nodes; enough of the syntactic
1592 * transforms of the spec have been applied that we no longer have arbitrarily
1593 * deep nesting (though we still preserve the use of cube/rollup).
1594 *
1595 * Note that if the groupingSets tree contains no SIMPLE nodes (only EMPTY
1596 * nodes at the leaves), then the groupClause will be empty, but this is still
1597 * an aggregation query (similar to using aggs or HAVING without GROUP BY).
1598 *
1599 * As an example, the following clause:
1600 *
1601 * GROUP BY GROUPING SETS ((a,b), CUBE(c,(d,e)))
1602 *
1603 * looks like this after raw parsing:
1604 *
1605 * SETS( RowExpr(a,b) , CUBE( c, RowExpr(d,e) ) )
1606 *
1607 * and parse analysis converts it to:
1608 *
1609 * SETS( SIMPLE(1,2), CUBE( SIMPLE(3), SIMPLE(4,5) ) )
1610 */
1611typedef enum GroupingSetKind
1612{
1619
1620typedef struct GroupingSet
1621{
1622 NodeTag type;
1624 List *content;
1626} GroupingSet;
1627
1628/*
1629 * WindowClause -
1630 * transformed representation of WINDOW and OVER clauses
1631 *
1632 * A parsed Query's windowClause list contains these structs. "name" is set
1633 * if the clause originally came from WINDOW, and is NULL if it originally
1634 * was an OVER clause (but note that we collapse out duplicate OVERs).
1635 * partitionClause and orderClause are lists of SortGroupClause structs.
1636 * partitionClause is sanitized by the query planner to remove any columns or
1637 * expressions belonging to redundant PathKeys.
1638 * If we have RANGE with offset PRECEDING/FOLLOWING, the semantics of that are
1639 * specified by startInRangeFunc/inRangeColl/inRangeAsc/inRangeNullsFirst
1640 * for the start offset, or endInRangeFunc/inRange* for the end offset.
1641 * winref is an ID number referenced by WindowFunc nodes; it must be unique
1642 * among the members of a Query's windowClause list.
1643 * When refname isn't null, the partitionClause is always copied from there;
1644 * the orderClause might or might not be copied (see copiedOrder); the framing
1645 * options are never copied, per spec.
1646 *
1647 * The information relevant for the query jumbling is the partition clause
1648 * type and its bounds.
1649 */
1650typedef struct WindowClause
1651{
1652 NodeTag type;
1653 /* window name (NULL in an OVER clause) */
1655 /* referenced window name, if any */
1656 char *refname pg_node_attr(query_jumble_ignore);
1657 List *partitionClause; /* PARTITION BY list */
1658 /* ORDER BY list */
1660 int frameOptions; /* frame_clause options, see WindowDef */
1661 Node *startOffset; /* expression for starting bound, if any */
1662 Node *endOffset; /* expression for ending bound, if any */
1663 /* in_range function for startOffset */
1664 Oid startInRangeFunc pg_node_attr(query_jumble_ignore);
1665 /* in_range function for endOffset */
1666 Oid endInRangeFunc pg_node_attr(query_jumble_ignore);
1667 /* collation for in_range tests */
1669 /* use ASC sort order for in_range tests? */
1670 bool inRangeAsc pg_node_attr(query_jumble_ignore);
1671 /* nulls sort first for in_range tests? */
1672 bool inRangeNullsFirst pg_node_attr(query_jumble_ignore);
1673 Index winref; /* ID referenced by window functions */
1674 /* did we copy orderClause from refname? */
1676} WindowClause;
1677
1678/*
1679 * RowMarkClause -
1680 * parser output representation of FOR [KEY] UPDATE/SHARE clauses
1681 *
1682 * Query.rowMarks contains a separate RowMarkClause node for each relation
1683 * identified as a FOR [KEY] UPDATE/SHARE target. If one of these clauses
1684 * is applied to a subquery, we generate RowMarkClauses for all normal and
1685 * subquery rels in the subquery, but they are marked pushedDown = true to
1686 * distinguish them from clauses that were explicitly written at this query
1687 * level. Also, Query.hasForUpdate tells whether there were explicit FOR
1688 * UPDATE/SHARE/KEY SHARE clauses in the current query level.
1689 */
1690typedef struct RowMarkClause
1691{
1692 NodeTag type;
1693 Index rti; /* range table index of target relation */
1695 LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED */
1696 bool pushedDown; /* pushed down from higher query level? */
1698
1699/*
1700 * WithClause -
1701 * representation of WITH clause
1702 *
1703 * Note: WithClause does not propagate into the Query representation;
1704 * but CommonTableExpr does.
1705 */
1706typedef struct WithClause
1707{
1708 NodeTag type;
1709 List *ctes; /* list of CommonTableExprs */
1710 bool recursive; /* true = WITH RECURSIVE */
1711 ParseLoc location; /* token location, or -1 if unknown */
1712} WithClause;
1713
1714/*
1715 * InferClause -
1716 * ON CONFLICT unique index inference clause
1717 *
1718 * Note: InferClause does not propagate into the Query representation.
1719 */
1720typedef struct InferClause
1721{
1722 NodeTag type;
1723 List *indexElems; /* IndexElems to infer unique index */
1724 Node *whereClause; /* qualification (partial-index predicate) */
1725 char *conname; /* Constraint name, or NULL if unnamed */
1726 ParseLoc location; /* token location, or -1 if unknown */
1727} InferClause;
1728
1729/*
1730 * OnConflictClause -
1731 * representation of ON CONFLICT clause
1732 *
1733 * Note: OnConflictClause does not propagate into the Query representation.
1734 */
1735typedef struct OnConflictClause
1736{
1737 NodeTag type;
1738 OnConflictAction action; /* DO NOTHING, SELECT, or UPDATE */
1739 InferClause *infer; /* Optional index inference clause */
1740 LockClauseStrength lockStrength; /* lock strength for DO SELECT */
1741 List *targetList; /* target list (of ResTarget) for DO UPDATE */
1742 Node *whereClause; /* qualifications */
1743 ParseLoc location; /* token location, or -1 if unknown */
1745
1746/*
1747 * CommonTableExpr -
1748 * representation of WITH list element
1749 */
1750
1751typedef enum CTEMaterialize
1752{
1753 CTEMaterializeDefault, /* no option specified */
1754 CTEMaterializeAlways, /* MATERIALIZED */
1755 CTEMaterializeNever, /* NOT MATERIALIZED */
1757
1758typedef struct CTESearchClause
1759{
1760 NodeTag type;
1763 char *search_seq_column;
1766
1767typedef struct CTECycleClause
1768{
1769 NodeTag type;
1771 char *cycle_mark_column;
1774 char *cycle_path_column;
1776 /* These fields are set during parse analysis: */
1777 Oid cycle_mark_type; /* common type of _value and _default */
1780 Oid cycle_mark_neop; /* <> operator for type */
1782
1783typedef struct CommonTableExpr
1784{
1785 NodeTag type;
1786
1787 /*
1788 * Query name (never qualified). The string name is included in the query
1789 * jumbling because RTE_CTE RTEs need it.
1790 */
1791 char *ctename;
1792 /* optional list of column names */
1794 CTEMaterialize ctematerialized; /* is this an optimization fence? */
1795 /* SelectStmt/InsertStmt/etc before parse analysis, Query afterwards: */
1796 Node *ctequery; /* the CTE's subquery */
1799 ParseLoc location; /* token location, or -1 if unknown */
1800 /* These fields are set during parse analysis: */
1801 /* is this CTE actually recursive? */
1803
1804 /*
1805 * Number of RTEs referencing this CTE (excluding internal
1806 * self-references), irrelevant for query jumbling.
1807 */
1809 /* list of output column names */
1811 /* OID list of output column type OIDs */
1813 /* integer list of output column typmods */
1815 /* OID list of column collation OIDs */
1818
1819/* Convenience macro to get the output tlist of a CTE's query */
1820#define GetCTETargetList(cte) \
1821 (AssertMacro(IsA((cte)->ctequery, Query)), \
1822 ((Query *) (cte)->ctequery)->commandType == CMD_SELECT ? \
1823 ((Query *) (cte)->ctequery)->targetList : \
1824 ((Query *) (cte)->ctequery)->returningList)
1825
1826/*
1827 * MergeWhenClause -
1828 * raw parser representation of a WHEN clause in a MERGE statement
1829 *
1830 * This is transformed into MergeAction by parse analysis
1831 */
1832typedef struct MergeWhenClause
1833{
1834 NodeTag type;
1835 MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
1836 CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
1837 OverridingKind override; /* OVERRIDING clause */
1838 Node *condition; /* WHEN conditions (raw parser) */
1839 List *targetList; /* INSERT/UPDATE targetlist */
1840 /* the following members are only used in INSERT actions */
1841 List *values; /* VALUES to INSERT, or NULL */
1843
1844/*
1845 * ReturningOptionKind -
1846 * Possible kinds of option in RETURNING WITH(...) list
1847 *
1848 * Currently, this is used only for specifying OLD/NEW aliases.
1849 */
1850typedef enum ReturningOptionKind
1851{
1852 RETURNING_OPTION_OLD, /* specify alias for OLD in RETURNING */
1853 RETURNING_OPTION_NEW, /* specify alias for NEW in RETURNING */
1855
1856/*
1857 * ReturningOption -
1858 * An individual option in the RETURNING WITH(...) list
1859 */
1860typedef struct ReturningOption
1861{
1862 NodeTag type;
1863 ReturningOptionKind option; /* specified option */
1864 char *value; /* option's value */
1865 ParseLoc location; /* token location, or -1 if unknown */
1867
1868/*
1869 * ReturningClause -
1870 * List of RETURNING expressions, together with any WITH(...) options
1871 */
1872typedef struct ReturningClause
1873{
1874 NodeTag type;
1875 List *options; /* list of ReturningOption elements */
1876 List *exprs; /* list of expressions to return */
1878
1879/*
1880 * TriggerTransition -
1881 * representation of transition row or table naming clause
1882 *
1883 * Only transition tables are initially supported in the syntax, and only for
1884 * AFTER triggers, but other permutations are accepted by the parser so we can
1885 * give a meaningful message from C code.
1886 */
1887typedef struct TriggerTransition
1888{
1889 NodeTag type;
1890 char *name;
1891 bool isNew;
1892 bool isTable;
1894
1895/* Nodes for SQL/JSON support */
1896
1897/*
1898 * JsonOutput -
1899 * representation of JSON output clause (RETURNING type [FORMAT format])
1900 */
1901typedef struct JsonOutput
1902{
1903 NodeTag type;
1904 TypeName *typeName; /* RETURNING type name, if specified */
1905 JsonReturning *returning; /* RETURNING FORMAT clause and type Oids */
1906} JsonOutput;
1907
1908/*
1909 * JsonArgument -
1910 * representation of argument from JSON PASSING clause
1911 */
1912typedef struct JsonArgument
1913{
1914 NodeTag type;
1915 JsonValueExpr *val; /* argument value expression */
1916 char *name; /* argument name */
1917} JsonArgument;
1918
1919/*
1920 * JsonQuotes -
1921 * representation of [KEEP|OMIT] QUOTES clause for JSON_QUERY()
1922 */
1923typedef enum JsonQuotes
1924{
1925 JS_QUOTES_UNSPEC, /* unspecified */
1926 JS_QUOTES_KEEP, /* KEEP QUOTES */
1927 JS_QUOTES_OMIT, /* OMIT QUOTES */
1928} JsonQuotes;
1929
1930/*
1931 * JsonFuncExpr -
1932 * untransformed representation of function expressions for
1933 * SQL/JSON query functions
1934 */
1935typedef struct JsonFuncExpr
1936{
1937 NodeTag type;
1938 JsonExprOp op; /* expression type */
1939 char *column_name; /* JSON_TABLE() column name or NULL if this is
1940 * not for a JSON_TABLE() */
1941 JsonValueExpr *context_item; /* context item expression */
1942 Node *pathspec; /* JSON path specification expression */
1943 List *passing; /* list of PASSING clause arguments, if any */
1944 JsonOutput *output; /* output clause, if specified */
1945 JsonBehavior *on_empty; /* ON EMPTY behavior */
1946 JsonBehavior *on_error; /* ON ERROR behavior */
1947 JsonWrapper wrapper; /* array wrapper behavior (JSON_QUERY only) */
1948 JsonQuotes quotes; /* omit or keep quotes? (JSON_QUERY only) */
1949 ParseLoc location; /* token location, or -1 if unknown */
1950} JsonFuncExpr;
1951
1952/*
1953 * JsonTablePathSpec
1954 * untransformed specification of JSON path expression with an optional
1955 * name
1956 */
1957typedef struct JsonTablePathSpec
1958{
1959 NodeTag type;
1960
1961 Node *string;
1962 char *name;
1964 ParseLoc location; /* location of 'string' */
1966
1967/*
1968 * JsonTable -
1969 * untransformed representation of JSON_TABLE
1970 */
1971typedef struct JsonTable
1972{
1973 NodeTag type;
1974 JsonValueExpr *context_item; /* context item expression */
1975 JsonTablePathSpec *pathspec; /* JSON path specification */
1976 List *passing; /* list of PASSING clause arguments, if any */
1977 List *columns; /* list of JsonTableColumn */
1978 JsonBehavior *on_error; /* ON ERROR behavior */
1979 Alias *alias; /* table alias in FROM clause */
1980 bool lateral; /* does it have LATERAL prefix? */
1981 ParseLoc location; /* token location, or -1 if unknown */
1982} JsonTable;
1983
1984/*
1985 * JsonTableColumnType -
1986 * enumeration of JSON_TABLE column types
1987 */
1988typedef enum JsonTableColumnType
1989{
1992 JTC_EXISTS,
1994 JTC_NESTED,
1996
1997/*
1998 * JsonTableColumn -
1999 * untransformed representation of JSON_TABLE column
2000 */
2001typedef struct JsonTableColumn
2002{
2003 NodeTag type;
2004 JsonTableColumnType coltype; /* column type */
2005 char *name; /* column name */
2006 TypeName *typeName; /* column type name */
2007 JsonTablePathSpec *pathspec; /* JSON path specification */
2008 JsonFormat *format; /* JSON format clause, if specified */
2009 JsonWrapper wrapper; /* WRAPPER behavior for formatted columns */
2010 JsonQuotes quotes; /* omit or keep quotes on scalar strings? */
2011 List *columns; /* nested columns */
2012 JsonBehavior *on_empty; /* ON EMPTY behavior */
2013 JsonBehavior *on_error; /* ON ERROR behavior */
2014 ParseLoc location; /* token location, or -1 if unknown */
2016
2017/*
2018 * JsonKeyValue -
2019 * untransformed representation of JSON object key-value pair for
2020 * JSON_OBJECT() and JSON_OBJECTAGG()
2021 */
2022typedef struct JsonKeyValue
2023{
2024 NodeTag type;
2025 Expr *key; /* key expression */
2026 JsonValueExpr *value; /* JSON value expression */
2027} JsonKeyValue;
2028
2029/*
2030 * JsonParseExpr -
2031 * untransformed representation of JSON()
2032 */
2033typedef struct JsonParseExpr
2034{
2035 NodeTag type;
2036 JsonValueExpr *expr; /* string expression */
2037 JsonOutput *output; /* RETURNING clause, if specified */
2038 bool unique_keys; /* WITH UNIQUE KEYS? */
2039 ParseLoc location; /* token location, or -1 if unknown */
2041
2042/*
2043 * JsonScalarExpr -
2044 * untransformed representation of JSON_SCALAR()
2045 */
2046typedef struct JsonScalarExpr
2047{
2048 NodeTag type;
2049 Expr *expr; /* scalar expression */
2050 JsonOutput *output; /* RETURNING clause, if specified */
2051 ParseLoc location; /* token location, or -1 if unknown */
2053
2054/*
2055 * JsonSerializeExpr -
2056 * untransformed representation of JSON_SERIALIZE() function
2057 */
2058typedef struct JsonSerializeExpr
2059{
2060 NodeTag type;
2061 JsonValueExpr *expr; /* json value expression */
2062 JsonOutput *output; /* RETURNING clause, if specified */
2063 ParseLoc location; /* token location, or -1 if unknown */
2065
2066/*
2067 * JsonObjectConstructor -
2068 * untransformed representation of JSON_OBJECT() constructor
2069 */
2070typedef struct JsonObjectConstructor
2071{
2072 NodeTag type;
2073 List *exprs; /* list of JsonKeyValue pairs */
2074 JsonOutput *output; /* RETURNING clause, if specified */
2075 bool absent_on_null; /* skip NULL values? */
2076 bool unique; /* check key uniqueness? */
2077 ParseLoc location; /* token location, or -1 if unknown */
2079
2080/*
2081 * JsonArrayConstructor -
2082 * untransformed representation of JSON_ARRAY(element,...) constructor
2083 */
2084typedef struct JsonArrayConstructor
2085{
2086 NodeTag type;
2087 List *exprs; /* list of JsonValueExpr elements */
2088 JsonOutput *output; /* RETURNING clause, if specified */
2089 bool absent_on_null; /* skip NULL elements? */
2090 ParseLoc location; /* token location, or -1 if unknown */
2092
2093/*
2094 * JsonArrayQueryConstructor -
2095 * untransformed representation of JSON_ARRAY(subquery) constructor
2096 */
2097typedef struct JsonArrayQueryConstructor
2098{
2099 NodeTag type;
2100 Node *query; /* subquery */
2101 JsonOutput *output; /* RETURNING clause, if specified */
2102 JsonFormat *format; /* FORMAT clause for subquery, if specified */
2103 bool absent_on_null; /* skip NULL elements? */
2104 ParseLoc location; /* token location, or -1 if unknown */
2106
2107/*
2108 * JsonAggConstructor -
2109 * common fields of untransformed representation of
2110 * JSON_ARRAYAGG() and JSON_OBJECTAGG()
2111 */
2112typedef struct JsonAggConstructor
2113{
2114 NodeTag type;
2115 JsonOutput *output; /* RETURNING clause, if any */
2116 Node *agg_filter; /* FILTER clause, if any */
2117 List *agg_order; /* ORDER BY clause, if any */
2118 struct WindowDef *over; /* OVER clause, if any */
2119 ParseLoc location; /* token location, or -1 if unknown */
2121
2122/*
2123 * JsonObjectAgg -
2124 * untransformed representation of JSON_OBJECTAGG()
2125 */
2126typedef struct JsonObjectAgg
2127{
2128 NodeTag type;
2129 JsonAggConstructor *constructor; /* common fields */
2130 JsonKeyValue *arg; /* object key-value pair */
2131 bool absent_on_null; /* skip NULL values? */
2132 bool unique; /* check key uniqueness? */
2134
2135/*
2136 * JsonArrayAgg -
2137 * untransformed representation of JSON_ARRAYAGG()
2138 */
2139typedef struct JsonArrayAgg
2140{
2141 NodeTag type;
2142 JsonAggConstructor *constructor; /* common fields */
2143 JsonValueExpr *arg; /* array element expression */
2144 bool absent_on_null; /* skip NULL elements? */
2145} JsonArrayAgg;
2146
2147
2148/*****************************************************************************
2149 * Raw Grammar Output Statements
2150 *****************************************************************************/
2151
2152/*
2153 * RawStmt --- container for any one statement's raw parse tree
2154 *
2155 * Parse analysis converts a raw parse tree headed by a RawStmt node into
2156 * an analyzed statement headed by a Query node. For optimizable statements,
2157 * the conversion is complex. For utility statements, the parser usually just
2158 * transfers the raw parse tree (sans RawStmt) into the utilityStmt field of
2159 * the Query node, and all the useful work happens at execution time.
2160 *
2161 * stmt_location/stmt_len identify the portion of the source text string
2162 * containing this raw statement (useful for multi-statement strings).
2163 *
2164 * This is irrelevant for query jumbling, as this is not used in parsed
2165 * queries.
2166 */
2167typedef struct RawStmt
2168{
2170
2171 NodeTag type;
2172 Node *stmt; /* raw parse tree */
2173 ParseLoc stmt_location; /* start location, or -1 if unknown */
2174 ParseLoc stmt_len; /* length in bytes; 0 means "rest of string" */
2175} RawStmt;
2176
2177/*****************************************************************************
2178 * Optimizable Statements
2179 *****************************************************************************/
2180
2181/* ----------------------
2182 * Insert Statement
2183 *
2184 * The source expression is represented by SelectStmt for both the
2185 * SELECT and VALUES cases. If selectStmt is NULL, then the query
2186 * is INSERT ... DEFAULT VALUES.
2187 * ----------------------
2188 */
2189typedef struct InsertStmt
2190{
2191 NodeTag type;
2192 RangeVar *relation; /* relation to insert into */
2193 List *cols; /* optional: names of the target columns */
2194 Node *selectStmt; /* the source SELECT/VALUES, or NULL */
2195 OnConflictClause *onConflictClause; /* ON CONFLICT clause */
2196 ReturningClause *returningClause; /* RETURNING clause */
2197 WithClause *withClause; /* WITH clause */
2198 OverridingKind override; /* OVERRIDING clause */
2199} InsertStmt;
2200
2201/* ----------------------
2202 * Delete Statement
2203 * ----------------------
2204 */
2205typedef struct DeleteStmt
2206{
2207 NodeTag type;
2208 RangeVar *relation; /* relation to delete from */
2209 List *usingClause; /* optional using clause for more tables */
2210 Node *whereClause; /* qualifications */
2211 ReturningClause *returningClause; /* RETURNING clause */
2212 WithClause *withClause; /* WITH clause */
2213} DeleteStmt;
2214
2215/* ----------------------
2216 * Update Statement
2217 * ----------------------
2218 */
2219typedef struct UpdateStmt
2220{
2221 NodeTag type;
2222 RangeVar *relation; /* relation to update */
2223 List *targetList; /* the target list (of ResTarget) */
2224 Node *whereClause; /* qualifications */
2225 List *fromClause; /* optional from clause for more tables */
2226 ReturningClause *returningClause; /* RETURNING clause */
2227 WithClause *withClause; /* WITH clause */
2228} UpdateStmt;
2229
2230/* ----------------------
2231 * Merge Statement
2232 * ----------------------
2233 */
2234typedef struct MergeStmt
2235{
2236 NodeTag type;
2237 RangeVar *relation; /* target relation to merge into */
2238 Node *sourceRelation; /* source relation */
2239 Node *joinCondition; /* join condition between source and target */
2240 List *mergeWhenClauses; /* list of MergeWhenClause(es) */
2241 ReturningClause *returningClause; /* RETURNING clause */
2242 WithClause *withClause; /* WITH clause */
2243} MergeStmt;
2244
2245/* ----------------------
2246 * Select Statement
2247 *
2248 * A "simple" SELECT is represented in the output of gram.y by a single
2249 * SelectStmt node; so is a VALUES construct. A query containing set
2250 * operators (UNION, INTERSECT, EXCEPT) is represented by a tree of SelectStmt
2251 * nodes, in which the leaf nodes are component SELECTs and the internal nodes
2252 * represent UNION, INTERSECT, or EXCEPT operators. Using the same node
2253 * type for both leaf and internal nodes allows gram.y to stick ORDER BY,
2254 * LIMIT, etc, clause values into a SELECT statement without worrying
2255 * whether it is a simple or compound SELECT.
2256 * ----------------------
2257 */
2258typedef enum SetOperation
2259{
2260 SETOP_NONE = 0,
2264} SetOperation;
2265
2266typedef struct SelectStmt
2267{
2268 NodeTag type;
2269
2270 /*
2271 * These fields are used only in "leaf" SelectStmts.
2272 */
2273 List *distinctClause; /* NULL, list of DISTINCT ON exprs, or
2274 * lcons(NIL,NIL) for all (SELECT DISTINCT) */
2275 IntoClause *intoClause; /* target for SELECT INTO */
2276 List *targetList; /* the target list (of ResTarget) */
2277 List *fromClause; /* the FROM clause */
2278 Node *whereClause; /* WHERE qualification */
2279 List *groupClause; /* GROUP BY clauses */
2280 bool groupDistinct; /* Is this GROUP BY DISTINCT? */
2281 bool groupByAll; /* Is this GROUP BY ALL? */
2282 Node *havingClause; /* HAVING conditional-expression */
2283 List *windowClause; /* WINDOW window_name AS (...), ... */
2284
2285 /*
2286 * In a "leaf" node representing a VALUES list, the above fields are all
2287 * null, and instead this field is set. Note that the elements of the
2288 * sublists are just expressions, without ResTarget decoration. Also note
2289 * that a list element can be DEFAULT (represented as a SetToDefault
2290 * node), regardless of the context of the VALUES list. It's up to parse
2291 * analysis to reject that where not valid.
2292 */
2293 List *valuesLists; /* untransformed list of expression lists */
2294
2295 /*
2296 * These fields are used in both "leaf" SelectStmts and upper-level
2297 * SelectStmts.
2298 */
2299 List *sortClause; /* sort clause (a list of SortBy's) */
2300 Node *limitOffset; /* # of result tuples to skip */
2301 Node *limitCount; /* # of result tuples to return */
2302 LimitOption limitOption; /* limit type */
2303 List *lockingClause; /* FOR UPDATE (list of LockingClause's) */
2304 WithClause *withClause; /* WITH clause */
2305
2306 /*
2307 * These fields are used only in upper-level SelectStmts.
2308 */
2309 SetOperation op; /* type of set op */
2310 bool all; /* ALL specified? */
2311 struct SelectStmt *larg; /* left child */
2312 struct SelectStmt *rarg; /* right child */
2313 /* Eventually add fields for CORRESPONDING spec here */
2314} SelectStmt;
2315
2316
2317/* ----------------------
2318 * Set Operation node for post-analysis query trees
2319 *
2320 * After parse analysis, a SELECT with set operations is represented by a
2321 * top-level Query node containing the leaf SELECTs as subqueries in its
2322 * range table. Its setOperations field shows the tree of set operations,
2323 * with leaf SelectStmt nodes replaced by RangeTblRef nodes, and internal
2324 * nodes replaced by SetOperationStmt nodes. Information about the output
2325 * column types is added, too. (Note that the child nodes do not necessarily
2326 * produce these types directly, but we've checked that their output types
2327 * can be coerced to the output column type.) Also, if it's not UNION ALL,
2328 * information about the types' sort/group semantics is provided in the form
2329 * of a SortGroupClause list (same representation as, eg, DISTINCT).
2330 * The resolved common column collations are provided too; but note that if
2331 * it's not UNION ALL, it's okay for a column to not have a common collation,
2332 * so a member of the colCollations list could be InvalidOid even though the
2333 * column has a collatable type.
2334 * ----------------------
2335 */
2336typedef struct SetOperationStmt
2337{
2338 NodeTag type;
2339 SetOperation op; /* type of set op */
2340 bool all; /* ALL specified? */
2341 Node *larg; /* left child */
2342 Node *rarg; /* right child */
2343 /* Eventually add fields for CORRESPONDING spec here */
2344
2345 /* Fields derived during parse analysis (irrelevant for query jumbling): */
2346 /* OID list of output column type OIDs */
2348 /* integer list of output column typmods */
2350 /* OID list of output column collation OIDs */
2352 /* a list of SortGroupClause's */
2353 List *groupClauses pg_node_attr(query_jumble_ignore);
2354 /* groupClauses is NIL if UNION ALL, but must be set otherwise */
2356
2357
2358/*
2359 * RETURN statement (inside SQL function body)
2360 */
2361typedef struct ReturnStmt
2362{
2363 NodeTag type;
2364 Node *returnval;
2365} ReturnStmt;
2366
2367
2368/* ----------------------
2369 * PL/pgSQL Assignment Statement
2370 *
2371 * Like SelectStmt, this is transformed into a SELECT Query.
2372 * However, the targetlist of the result looks more like an UPDATE.
2373 * ----------------------
2374 */
2375typedef struct PLAssignStmt
2376{
2377 NodeTag type;
2378
2379 char *name; /* initial column name */
2380 List *indirection; /* subscripts and field names, if any */
2381 int nnames; /* number of names to use in ColumnRef */
2382 SelectStmt *val; /* the PL/pgSQL expression to assign */
2383 ParseLoc location; /* name's token location, or -1 if unknown */
2384} PLAssignStmt;
2385
2386
2387/*****************************************************************************
2388 * Other Statements (no optimizations required)
2389 *
2390 * These are not touched by parser/analyze.c except to put them into
2391 * the utilityStmt field of a Query. This is eventually passed to
2392 * ProcessUtility (by-passing rewriting and planning). Some of the
2393 * statements do need attention from parse analysis, and this is
2394 * done by routines in parser/parse_utilcmd.c after ProcessUtility
2395 * receives the command for execution.
2396 * DECLARE CURSOR, EXPLAIN, and CREATE TABLE AS are special cases:
2397 * they contain optimizable statements, which get processed normally
2398 * by parser/analyze.c.
2399 *****************************************************************************/
2400
2401/*
2402 * When a command can act on several kinds of objects with only one
2403 * parse structure required, use these constants to designate the
2404 * object type. Note that commands typically don't support all the types.
2405 */
2406
2407typedef enum ObjectType
2408{
2413 OBJECT_ATTRIBUTE, /* type's attribute, when distinct from column */
2425 OBJECT_FDW,
2462} ObjectType;
2463
2464/* ----------------------
2465 * Create Schema Statement
2466 *
2467 * NOTE: the schemaElts list contains raw parsetrees for component statements
2468 * of the schema, such as CREATE TABLE, GRANT, etc. These are analyzed and
2469 * executed after the schema itself is created.
2470 * ----------------------
2471 */
2472typedef struct CreateSchemaStmt
2473{
2474 NodeTag type;
2475 char *schemaname; /* the name of the schema to create */
2476 RoleSpec *authrole; /* the owner of the created schema */
2477 List *schemaElts; /* schema components (list of parsenodes) */
2478 bool if_not_exists; /* just do nothing if schema already exists? */
2480
2481typedef enum DropBehavior
2482{
2483 DROP_RESTRICT, /* drop fails if any dependent objects */
2484 DROP_CASCADE, /* remove dependent objects too */
2485} DropBehavior;
2486
2487/* ----------------------
2488 * Alter Table
2489 * ----------------------
2490 */
2491typedef struct AlterTableStmt
2492{
2493 NodeTag type;
2494 RangeVar *relation; /* table to work on */
2495 List *cmds; /* list of subcommands */
2496 ObjectType objtype; /* type of object */
2497 bool missing_ok; /* skip error if table missing */
2499
2500typedef enum AlterTableType
2501{
2502 AT_AddColumn, /* add column */
2503 AT_AddColumnToView, /* implicitly via CREATE OR REPLACE VIEW */
2504 AT_ColumnDefault, /* alter column default */
2505 AT_CookedColumnDefault, /* add a pre-cooked column default */
2506 AT_DropNotNull, /* alter column drop not null */
2507 AT_SetNotNull, /* alter column set not null */
2508 AT_SetExpression, /* alter column set expression */
2509 AT_DropExpression, /* alter column drop expression */
2510 AT_SetStatistics, /* alter column set statistics */
2511 AT_SetOptions, /* alter column set ( options ) */
2512 AT_ResetOptions, /* alter column reset ( options ) */
2513 AT_SetStorage, /* alter column set storage */
2514 AT_SetCompression, /* alter column set compression */
2515 AT_DropColumn, /* drop column */
2516 AT_AddIndex, /* add index */
2517 AT_ReAddIndex, /* internal to commands/tablecmds.c */
2518 AT_AddConstraint, /* add constraint */
2519 AT_ReAddConstraint, /* internal to commands/tablecmds.c */
2520 AT_ReAddDomainConstraint, /* internal to commands/tablecmds.c */
2521 AT_AlterConstraint, /* alter constraint */
2522 AT_ValidateConstraint, /* validate constraint */
2523 AT_AddIndexConstraint, /* add constraint using existing index */
2524 AT_DropConstraint, /* drop constraint */
2525 AT_ReAddComment, /* internal to commands/tablecmds.c */
2526 AT_AlterColumnType, /* alter column type */
2527 AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */
2528 AT_ChangeOwner, /* change owner */
2529 AT_ClusterOn, /* CLUSTER ON */
2530 AT_DropCluster, /* SET WITHOUT CLUSTER */
2531 AT_SetLogged, /* SET LOGGED */
2532 AT_SetUnLogged, /* SET UNLOGGED */
2533 AT_DropOids, /* SET WITHOUT OIDS */
2534 AT_SetAccessMethod, /* SET ACCESS METHOD */
2535 AT_SetTableSpace, /* SET TABLESPACE */
2536 AT_SetRelOptions, /* SET (...) -- AM specific parameters */
2537 AT_ResetRelOptions, /* RESET (...) -- AM specific parameters */
2538 AT_ReplaceRelOptions, /* replace reloption list in its entirety */
2539 AT_EnableTrig, /* ENABLE TRIGGER name */
2540 AT_EnableAlwaysTrig, /* ENABLE ALWAYS TRIGGER name */
2541 AT_EnableReplicaTrig, /* ENABLE REPLICA TRIGGER name */
2542 AT_DisableTrig, /* DISABLE TRIGGER name */
2543 AT_EnableTrigAll, /* ENABLE TRIGGER ALL */
2544 AT_DisableTrigAll, /* DISABLE TRIGGER ALL */
2545 AT_EnableTrigUser, /* ENABLE TRIGGER USER */
2546 AT_DisableTrigUser, /* DISABLE TRIGGER USER */
2547 AT_EnableRule, /* ENABLE RULE name */
2548 AT_EnableAlwaysRule, /* ENABLE ALWAYS RULE name */
2549 AT_EnableReplicaRule, /* ENABLE REPLICA RULE name */
2550 AT_DisableRule, /* DISABLE RULE name */
2551 AT_AddInherit, /* INHERIT parent */
2552 AT_DropInherit, /* NO INHERIT parent */
2553 AT_AddOf, /* OF <type_name> */
2554 AT_DropOf, /* NOT OF */
2555 AT_ReplicaIdentity, /* REPLICA IDENTITY */
2556 AT_EnableRowSecurity, /* ENABLE ROW SECURITY */
2557 AT_DisableRowSecurity, /* DISABLE ROW SECURITY */
2558 AT_ForceRowSecurity, /* FORCE ROW SECURITY */
2559 AT_NoForceRowSecurity, /* NO FORCE ROW SECURITY */
2560 AT_GenericOptions, /* OPTIONS (...) */
2561 AT_AttachPartition, /* ATTACH PARTITION */
2562 AT_DetachPartition, /* DETACH PARTITION */
2563 AT_DetachPartitionFinalize, /* DETACH PARTITION FINALIZE */
2564 AT_SplitPartition, /* SPLIT PARTITION */
2565 AT_MergePartitions, /* MERGE PARTITIONS */
2566 AT_AddIdentity, /* ADD IDENTITY */
2567 AT_SetIdentity, /* SET identity column options */
2568 AT_DropIdentity, /* DROP IDENTITY */
2569 AT_ReAddStatistics, /* internal to commands/tablecmds.c */
2571
2572typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */
2573{
2574 NodeTag type;
2575 AlterTableType subtype; /* Type of table alteration to apply */
2576 char *name; /* column, constraint, or trigger to act on,
2577 * or tablespace, access method */
2578 int16 num; /* attribute number for columns referenced by
2579 * number */
2581 Node *def; /* definition of new column, index,
2582 * constraint, or parent table */
2583 DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
2584 bool missing_ok; /* skip error if missing? */
2585 bool recurse; /* exec-time recursion */
2587
2588/* Ad-hoc node for AT_AlterConstraint */
2589typedef struct ATAlterConstraint
2590{
2591 NodeTag type;
2592 char *conname; /* Constraint name */
2593 bool alterEnforceability; /* changing enforceability properties? */
2594 bool is_enforced; /* ENFORCED? */
2595 bool alterDeferrability; /* changing deferrability properties? */
2596 bool deferrable; /* DEFERRABLE? */
2597 bool initdeferred; /* INITIALLY DEFERRED? */
2598 bool alterInheritability; /* changing inheritability properties */
2599 bool noinherit;
2601
2602/* Ad-hoc node for AT_ReplicaIdentity */
2603typedef struct ReplicaIdentityStmt
2604{
2605 NodeTag type;
2606 char identity_type;
2607 char *name;
2609
2610
2611/* ----------------------
2612 * Alter Collation
2613 * ----------------------
2614 */
2615typedef struct AlterCollationStmt
2616{
2617 NodeTag type;
2618 List *collname;
2620
2621
2622/* ----------------------
2623 * Alter Domain
2624 *
2625 * The fields are used in different ways by the different variants of
2626 * this command.
2627 * ----------------------
2628 */
2629typedef enum AlterDomainType
2630{
2631 AD_AlterDefault = 'T', /* SET|DROP DEFAULT */
2632 AD_DropNotNull = 'N', /* DROP NOT NULL */
2633 AD_SetNotNull = 'O', /* SET NOT NULL */
2634 AD_AddConstraint = 'C', /* ADD CONSTRAINT */
2635 AD_DropConstraint = 'X', /* DROP CONSTRAINT */
2636 AD_ValidateConstraint = 'V', /* VALIDATE CONSTRAINT */
2638
2639typedef struct AlterDomainStmt
2640{
2641 NodeTag type;
2642 AlterDomainType subtype; /* subtype of command */
2643 List *typeName; /* domain to work on */
2644 char *name; /* column or constraint name to act on */
2645 Node *def; /* definition of default or constraint */
2646 DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
2647 bool missing_ok; /* skip error if missing? */
2649
2650
2651/* ----------------------
2652 * Grant|Revoke Statement
2653 * ----------------------
2654 */
2655typedef enum GrantTargetType
2656{
2657 ACL_TARGET_OBJECT, /* grant on specific named object(s) */
2658 ACL_TARGET_ALL_IN_SCHEMA, /* grant on all objects in given schema(s) */
2659 ACL_TARGET_DEFAULTS, /* ALTER DEFAULT PRIVILEGES */
2661
2662typedef struct GrantStmt
2663{
2664 NodeTag type;
2665 bool is_grant; /* true = GRANT, false = REVOKE */
2666 GrantTargetType targtype; /* type of the grant target */
2667 ObjectType objtype; /* kind of object being operated on */
2668 List *objects; /* list of RangeVar nodes, ObjectWithArgs
2669 * nodes, or plain names (as String values) */
2670 List *privileges; /* list of AccessPriv nodes */
2671 /* privileges == NIL denotes ALL PRIVILEGES */
2672 List *grantees; /* list of RoleSpec nodes */
2673 bool grant_option; /* grant or revoke grant option */
2674 RoleSpec *grantor; /* GRANTED BY clause, or NULL if none */
2675 DropBehavior behavior; /* drop behavior (for REVOKE) */
2676} GrantStmt;
2677
2678/*
2679 * ObjectWithArgs represents a function/procedure/operator name plus parameter
2680 * identification.
2681 *
2682 * objargs includes only the types of the input parameters of the object.
2683 * In some contexts, that will be all we have, and it's enough to look up
2684 * objects according to the traditional Postgres rules (i.e., when only input
2685 * arguments matter).
2686 *
2687 * objfuncargs, if not NIL, carries the full specification of the parameter
2688 * list, including parameter mode annotations.
2689 *
2690 * Some grammar productions can set args_unspecified = true instead of
2691 * providing parameter info. In this case, lookup will succeed only if
2692 * the object name is unique. Note that otherwise, NIL parameter lists
2693 * mean zero arguments.
2694 */
2695typedef struct ObjectWithArgs
2696{
2697 NodeTag type;
2698 List *objname; /* qualified name of function/operator */
2699 List *objargs; /* list of Typename nodes (input args only) */
2700 List *objfuncargs; /* list of FunctionParameter nodes */
2701 bool args_unspecified; /* argument list was omitted? */
2703
2704/*
2705 * An access privilege, with optional list of column names
2706 * priv_name == NULL denotes ALL PRIVILEGES (only used with a column list)
2707 * cols == NIL denotes "all columns"
2708 * Note that simple "ALL PRIVILEGES" is represented as a NIL list, not
2709 * an AccessPriv with both fields null.
2710 */
2711typedef struct AccessPriv
2712{
2713 NodeTag type;
2714 char *priv_name; /* string name of privilege */
2715 List *cols; /* list of String */
2716} AccessPriv;
2717
2718/* ----------------------
2719 * Grant/Revoke Role Statement
2720 *
2721 * Note: because of the parsing ambiguity with the GRANT <privileges>
2722 * statement, granted_roles is a list of AccessPriv; the execution code
2723 * should complain if any column lists appear. grantee_roles is a list
2724 * of role names, as RoleSpec values.
2725 * ----------------------
2726 */
2727typedef struct GrantRoleStmt
2728{
2729 NodeTag type;
2730 List *granted_roles; /* list of roles to be granted/revoked */
2731 List *grantee_roles; /* list of member roles to add/delete */
2732 bool is_grant; /* true = GRANT, false = REVOKE */
2733 List *opt; /* options e.g. WITH GRANT OPTION */
2734 RoleSpec *grantor; /* set grantor to other than current role */
2735 DropBehavior behavior; /* drop behavior (for REVOKE) */
2737
2738/* ----------------------
2739 * Alter Default Privileges Statement
2740 * ----------------------
2741 */
2742typedef struct AlterDefaultPrivilegesStmt
2743{
2744 NodeTag type;
2745 List *options; /* list of DefElem */
2746 GrantStmt *action; /* GRANT/REVOKE action (with objects=NIL) */
2748
2749/* ----------------------
2750 * Copy Statement
2751 *
2752 * We support "COPY relation FROM file", "COPY relation TO file", and
2753 * "COPY (query) TO file". In any given CopyStmt, exactly one of "relation"
2754 * and "query" must be non-NULL.
2755 * ----------------------
2756 */
2757typedef struct CopyStmt
2758{
2759 NodeTag type;
2760 RangeVar *relation; /* the relation to copy */
2761 Node *query; /* the query (SELECT or DML statement with
2762 * RETURNING) to copy, as a raw parse tree */
2763 List *attlist; /* List of column names (as Strings), or NIL
2764 * for all columns */
2765 bool is_from; /* TO or FROM */
2766 bool is_program; /* is 'filename' a program to popen? */
2767 char *filename; /* filename, or NULL for STDIN/STDOUT */
2768 List *options; /* List of DefElem nodes */
2769 Node *whereClause; /* WHERE condition (or NULL) */
2770} CopyStmt;
2771
2772/* ----------------------
2773 * SET Statement (includes RESET)
2774 *
2775 * "SET var TO DEFAULT" and "RESET var" are semantically equivalent, but we
2776 * preserve the distinction in VariableSetKind for CreateCommandTag().
2777 * ----------------------
2778 */
2779typedef enum VariableSetKind
2780{
2781 VAR_SET_VALUE, /* SET var = value */
2782 VAR_SET_DEFAULT, /* SET var TO DEFAULT */
2783 VAR_SET_CURRENT, /* SET var FROM CURRENT */
2784 VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
2785 VAR_RESET, /* RESET var */
2786 VAR_RESET_ALL, /* RESET ALL */
2788
2789typedef struct VariableSetStmt
2790{
2792
2793 NodeTag type;
2795 /* variable to be set */
2796 char *name;
2797 /* List of A_Const nodes */
2798 List *args;
2799
2800 /*
2801 * True if arguments should be accounted for in query jumbling. We use a
2802 * separate flag rather than query_jumble_ignore on "args" as several
2803 * grammar flavors of SET rely on a list of values that are parsed
2804 * directly from the grammar's keywords.
2805 */
2806 bool jumble_args;
2807 /* SET LOCAL? */
2808 bool is_local;
2809 /* token location, or -1 if unknown */
2812
2813/* ----------------------
2814 * Show Statement
2815 * ----------------------
2816 */
2817typedef struct VariableShowStmt
2818{
2819 NodeTag type;
2820 char *name;
2822
2823/* ----------------------
2824 * Create Table Statement
2825 *
2826 * NOTE: in the raw gram.y output, ColumnDef and Constraint nodes are
2827 * intermixed in tableElts, and constraints and nnconstraints are NIL. After
2828 * parse analysis, tableElts contains just ColumnDefs, nnconstraints contains
2829 * Constraint nodes of CONSTR_NOTNULL type from various sources, and
2830 * constraints contains just CONSTR_CHECK Constraint nodes.
2831 * ----------------------
2832 */
2833
2834typedef struct CreateStmt
2835{
2836 NodeTag type;
2837 RangeVar *relation; /* relation to create */
2838 List *tableElts; /* column definitions (list of ColumnDef) */
2839 List *inhRelations; /* relations to inherit from (list of
2840 * RangeVar) */
2841 PartitionBoundSpec *partbound; /* FOR VALUES clause */
2842 PartitionSpec *partspec; /* PARTITION BY clause */
2843 TypeName *ofTypename; /* OF typename */
2844 List *constraints; /* constraints (list of Constraint nodes) */
2845 List *nnconstraints; /* NOT NULL constraints (ditto) */
2846 List *options; /* options from WITH clause */
2847 OnCommitAction oncommit; /* what do we do at COMMIT? */
2848 char *tablespacename; /* table space to use, or NULL */
2849 char *accessMethod; /* table access method */
2850 bool if_not_exists; /* just do nothing if it already exists? */
2851} CreateStmt;
2852
2853/* ----------
2854 * Definitions for constraints in CreateStmt
2855 *
2856 * Note that column defaults are treated as a type of constraint,
2857 * even though that's a bit odd semantically.
2858 *
2859 * For constraints that use expressions (CONSTR_CHECK, CONSTR_DEFAULT)
2860 * we may have the expression in either "raw" form (an untransformed
2861 * parse tree) or "cooked" form (the nodeToString representation of
2862 * an executable expression tree), depending on how this Constraint
2863 * node was created (by parsing, or by inheritance from an existing
2864 * relation). We should never have both in the same node!
2865 *
2866 * FKCONSTR_ACTION_xxx values are stored into pg_constraint.confupdtype
2867 * and pg_constraint.confdeltype columns; FKCONSTR_MATCH_xxx values are
2868 * stored into pg_constraint.confmatchtype. Changing the code values may
2869 * require an initdb!
2870 *
2871 * If skip_validation is true then we skip checking that the existing rows
2872 * in the table satisfy the constraint, and just install the catalog entries
2873 * for the constraint. A new FK constraint is marked as valid iff
2874 * initially_valid is true. (Usually skip_validation and initially_valid
2875 * are inverses, but we can set both true if the table is known empty.)
2876 *
2877 * Constraint attributes (DEFERRABLE etc) are initially represented as
2878 * separate Constraint nodes for simplicity of parsing. parse_utilcmd.c makes
2879 * a pass through the constraints list to insert the info into the appropriate
2880 * Constraint node.
2881 * ----------
2882 */
2883
2884typedef enum ConstrType /* types of constraints */
2885{
2886 CONSTR_NULL, /* not standard SQL, but a lot of people
2887 * expect it */
2897 CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */
2903} ConstrType;
2904
2905/* Foreign key action codes */
2906#define FKCONSTR_ACTION_NOACTION 'a'
2907#define FKCONSTR_ACTION_RESTRICT 'r'
2908#define FKCONSTR_ACTION_CASCADE 'c'
2909#define FKCONSTR_ACTION_SETNULL 'n'
2910#define FKCONSTR_ACTION_SETDEFAULT 'd'
2911
2912/* Foreign key matchtype codes */
2913#define FKCONSTR_MATCH_FULL 'f'
2914#define FKCONSTR_MATCH_PARTIAL 'p'
2915#define FKCONSTR_MATCH_SIMPLE 's'
2916
2917typedef struct Constraint
2918{
2919 NodeTag type;
2920 ConstrType contype; /* see above */
2921 char *conname; /* Constraint name, or NULL if unnamed */
2922 bool deferrable; /* DEFERRABLE? */
2923 bool initdeferred; /* INITIALLY DEFERRED? */
2924 bool is_enforced; /* enforced constraint? */
2925 bool skip_validation; /* skip validation of existing rows? */
2926 bool initially_valid; /* mark the new constraint as valid? */
2927 bool is_no_inherit; /* is constraint non-inheritable? */
2928 Node *raw_expr; /* CHECK or DEFAULT expression, as
2929 * untransformed parse tree */
2930 char *cooked_expr; /* CHECK or DEFAULT expression, as
2931 * nodeToString representation */
2932 char generated_when; /* ALWAYS or BY DEFAULT */
2933 char generated_kind; /* STORED or VIRTUAL */
2934 bool nulls_not_distinct; /* null treatment for UNIQUE constraints */
2935 List *keys; /* String nodes naming referenced key
2936 * column(s); for UNIQUE/PK/NOT NULL */
2937 bool without_overlaps; /* WITHOUT OVERLAPS specified */
2938 List *including; /* String nodes naming referenced nonkey
2939 * column(s); for UNIQUE/PK */
2940 List *exclusions; /* list of (IndexElem, operator name) pairs;
2941 * for exclusion constraints */
2942 List *options; /* options from WITH clause */
2943 char *indexname; /* existing index to use; otherwise NULL */
2944 char *indexspace; /* index tablespace; NULL for default */
2945 bool reset_default_tblspc; /* reset default_tablespace prior to
2946 * creating the index */
2947 char *access_method; /* index access method; NULL for default */
2948 Node *where_clause; /* partial index predicate */
2949
2950 /* Fields used for FOREIGN KEY constraints: */
2951 RangeVar *pktable; /* Primary key table */
2952 List *fk_attrs; /* Attributes of foreign key */
2953 List *pk_attrs; /* Corresponding attrs in PK table */
2954 bool fk_with_period; /* Last attribute of FK uses PERIOD */
2955 bool pk_with_period; /* Last attribute of PK uses PERIOD */
2956 char fk_matchtype; /* FULL, PARTIAL, SIMPLE */
2957 char fk_upd_action; /* ON UPDATE action */
2958 char fk_del_action; /* ON DELETE action */
2959 List *fk_del_set_cols; /* ON DELETE SET NULL/DEFAULT (col1, col2) */
2960 List *old_conpfeqop; /* pg_constraint.conpfeqop of my former self */
2961 Oid old_pktable_oid; /* pg_constraint.confrelid of my former
2962 * self */
2963
2964 ParseLoc location; /* token location, or -1 if unknown */
2965} Constraint;
2966
2967/* ----------------------
2968 * Create/Drop Table Space Statements
2969 * ----------------------
2970 */
2971
2972typedef struct CreateTableSpaceStmt
2973{
2974 NodeTag type;
2975 char *tablespacename;
2976 RoleSpec *owner;
2977 char *location;
2978 List *options;
2980
2981typedef struct DropTableSpaceStmt
2982{
2983 NodeTag type;
2984 char *tablespacename;
2985 bool missing_ok; /* skip error if missing? */
2987
2988typedef struct AlterTableSpaceOptionsStmt
2989{
2990 NodeTag type;
2991 char *tablespacename;
2992 List *options;
2993 bool isReset;
2995
2996typedef struct AlterTableMoveAllStmt
2997{
2998 NodeTag type;
2999 char *orig_tablespacename;
3000 ObjectType objtype; /* Object type to move */
3001 List *roles; /* List of roles to move objects of */
3002 char *new_tablespacename;
3003 bool nowait;
3005
3006/* ----------------------
3007 * Create/Alter Extension Statements
3008 * ----------------------
3009 */
3010
3011typedef struct CreateExtensionStmt
3012{
3013 NodeTag type;
3014 char *extname;
3015 bool if_not_exists; /* just do nothing if it already exists? */
3016 List *options; /* List of DefElem nodes */
3018
3019/* Only used for ALTER EXTENSION UPDATE; later might need an action field */
3020typedef struct AlterExtensionStmt
3021{
3022 NodeTag type;
3023 char *extname;
3024 List *options; /* List of DefElem nodes */
3026
3027typedef struct AlterExtensionContentsStmt
3028{
3029 NodeTag type;
3030 char *extname; /* Extension's name */
3031 int action; /* +1 = add object, -1 = drop object */
3032 ObjectType objtype; /* Object's type */
3033 Node *object; /* Qualified name of the object */
3035
3036/* ----------------------
3037 * Create/Alter FOREIGN DATA WRAPPER Statements
3038 * ----------------------
3039 */
3040
3041typedef struct CreateFdwStmt
3042{
3043 NodeTag type;
3044 char *fdwname; /* foreign-data wrapper name */
3045 List *func_options; /* HANDLER/VALIDATOR options */
3046 List *options; /* generic options to FDW */
3048
3049typedef struct AlterFdwStmt
3050{
3051 NodeTag type;
3052 char *fdwname; /* foreign-data wrapper name */
3053 List *func_options; /* HANDLER/VALIDATOR options */
3054 List *options; /* generic options to FDW */
3055} AlterFdwStmt;
3056
3057/* ----------------------
3058 * Create/Alter FOREIGN SERVER Statements
3059 * ----------------------
3060 */
3061
3062typedef struct CreateForeignServerStmt
3063{
3064 NodeTag type;
3065 char *servername; /* server name */
3066 char *servertype; /* optional server type */
3067 char *version; /* optional server version */
3068 char *fdwname; /* FDW name */
3069 bool if_not_exists; /* just do nothing if it already exists? */
3070 List *options; /* generic options to server */
3072
3073typedef struct AlterForeignServerStmt
3074{
3075 NodeTag type;
3076 char *servername; /* server name */
3077 char *version; /* optional server version */
3078 List *options; /* generic options to server */
3079 bool has_version; /* version specified */
3081
3082/* ----------------------
3083 * Create FOREIGN TABLE Statement
3084 * ----------------------
3085 */
3086
3087typedef struct CreateForeignTableStmt
3088{
3090 char *servername;
3091 List *options;
3093
3094/* ----------------------
3095 * Create/Drop USER MAPPING Statements
3096 * ----------------------
3097 */
3098
3099typedef struct CreateUserMappingStmt
3100{
3101 NodeTag type;
3102 RoleSpec *user; /* user role */
3103 char *servername; /* server name */
3104 bool if_not_exists; /* just do nothing if it already exists? */
3105 List *options; /* generic options to server */
3107
3108typedef struct AlterUserMappingStmt
3109{
3110 NodeTag type;
3111 RoleSpec *user; /* user role */
3112 char *servername; /* server name */
3113 List *options; /* generic options to server */
3115
3116typedef struct DropUserMappingStmt
3117{
3118 NodeTag type;
3119 RoleSpec *user; /* user role */
3120 char *servername; /* server name */
3121 bool missing_ok; /* ignore missing mappings */
3123
3124/* ----------------------
3125 * Import Foreign Schema Statement
3126 * ----------------------
3127 */
3128
3129typedef enum ImportForeignSchemaType
3130{
3131 FDW_IMPORT_SCHEMA_ALL, /* all relations wanted */
3132 FDW_IMPORT_SCHEMA_LIMIT_TO, /* include only listed tables in import */
3133 FDW_IMPORT_SCHEMA_EXCEPT, /* exclude listed tables from import */
3135
3136typedef struct ImportForeignSchemaStmt
3137{
3138 NodeTag type;
3139 char *server_name; /* FDW server name */
3140 char *remote_schema; /* remote schema name to query */
3141 char *local_schema; /* local schema to create objects in */
3142 ImportForeignSchemaType list_type; /* type of table list */
3143 List *table_list; /* List of RangeVar */
3144 List *options; /* list of options to pass to FDW */
3146
3147/*----------------------
3148 * Create POLICY Statement
3149 *----------------------
3150 */
3151typedef struct CreatePolicyStmt
3152{
3153 NodeTag type;
3154 char *policy_name; /* Policy's name */
3155 RangeVar *table; /* the table name the policy applies to */
3156 char *cmd_name; /* the command name the policy applies to */
3157 bool permissive; /* restrictive or permissive policy */
3158 List *roles; /* the roles associated with the policy */
3159 Node *qual; /* the policy's condition */
3160 Node *with_check; /* the policy's WITH CHECK condition. */
3162
3163/*----------------------
3164 * Alter POLICY Statement
3165 *----------------------
3166 */
3167typedef struct AlterPolicyStmt
3168{
3169 NodeTag type;
3170 char *policy_name; /* Policy's name */
3171 RangeVar *table; /* the table name the policy applies to */
3172 List *roles; /* the roles associated with the policy */
3173 Node *qual; /* the policy's condition */
3174 Node *with_check; /* the policy's WITH CHECK condition. */
3176
3177/*----------------------
3178 * Create ACCESS METHOD Statement
3179 *----------------------
3180 */
3181typedef struct CreateAmStmt
3182{
3183 NodeTag type;
3184 char *amname; /* access method name */
3185 List *handler_name; /* handler function name */
3186 char amtype; /* type of access method */
3187} CreateAmStmt;
3188
3189/* ----------------------
3190 * Create TRIGGER Statement
3191 * ----------------------
3192 */
3193typedef struct CreateTrigStmt
3194{
3195 NodeTag type;
3196 bool replace; /* replace trigger if already exists */
3197 bool isconstraint; /* This is a constraint trigger */
3198 char *trigname; /* TRIGGER's name */
3199 RangeVar *relation; /* relation trigger is on */
3200 List *funcname; /* qual. name of function to call */
3201 List *args; /* list of String or NIL */
3202 bool row; /* ROW/STATEMENT */
3203 /* timing uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
3204 int16 timing; /* BEFORE, AFTER, or INSTEAD */
3205 /* events uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
3206 int16 events; /* "OR" of INSERT/UPDATE/DELETE/TRUNCATE */
3207 List *columns; /* column names, or NIL for all columns */
3208 Node *whenClause; /* qual expression, or NULL if none */
3209 /* explicitly named transition data */
3210 List *transitionRels; /* TriggerTransition nodes, or NIL if none */
3211 /* The remaining fields are only used for constraint triggers */
3212 bool deferrable; /* [NOT] DEFERRABLE */
3213 bool initdeferred; /* INITIALLY {DEFERRED|IMMEDIATE} */
3214 RangeVar *constrrel; /* opposite relation, if RI trigger */
3216
3217/* ----------------------
3218 * Create EVENT TRIGGER Statement
3219 * ----------------------
3220 */
3221typedef struct CreateEventTrigStmt
3222{
3223 NodeTag type;
3224 char *trigname; /* TRIGGER's name */
3225 char *eventname; /* event's identifier */
3226 List *whenclause; /* list of DefElems indicating filtering */
3227 List *funcname; /* qual. name of function to call */
3229
3230/* ----------------------
3231 * Alter EVENT TRIGGER Statement
3232 * ----------------------
3233 */
3234typedef struct AlterEventTrigStmt
3235{
3236 NodeTag type;
3237 char *trigname; /* TRIGGER's name */
3238 char tgenabled; /* trigger's firing configuration WRT
3239 * session_replication_role */
3241
3242/* ----------------------
3243 * Create LANGUAGE Statements
3244 * ----------------------
3245 */
3246typedef struct CreatePLangStmt
3247{
3248 NodeTag type;
3249 bool replace; /* T => replace if already exists */
3250 char *plname; /* PL name */
3251 List *plhandler; /* PL call handler function (qual. name) */
3252 List *plinline; /* optional inline function (qual. name) */
3253 List *plvalidator; /* optional validator function (qual. name) */
3254 bool pltrusted; /* PL is trusted */
3256
3257/* ----------------------
3258 * Create/Alter/Drop Role Statements
3259 *
3260 * Note: these node types are also used for the backwards-compatible
3261 * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases
3262 * there's really no need to distinguish what the original spelling was,
3263 * but for CREATE we mark the type because the defaults vary.
3264 * ----------------------
3265 */
3266typedef enum RoleStmtType
3267{
3271} RoleStmtType;
3272
3273typedef struct CreateRoleStmt
3274{
3275 NodeTag type;
3276 RoleStmtType stmt_type; /* ROLE/USER/GROUP */
3277 char *role; /* role name */
3278 List *options; /* List of DefElem nodes */
3280
3281typedef struct AlterRoleStmt
3282{
3283 NodeTag type;
3284 RoleSpec *role; /* role */
3285 List *options; /* List of DefElem nodes */
3286 int action; /* +1 = add members, -1 = drop members */
3288
3289typedef struct AlterRoleSetStmt
3290{
3291 NodeTag type;
3292 RoleSpec *role; /* role */
3293 char *database; /* database name, or NULL */
3294 VariableSetStmt *setstmt; /* SET or RESET subcommand */
3296
3297typedef struct DropRoleStmt
3298{
3299 NodeTag type;
3300 List *roles; /* List of roles to remove */
3301 bool missing_ok; /* skip error if a role is missing? */
3302} DropRoleStmt;
3303
3304/* ----------------------
3305 * {Create|Alter} SEQUENCE Statement
3306 * ----------------------
3307 */
3308
3309typedef struct CreateSeqStmt
3310{
3311 NodeTag type;
3312 RangeVar *sequence; /* the sequence to create */
3313 List *options;
3314 Oid ownerId; /* ID of owner, or InvalidOid for default */
3315 bool for_identity;
3316 bool if_not_exists; /* just do nothing if it already exists? */
3318
3319typedef struct AlterSeqStmt
3320{
3321 NodeTag type;
3322 RangeVar *sequence; /* the sequence to alter */
3323 List *options;
3324 bool for_identity;
3325 bool missing_ok; /* skip error if a role is missing? */
3326} AlterSeqStmt;
3327
3328/* ----------------------
3329 * Create {Aggregate|Operator|Type} Statement
3330 * ----------------------
3331 */
3332typedef struct DefineStmt
3333{
3334 NodeTag type;
3335 ObjectType kind; /* aggregate, operator, type */
3336 bool oldstyle; /* hack to signal old CREATE AGG syntax */
3337 List *defnames; /* qualified name (list of String) */
3338 List *args; /* a list of TypeName (if needed) */
3339 List *definition; /* a list of DefElem */
3340 bool if_not_exists; /* just do nothing if it already exists? */
3341 bool replace; /* replace if already exists? */
3342} DefineStmt;
3343
3344/* ----------------------
3345 * Create Domain Statement
3346 * ----------------------
3347 */
3348typedef struct CreateDomainStmt
3349{
3350 NodeTag type;
3351 List *domainname; /* qualified name (list of String) */
3352 TypeName *typeName; /* the base type */
3353 CollateClause *collClause; /* untransformed COLLATE spec, if any */
3354 List *constraints; /* constraints (list of Constraint nodes) */
3356
3357/* ----------------------
3358 * Create Operator Class Statement
3359 * ----------------------
3360 */
3361typedef struct CreateOpClassStmt
3362{
3363 NodeTag type;
3364 List *opclassname; /* qualified name (list of String) */
3365 List *opfamilyname; /* qualified name (ditto); NIL if omitted */
3366 char *amname; /* name of index AM opclass is for */
3367 TypeName *datatype; /* datatype of indexed column */
3368 List *items; /* List of CreateOpClassItem nodes */
3369 bool isDefault; /* Should be marked as default for type? */
3371
3372#define OPCLASS_ITEM_OPERATOR 1
3373#define OPCLASS_ITEM_FUNCTION 2
3374#define OPCLASS_ITEM_STORAGETYPE 3
3375
3376typedef struct CreateOpClassItem
3377{
3378 NodeTag type;
3379 int itemtype; /* see codes above */
3380 ObjectWithArgs *name; /* operator or function name and args */
3381 int number; /* strategy num or support proc num */
3382 List *order_family; /* only used for ordering operators */
3383 List *class_args; /* amproclefttype/amprocrighttype or
3384 * amoplefttype/amoprighttype */
3385 /* fields used for a storagetype item: */
3386 TypeName *storedtype; /* datatype stored in index */
3388
3389/* ----------------------
3390 * Create Operator Family Statement
3391 * ----------------------
3392 */
3393typedef struct CreateOpFamilyStmt
3394{
3395 NodeTag type;
3396 List *opfamilyname; /* qualified name (list of String) */
3397 char *amname; /* name of index AM opfamily is for */
3399
3400/* ----------------------
3401 * Alter Operator Family Statement
3402 * ----------------------
3403 */
3404typedef struct AlterOpFamilyStmt
3405{
3406 NodeTag type;
3407 List *opfamilyname; /* qualified name (list of String) */
3408 char *amname; /* name of index AM opfamily is for */
3409 bool isDrop; /* ADD or DROP the items? */
3410 List *items; /* List of CreateOpClassItem nodes */
3412
3413/* ----------------------
3414 * Drop Table|Sequence|View|Index|Type|Domain|Conversion|Schema Statement
3415 * ----------------------
3416 */
3417
3418typedef struct DropStmt
3419{
3420 NodeTag type;
3421 List *objects; /* list of names */
3422 ObjectType removeType; /* object type */
3423 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
3424 bool missing_ok; /* skip error if object is missing? */
3425 bool concurrent; /* drop index concurrently? */
3426} DropStmt;
3427
3428/* ----------------------
3429 * Truncate Table Statement
3430 * ----------------------
3431 */
3432typedef struct TruncateStmt
3433{
3434 NodeTag type;
3435 List *relations; /* relations (RangeVars) to be truncated */
3436 bool restart_seqs; /* restart owned sequences? */
3437 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
3438} TruncateStmt;
3439
3440/* ----------------------
3441 * Comment On Statement
3442 * ----------------------
3443 */
3444typedef struct CommentStmt
3445{
3446 NodeTag type;
3447 ObjectType objtype; /* Object's type */
3448 Node *object; /* Qualified name of the object */
3449 char *comment; /* Comment to insert, or NULL to remove */
3450} CommentStmt;
3451
3452/* ----------------------
3453 * SECURITY LABEL Statement
3454 * ----------------------
3455 */
3456typedef struct SecLabelStmt
3457{
3458 NodeTag type;
3459 ObjectType objtype; /* Object's type */
3460 Node *object; /* Qualified name of the object */
3461 char *provider; /* Label provider (or NULL) */
3462 char *label; /* New security label to be assigned */
3463} SecLabelStmt;
3464
3465/* ----------------------
3466 * Declare Cursor Statement
3467 *
3468 * The "query" field is initially a raw parse tree, and is converted to a
3469 * Query node during parse analysis. Note that rewriting and planning
3470 * of the query are always postponed until execution.
3471 * ----------------------
3472 */
3473#define CURSOR_OPT_BINARY 0x0001 /* BINARY */
3474#define CURSOR_OPT_SCROLL 0x0002 /* SCROLL explicitly given */
3475#define CURSOR_OPT_NO_SCROLL 0x0004 /* NO SCROLL explicitly given */
3476#define CURSOR_OPT_INSENSITIVE 0x0008 /* INSENSITIVE */
3477#define CURSOR_OPT_ASENSITIVE 0x0010 /* ASENSITIVE */
3478#define CURSOR_OPT_HOLD 0x0020 /* WITH HOLD */
3479/* these planner-control flags do not correspond to any SQL grammar: */
3480#define CURSOR_OPT_FAST_PLAN 0x0100 /* prefer fast-start plan */
3481#define CURSOR_OPT_GENERIC_PLAN 0x0200 /* force use of generic plan */
3482#define CURSOR_OPT_CUSTOM_PLAN 0x0400 /* force use of custom plan */
3483#define CURSOR_OPT_PARALLEL_OK 0x0800 /* parallel mode OK */
3484
3485typedef struct DeclareCursorStmt
3486{
3487 NodeTag type;
3488 char *portalname; /* name of the portal (cursor) */
3489 int options; /* bitmask of options (see above) */
3490 Node *query; /* the query (see comments above) */
3492
3493/* ----------------------
3494 * Close Portal Statement
3495 * ----------------------
3496 */
3497typedef struct ClosePortalStmt
3498{
3499 NodeTag type;
3500 char *portalname; /* name of the portal (cursor) */
3501 /* NULL means CLOSE ALL */
3503
3504/* ----------------------
3505 * Fetch Statement (also Move)
3506 * ----------------------
3507 */
3508typedef enum FetchDirection
3509{
3510 /* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
3513 /* for these, howMany indicates a position; only one row is fetched */
3517
3518typedef enum FetchDirectionKeywords
3519{
3533
3534#define FETCH_ALL LONG_MAX
3535
3536typedef struct FetchStmt
3537{
3538 NodeTag type;
3539 FetchDirection direction; /* see above */
3540 /* number of rows, or position argument */
3542 /* name of portal (cursor) */
3543 char *portalname;
3544 /* true if MOVE */
3545 bool ismove;
3546
3547 /*
3548 * Set when a direction_keyword (e.g., FETCH FORWARD) is used, to
3549 * distinguish it from a numeric variant (e.g., FETCH 1) for the purpose
3550 * of query jumbling.
3551 */
3553
3554 /* token location, or -1 if unknown */
3556} FetchStmt;
3557
3558/* ----------------------
3559 * Create Index Statement
3560 *
3561 * This represents creation of an index and/or an associated constraint.
3562 * If isconstraint is true, we should create a pg_constraint entry along
3563 * with the index. But if indexOid isn't InvalidOid, we are not creating an
3564 * index, just a UNIQUE/PKEY constraint using an existing index. isconstraint
3565 * must always be true in this case, and the fields describing the index
3566 * properties are empty.
3567 * ----------------------
3568 */
3569typedef struct IndexStmt
3570{
3571 NodeTag type;
3572 char *idxname; /* name of new index, or NULL for default */
3573 RangeVar *relation; /* relation to build index on */
3574 char *accessMethod; /* name of access method (eg. btree) */
3575 char *tableSpace; /* tablespace, or NULL for default */
3576 List *indexParams; /* columns to index: a list of IndexElem */
3577 List *indexIncludingParams; /* additional columns to index: a list
3578 * of IndexElem */
3579 List *options; /* WITH clause options: a list of DefElem */
3580 Node *whereClause; /* qualification (partial-index predicate) */
3581 List *excludeOpNames; /* exclusion operator names, or NIL if none */
3582 char *idxcomment; /* comment to apply to index, or NULL */
3583 Oid indexOid; /* OID of an existing index, if any */
3584 RelFileNumber oldNumber; /* relfilenumber of existing storage, if any */
3585 SubTransactionId oldCreateSubid; /* rd_createSubid of oldNumber */
3586 SubTransactionId oldFirstRelfilelocatorSubid; /* rd_firstRelfilelocatorSubid
3587 * of oldNumber */
3588 bool unique; /* is index unique? */
3589 bool nulls_not_distinct; /* null treatment for UNIQUE constraints */
3590 bool primary; /* is index a primary key? */
3591 bool isconstraint; /* is it for a pkey/unique constraint? */
3592 bool iswithoutoverlaps; /* is the constraint WITHOUT OVERLAPS? */
3593 bool deferrable; /* is the constraint DEFERRABLE? */
3594 bool initdeferred; /* is the constraint INITIALLY DEFERRED? */
3595 bool transformed; /* true when transformIndexStmt is finished */
3596 bool concurrent; /* should this be a concurrent index build? */
3597 bool if_not_exists; /* just do nothing if index already exists? */
3598 bool reset_default_tblspc; /* reset default_tablespace prior to
3599 * executing */
3600} IndexStmt;
3601
3602/* ----------------------
3603 * Create Statistics Statement
3604 * ----------------------
3605 */
3606typedef struct CreateStatsStmt
3607{
3608 NodeTag type;
3609 List *defnames; /* qualified name (list of String) */
3610 List *stat_types; /* stat types (list of String) */
3611 List *exprs; /* expressions to build statistics on */
3612 List *relations; /* rels to build stats on (list of RangeVar) */
3613 char *stxcomment; /* comment to apply to stats, or NULL */
3614 bool transformed; /* true when transformStatsStmt is finished */
3615 bool if_not_exists; /* do nothing if stats name already exists */
3617
3618/*
3619 * StatsElem - statistics parameters (used in CREATE STATISTICS)
3620 *
3621 * For a plain attribute, 'name' is the name of the referenced table column
3622 * and 'expr' is NULL. For an expression, 'name' is NULL and 'expr' is the
3623 * expression tree.
3624 */
3625typedef struct StatsElem
3626{
3627 NodeTag type;
3628 char *name; /* name of attribute to index, or NULL */
3629 Node *expr; /* expression to index, or NULL */
3630} StatsElem;
3631
3632
3633/* ----------------------
3634 * Alter Statistics Statement
3635 * ----------------------
3636 */
3637typedef struct AlterStatsStmt
3638{
3639 NodeTag type;
3640 List *defnames; /* qualified name (list of String) */
3641 Node *stxstattarget; /* statistics target */
3642 bool missing_ok; /* skip error if statistics object is missing */
3644
3645/* ----------------------
3646 * Create Function Statement
3647 * ----------------------
3648 */
3649typedef struct CreateFunctionStmt
3650{
3651 NodeTag type;
3652 bool is_procedure; /* it's really CREATE PROCEDURE */
3653 bool replace; /* T => replace if already exists */
3654 List *funcname; /* qualified name of function to create */
3655 List *parameters; /* a list of FunctionParameter */
3656 TypeName *returnType; /* the return type */
3657 List *options; /* a list of DefElem */
3658 Node *sql_body;
3660
3661typedef enum FunctionParameterMode
3662{
3663 /* the assigned enum values appear in pg_proc, don't change 'em! */
3664 FUNC_PARAM_IN = 'i', /* input only */
3665 FUNC_PARAM_OUT = 'o', /* output only */
3666 FUNC_PARAM_INOUT = 'b', /* both */
3667 FUNC_PARAM_VARIADIC = 'v', /* variadic (always input) */
3668 FUNC_PARAM_TABLE = 't', /* table function output column */
3669 /* this is not used in pg_proc: */
3670 FUNC_PARAM_DEFAULT = 'd', /* default; effectively same as IN */
3672
3673typedef struct FunctionParameter
3674{
3675 NodeTag type;
3676 char *name; /* parameter name, or NULL if not given */
3677 TypeName *argType; /* TypeName for parameter type */
3678 FunctionParameterMode mode; /* IN/OUT/etc */
3679 Node *defexpr; /* raw default expr, or NULL if not given */
3680 ParseLoc location; /* token location, or -1 if unknown */
3682
3683typedef struct AlterFunctionStmt
3684{
3685 NodeTag type;
3687 ObjectWithArgs *func; /* name and args of function */
3688 List *actions; /* list of DefElem */
3690
3691/* ----------------------
3692 * DO Statement
3693 *
3694 * DoStmt is the raw parser output, InlineCodeBlock is the execution-time API
3695 * ----------------------
3696 */
3697typedef struct DoStmt
3698{
3699 NodeTag type;
3700 List *args; /* List of DefElem nodes */
3701} DoStmt;
3702
3703typedef struct InlineCodeBlock
3704{
3705 pg_node_attr(nodetag_only) /* this is not a member of parse trees */
3706
3707 NodeTag type;
3708 char *source_text; /* source text of anonymous code block */
3709 Oid langOid; /* OID of selected language */
3710 bool langIsTrusted; /* trusted property of the language */
3711 bool atomic; /* atomic execution context */
3713
3714/* ----------------------
3715 * CALL statement
3716 *
3717 * OUT-mode arguments are removed from the transformed funcexpr. The outargs
3718 * list contains copies of the expressions for all output arguments, in the
3719 * order of the procedure's declared arguments. (outargs is never evaluated,
3720 * but is useful to the caller as a reference for what to assign to.)
3721 * The transformed call state is not relevant in the query jumbling, only the
3722 * function call is.
3723 * ----------------------
3724 */
3725typedef struct CallStmt
3726{
3727 NodeTag type;
3728 /* from the parser */
3730 /* transformed call, with only input args */
3732 /* transformed output-argument expressions */
3733 List *outargs;
3734} CallStmt;
3735
3736typedef struct CallContext
3737{
3738 pg_node_attr(nodetag_only) /* this is not a member of parse trees */
3739
3740 NodeTag type;
3741 bool atomic;
3742} CallContext;
3743
3744/* ----------------------
3745 * Alter Object Rename Statement
3746 * ----------------------
3747 */
3748typedef struct RenameStmt
3749{
3750 NodeTag type;
3751 ObjectType renameType; /* OBJECT_TABLE, OBJECT_COLUMN, etc */
3752 ObjectType relationType; /* if column name, associated relation type */
3753 RangeVar *relation; /* in case it's a table */
3754 Node *object; /* in case it's some other object */
3755 char *subname; /* name of contained object (column, rule,
3756 * trigger, etc) */
3757 char *newname; /* the new name */
3758 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
3759 bool missing_ok; /* skip error if missing? */
3760} RenameStmt;
3761
3762/* ----------------------
3763 * ALTER object DEPENDS ON EXTENSION extname
3764 * ----------------------
3765 */
3766typedef struct AlterObjectDependsStmt
3767{
3768 NodeTag type;
3769 ObjectType objectType; /* OBJECT_FUNCTION, OBJECT_TRIGGER, etc */
3770 RangeVar *relation; /* in case a table is involved */
3771 Node *object; /* name of the object */
3772 String *extname; /* extension name */
3773 bool remove; /* set true to remove dep rather than add */
3775
3776/* ----------------------
3777 * ALTER object SET SCHEMA Statement
3778 * ----------------------
3779 */
3780typedef struct AlterObjectSchemaStmt
3781{
3782 NodeTag type;
3783 ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
3784 RangeVar *relation; /* in case it's a table */
3785 Node *object; /* in case it's some other object */
3786 char *newschema; /* the new schema */
3787 bool missing_ok; /* skip error if missing? */
3789
3790/* ----------------------
3791 * Alter Object Owner Statement
3792 * ----------------------
3793 */
3794typedef struct AlterOwnerStmt
3795{
3796 NodeTag type;
3797 ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
3798 RangeVar *relation; /* in case it's a table */
3799 Node *object; /* in case it's some other object */
3800 RoleSpec *newowner; /* the new owner */
3802
3803/* ----------------------
3804 * Alter Operator Set ( this-n-that )
3805 * ----------------------
3806 */
3807typedef struct AlterOperatorStmt
3808{
3809 NodeTag type;
3810 ObjectWithArgs *opername; /* operator name and argument types */
3811 List *options; /* List of DefElem nodes */
3813
3814/* ------------------------
3815 * Alter Type Set ( this-n-that )
3816 * ------------------------
3817 */
3818typedef struct AlterTypeStmt
3819{
3820 NodeTag type;
3821 List *typeName; /* type name (possibly qualified) */
3822 List *options; /* List of DefElem nodes */
3824
3825/* ----------------------
3826 * Create Rule Statement
3827 * ----------------------
3828 */
3829typedef struct RuleStmt
3830{
3831 NodeTag type;
3832 RangeVar *relation; /* relation the rule is for */
3833 char *rulename; /* name of the rule */
3834 Node *whereClause; /* qualifications */
3835 CmdType event; /* SELECT, INSERT, etc */
3836 bool instead; /* is a 'do instead'? */
3837 List *actions; /* the action statements */
3838 bool replace; /* OR REPLACE */
3839} RuleStmt;
3840
3841/* ----------------------
3842 * Notify Statement
3843 * ----------------------
3844 */
3845typedef struct NotifyStmt
3846{
3847 NodeTag type;
3848 char *conditionname; /* condition name to notify */
3849 char *payload; /* the payload string, or NULL if none */
3850} NotifyStmt;
3851
3852/* ----------------------
3853 * Listen Statement
3854 * ----------------------
3855 */
3856typedef struct ListenStmt
3857{
3858 NodeTag type;
3859 char *conditionname; /* condition name to listen on */
3860} ListenStmt;
3861
3862/* ----------------------
3863 * Unlisten Statement
3864 * ----------------------
3865 */
3866typedef struct UnlistenStmt
3867{
3868 NodeTag type;
3869 char *conditionname; /* name to unlisten on, or NULL for all */
3870} UnlistenStmt;
3871
3872/* ----------------------
3873 * {Begin|Commit|Rollback} Transaction Statement
3874 * ----------------------
3875 */
3876typedef enum TransactionStmtKind
3877{
3879 TRANS_STMT_START, /* semantically identical to BEGIN */
3889
3890typedef struct TransactionStmt
3891{
3892 NodeTag type;
3893 TransactionStmtKind kind; /* see above */
3894 List *options; /* for BEGIN/START commands */
3895 /* for savepoint commands */
3897 /* for two-phase-commit related commands */
3899 bool chain; /* AND CHAIN option */
3900 /* token location, or -1 if unknown */
3903
3904/* ----------------------
3905 * Create Type Statement, composite types
3906 * ----------------------
3907 */
3908typedef struct CompositeTypeStmt
3909{
3910 NodeTag type;
3911 RangeVar *typevar; /* the composite type to be created */
3912 List *coldeflist; /* list of ColumnDef nodes */
3914
3915/* ----------------------
3916 * Create Type Statement, enum types
3917 * ----------------------
3918 */
3919typedef struct CreateEnumStmt
3920{
3921 NodeTag type;
3922 List *typeName; /* qualified name (list of String) */
3923 List *vals; /* enum values (list of String) */
3925
3926/* ----------------------
3927 * Create Type Statement, range types
3928 * ----------------------
3929 */
3930typedef struct CreateRangeStmt
3931{
3932 NodeTag type;
3933 List *typeName; /* qualified name (list of String) */
3934 List *params; /* range parameters (list of DefElem) */
3936
3937/* ----------------------
3938 * Alter Type Statement, enum types
3939 * ----------------------
3940 */
3941typedef struct AlterEnumStmt
3942{
3943 NodeTag type;
3944 List *typeName; /* qualified name (list of String) */
3945 char *oldVal; /* old enum value's name, if renaming */
3946 char *newVal; /* new enum value's name */
3947 char *newValNeighbor; /* neighboring enum value, if specified */
3948 bool newValIsAfter; /* place new enum value after neighbor? */
3949 bool skipIfNewValExists; /* no error if new already exists? */
3951
3952/* ----------------------
3953 * Create View Statement
3954 * ----------------------
3955 */
3956typedef enum ViewCheckOption
3957{
3962
3963typedef struct ViewStmt
3964{
3965 NodeTag type;
3966 RangeVar *view; /* the view to be created */
3967 List *aliases; /* target column names */
3968 Node *query; /* the SELECT query (as a raw parse tree) */
3969 bool replace; /* replace an existing view? */
3970 List *options; /* options from WITH clause */
3971 ViewCheckOption withCheckOption; /* WITH CHECK OPTION */
3972} ViewStmt;
3973
3974/* ----------------------
3975 * Load Statement
3976 * ----------------------
3977 */
3978typedef struct LoadStmt
3979{
3980 NodeTag type;
3981 char *filename; /* file to load */
3982} LoadStmt;
3983
3984/* ----------------------
3985 * Createdb Statement
3986 * ----------------------
3987 */
3988typedef struct CreatedbStmt
3989{
3990 NodeTag type;
3991 char *dbname; /* name of database to create */
3992 List *options; /* List of DefElem nodes */
3993} CreatedbStmt;
3994
3995/* ----------------------
3996 * Alter Database
3997 * ----------------------
3998 */
3999typedef struct AlterDatabaseStmt
4000{
4001 NodeTag type;
4002 char *dbname; /* name of database to alter */
4003 List *options; /* List of DefElem nodes */
4005
4006typedef struct AlterDatabaseRefreshCollStmt
4007{
4008 NodeTag type;
4009 char *dbname;
4011
4012typedef struct AlterDatabaseSetStmt
4013{
4014 NodeTag type;
4015 char *dbname; /* database name */
4016 VariableSetStmt *setstmt; /* SET or RESET subcommand */
4018
4019/* ----------------------
4020 * Dropdb Statement
4021 * ----------------------
4022 */
4023typedef struct DropdbStmt
4024{
4025 NodeTag type;
4026 char *dbname; /* database to drop */
4027 bool missing_ok; /* skip error if db is missing? */
4028 List *options; /* currently only FORCE is supported */
4029} DropdbStmt;
4030
4031/* ----------------------
4032 * Alter System Statement
4033 * ----------------------
4034 */
4035typedef struct AlterSystemStmt
4036{
4037 NodeTag type;
4038 VariableSetStmt *setstmt; /* SET subcommand */
4040
4041/* ----------------------
4042 * Vacuum and Analyze Statements
4043 *
4044 * Even though these are nominally two statements, it's convenient to use
4045 * just one node type for both.
4046 * ----------------------
4047 */
4048typedef struct VacuumStmt
4049{
4050 NodeTag type;
4051 List *options; /* list of DefElem nodes */
4052 List *rels; /* list of VacuumRelation, or NIL for all */
4053 bool is_vacuumcmd; /* true for VACUUM, false otherwise */
4054} VacuumStmt;
4055
4056/*
4057 * Info about a single target table of VACUUM/ANALYZE.
4058 *
4059 * If the OID field is set, it always identifies the table to process.
4060 * Then the relation field can be NULL; if it isn't, it's used only to report
4061 * failure to open/lock the relation.
4062 */
4063typedef struct VacuumRelation
4064{
4065 NodeTag type;
4066 RangeVar *relation; /* table name to process, or NULL */
4067 Oid oid; /* table's OID; InvalidOid if not looked up */
4068 List *va_cols; /* list of column names, or NIL for all */
4070
4071/* ----------------------
4072 * Repack Statement
4073 * ----------------------
4074 */
4075typedef enum RepackCommand
4076{
4081
4082typedef struct RepackStmt
4083{
4084 NodeTag type;
4085 RepackCommand command; /* type of command being run */
4086 VacuumRelation *relation; /* relation being repacked */
4087 char *indexname; /* order tuples by this index */
4088 bool usingindex; /* whether USING INDEX is specified */
4089 List *params; /* list of DefElem nodes */
4090} RepackStmt;
4091
4092/* ----------------------
4093 * Explain Statement
4094 *
4095 * The "query" field is initially a raw parse tree, and is converted to a
4096 * Query node during parse analysis. Note that rewriting and planning
4097 * of the query are always postponed until execution.
4098 * ----------------------
4099 */
4100typedef struct ExplainStmt
4101{
4102 NodeTag type;
4103 Node *query; /* the query (see comments above) */
4104 List *options; /* list of DefElem nodes */
4105} ExplainStmt;
4106
4107/* ----------------------
4108 * CREATE TABLE AS Statement (a/k/a SELECT INTO)
4109 *
4110 * A query written as CREATE TABLE AS will produce this node type natively.
4111 * A query written as SELECT ... INTO will be transformed to this form during
4112 * parse analysis.
4113 * A query written as CREATE MATERIALIZED view will produce this node type,
4114 * during parse analysis, since it needs all the same data.
4115 *
4116 * The "query" field is handled similarly to EXPLAIN, though note that it
4117 * can be a SELECT or an EXECUTE, but not other DML statements.
4118 * ----------------------
4119 */
4120typedef struct CreateTableAsStmt
4121{
4122 NodeTag type;
4123 Node *query; /* the query (see comments above) */
4124 IntoClause *into; /* destination table */
4125 ObjectType objtype; /* OBJECT_TABLE or OBJECT_MATVIEW */
4126 bool is_select_into; /* it was written as SELECT INTO */
4127 bool if_not_exists; /* just do nothing if it already exists? */
4129
4130/* ----------------------
4131 * REFRESH MATERIALIZED VIEW Statement
4132 * ----------------------
4133 */
4134typedef struct RefreshMatViewStmt
4135{
4136 NodeTag type;
4137 bool concurrent; /* allow concurrent access? */
4138 bool skipData; /* true for WITH NO DATA */
4139 RangeVar *relation; /* relation to insert into */
4141
4142/* ----------------------
4143 * Checkpoint Statement
4144 * ----------------------
4145 */
4146typedef struct CheckPointStmt
4147{
4148 NodeTag type;
4149 List *options; /* list of DefElem nodes */
4151
4152/* ----------------------
4153 * Discard Statement
4154 * ----------------------
4155 */
4156
4157typedef enum DiscardMode
4158{
4163} DiscardMode;
4164
4165typedef struct DiscardStmt
4166{
4167 NodeTag type;
4169} DiscardStmt;
4170
4171/* ----------------------
4172 * LOCK Statement
4173 * ----------------------
4174 */
4175typedef struct LockStmt
4176{
4177 NodeTag type;
4178 List *relations; /* relations to lock */
4179 int mode; /* lock mode */
4180 bool nowait; /* no wait mode */
4181} LockStmt;
4182
4183/* ----------------------
4184 * SET CONSTRAINTS Statement
4185 * ----------------------
4186 */
4187typedef struct ConstraintsSetStmt
4188{
4189 NodeTag type;
4190 List *constraints; /* List of names as RangeVars */
4191 bool deferred;
4193
4194/* ----------------------
4195 * REINDEX Statement
4196 * ----------------------
4197 */
4198typedef enum ReindexObjectType
4199{
4200 REINDEX_OBJECT_INDEX, /* index */
4201 REINDEX_OBJECT_TABLE, /* table or materialized view */
4202 REINDEX_OBJECT_SCHEMA, /* schema */
4203 REINDEX_OBJECT_SYSTEM, /* system catalogs */
4204 REINDEX_OBJECT_DATABASE, /* database */
4206
4207typedef struct ReindexStmt
4208{
4209 NodeTag type;
4210 ReindexObjectType kind; /* REINDEX_OBJECT_INDEX, REINDEX_OBJECT_TABLE,
4211 * etc. */
4212 RangeVar *relation; /* Table or index to reindex */
4213 const char *name; /* name of database to reindex */
4214 List *params; /* list of DefElem nodes */
4215} ReindexStmt;
4216
4217/* ----------------------
4218 * CREATE CONVERSION Statement
4219 * ----------------------
4220 */
4221typedef struct CreateConversionStmt
4222{
4223 NodeTag type;
4224 List *conversion_name; /* Name of the conversion */
4225 char *for_encoding_name; /* source encoding name */
4226 char *to_encoding_name; /* destination encoding name */
4227 List *func_name; /* qualified conversion function name */
4228 bool def; /* is this a default conversion? */
4230
4231/* ----------------------
4232 * CREATE CAST Statement
4233 * ----------------------
4234 */
4235typedef struct CreateCastStmt
4236{
4237 NodeTag type;
4242 bool inout;
4244
4245/* ----------------------
4246 * CREATE PROPERTY GRAPH Statement
4247 * ----------------------
4248 */
4249typedef struct CreatePropGraphStmt
4250{
4251 NodeTag type;
4256
4257typedef struct PropGraphVertex
4258{
4259 NodeTag type;
4261 List *vkey;
4262 List *labels;
4265
4266typedef struct PropGraphEdge
4267{
4268 NodeTag type;
4270 List *ekey;
4271 List *esrckey;
4272 char *esrcvertex;
4274 List *edestkey;
4275 char *edestvertex;
4277 List *labels;
4280
4281typedef struct PropGraphLabelAndProperties
4282{
4283 NodeTag type;
4284 const char *label;
4288
4289typedef struct PropGraphProperties
4290{
4291 NodeTag type;
4293 bool all;
4296
4297/* ----------------------
4298 * ALTER PROPERTY GRAPH Statement
4299 * ----------------------
4300 */
4301
4302typedef enum AlterPropGraphElementKind
4303{
4307
4308typedef struct AlterPropGraphStmt
4309{
4310 NodeTag type;
4312 bool missing_ok;
4319 const char *element_alias;
4321 const char *drop_label;
4322 const char *alter_label;
4326
4327/* ----------------------
4328 * CREATE TRANSFORM Statement
4329 * ----------------------
4330 */
4331typedef struct CreateTransformStmt
4332{
4333 NodeTag type;
4334 bool replace;
4336 char *lang;
4340
4341/* ----------------------
4342 * PREPARE Statement
4343 * ----------------------
4344 */
4345typedef struct PrepareStmt
4346{
4347 NodeTag type;
4348 char *name; /* Name of plan, arbitrary */
4349 List *argtypes; /* Types of parameters (List of TypeName) */
4350 Node *query; /* The query itself (as a raw parsetree) */
4351} PrepareStmt;
4352
4353
4354/* ----------------------
4355 * EXECUTE Statement
4356 * ----------------------
4357 */
4358
4359typedef struct ExecuteStmt
4360{
4361 NodeTag type;
4362 char *name; /* The name of the plan to execute */
4363 List *params; /* Values to assign to parameters */
4364} ExecuteStmt;
4365
4366
4367/* ----------------------
4368 * DEALLOCATE Statement
4369 * ----------------------
4370 */
4371typedef struct DeallocateStmt
4372{
4373 NodeTag type;
4374 /* The name of the plan to remove, NULL if DEALLOCATE ALL */
4376
4377 /*
4378 * True if DEALLOCATE ALL. This is redundant with "name == NULL", but we
4379 * make it a separate field so that exactly this condition (and not the
4380 * precise name) will be accounted for in query jumbling.
4381 */
4382 bool isall;
4383 /* token location, or -1 if unknown */
4386
4387/*
4388 * DROP OWNED statement
4389 */
4390typedef struct DropOwnedStmt
4391{
4392 NodeTag type;
4393 List *roles;
4396
4397/*
4398 * REASSIGN OWNED statement
4399 */
4400typedef struct ReassignOwnedStmt
4401{
4402 NodeTag type;
4403 List *roles;
4406
4407/*
4408 * TS Dictionary stmts: DefineStmt, RenameStmt and DropStmt are default
4409 */
4410typedef struct AlterTSDictionaryStmt
4411{
4412 NodeTag type;
4413 List *dictname; /* qualified name (list of String) */
4414 List *options; /* List of DefElem nodes */
4416
4417/*
4418 * TS Configuration stmts: DefineStmt, RenameStmt and DropStmt are default
4419 */
4420typedef enum AlterTSConfigType
4421{
4428
4429typedef struct AlterTSConfigurationStmt
4430{
4431 NodeTag type;
4432 AlterTSConfigType kind; /* ALTER_TSCONFIG_ADD_MAPPING, etc */
4433 List *cfgname; /* qualified name (list of String) */
4434
4435 /*
4436 * dicts will be non-NIL if ADD/ALTER MAPPING was specified. If dicts is
4437 * NIL, but tokentype isn't, DROP MAPPING was specified.
4438 */
4439 List *tokentype; /* list of String */
4440 List *dicts; /* list of list of String */
4441 bool override; /* if true - remove old variant */
4442 bool replace; /* if true - replace dictionary by another */
4443 bool missing_ok; /* for DROP - skip error if missing? */
4445
4446typedef struct PublicationTable
4447{
4448 NodeTag type;
4449 RangeVar *relation; /* publication relation */
4450 Node *whereClause; /* qualifications */
4451 List *columns; /* List of columns in a publication table */
4452 bool except; /* True if listed in the EXCEPT clause */
4454
4455/*
4456 * Publication object type
4457 */
4458typedef enum PublicationObjSpecType
4459{
4460 PUBLICATIONOBJ_TABLE, /* A table */
4461 PUBLICATIONOBJ_EXCEPT_TABLE, /* A table in the EXCEPT clause */
4462 PUBLICATIONOBJ_TABLES_IN_SCHEMA, /* All tables in schema */
4463 PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA, /* All tables in first element of
4464 * search_path */
4465 PUBLICATIONOBJ_CONTINUATION, /* Continuation of previous type */
4467
4468typedef struct PublicationObjSpec
4469{
4470 NodeTag type;
4471 PublicationObjSpecType pubobjtype; /* type of this publication object */
4472 char *name;
4474 ParseLoc location; /* token location, or -1 if unknown */
4476
4477/*
4478 * Types of objects supported by FOR ALL publications
4479 */
4480typedef enum PublicationAllObjType
4481{
4485
4486typedef struct PublicationAllObjSpec
4487{
4488 NodeTag type;
4489 PublicationAllObjType pubobjtype; /* type of this publication object */
4490 List *except_tables; /* tables specified in the EXCEPT clause */
4491 ParseLoc location; /* token location, or -1 if unknown */
4493
4494typedef struct CreatePublicationStmt
4495{
4496 NodeTag type;
4497 char *pubname; /* Name of the publication */
4498 List *options; /* List of DefElem nodes */
4499 List *pubobjects; /* Optional list of publication objects */
4500 bool for_all_tables; /* Special publication for all tables in db */
4501 bool for_all_sequences; /* Special publication for all sequences
4502 * in db */
4504
4505typedef enum AlterPublicationAction
4506{
4507 AP_AddObjects, /* add objects to publication */
4508 AP_DropObjects, /* remove objects from publication */
4509 AP_SetObjects, /* set list of objects */
4511
4512typedef struct AlterPublicationStmt
4513{
4514 NodeTag type;
4515 char *pubname; /* Name of the publication */
4516
4517 /* parameters used for ALTER PUBLICATION ... WITH */
4518 List *options; /* List of DefElem nodes */
4519
4520 /*
4521 * Parameters used for ALTER PUBLICATION ... ADD/DROP/SET publication
4522 * objects.
4523 */
4524 List *pubobjects; /* Optional list of publication objects */
4525 AlterPublicationAction action; /* What action to perform with the given
4526 * objects */
4527 bool for_all_tables; /* True if ALL TABLES is specified */
4528 bool for_all_sequences; /* True if ALL SEQUENCES is specified */
4530
4531typedef struct CreateSubscriptionStmt
4532{
4533 NodeTag type;
4534 char *subname; /* Name of the subscription */
4535 char *servername; /* Server name of publisher */
4536 char *conninfo; /* Connection string to publisher */
4537 List *publication; /* One or more publication to subscribe to */
4538 List *options; /* List of DefElem nodes */
4540
4541typedef enum AlterSubscriptionType
4542{
4554
4555typedef struct AlterSubscriptionStmt
4556{
4557 NodeTag type;
4558 AlterSubscriptionType kind; /* ALTER_SUBSCRIPTION_OPTIONS, etc */
4559 char *subname; /* Name of the subscription */
4560 char *servername; /* Server name of publisher */
4561 char *conninfo; /* Connection string to publisher */
4562 List *publication; /* One or more publication to subscribe to */
4563 List *options; /* List of DefElem nodes */
4565
4566typedef struct DropSubscriptionStmt
4567{
4568 NodeTag type;
4569 char *subname; /* Name of the subscription */
4570 bool missing_ok; /* Skip error if missing? */
4571 DropBehavior behavior; /* RESTRICT or CASCADE behavior */
4573
4574typedef struct WaitStmt
4575{
4576 NodeTag type;
4577 char *lsn_literal; /* LSN string from grammar */
4578 List *options; /* List of DefElem nodes */
4579} WaitStmt;
4580
4581
4582#endif /* PARSENODES_H */
#define PG_INT32_MAX
Definition c.h:675
uint32 SubTransactionId
Definition c.h:742
int16_t int16
Definition c.h:613
uint32 bits32
Definition c.h:627
unsigned int Index
Definition c.h:700
LockWaitPolicy
Definition lockoptions.h:38
LockClauseStrength
Definition lockoptions.h:22
#define pg_node_attr(...)
Definition nodes.h:126
OnConflictAction
Definition nodes.h:427
double Cardinality
Definition nodes.h:262
CmdType
Definition nodes.h:273
NodeTag
Definition nodes.h:27
LimitOption
Definition nodes.h:441
int ParseLoc
Definition nodes.h:250
JoinType
Definition nodes.h:298
AlterSubscriptionType
@ ALTER_SUBSCRIPTION_REFRESH_PUBLICATION
@ ALTER_SUBSCRIPTION_ENABLED
@ ALTER_SUBSCRIPTION_DROP_PUBLICATION
@ ALTER_SUBSCRIPTION_SERVER
@ ALTER_SUBSCRIPTION_SET_PUBLICATION
@ ALTER_SUBSCRIPTION_REFRESH_SEQUENCES
@ ALTER_SUBSCRIPTION_SKIP
@ ALTER_SUBSCRIPTION_OPTIONS
@ ALTER_SUBSCRIPTION_CONNECTION
@ ALTER_SUBSCRIPTION_ADD_PUBLICATION
PublicationAllObjType
@ PUBLICATION_ALL_TABLES
@ PUBLICATION_ALL_SEQUENCES
AlterDomainType
@ AD_AddConstraint
@ AD_DropConstraint
@ AD_AlterDefault
@ AD_DropNotNull
@ AD_ValidateConstraint
@ AD_SetNotNull
TransactionStmtKind
@ TRANS_STMT_ROLLBACK_TO
@ TRANS_STMT_START
@ TRANS_STMT_SAVEPOINT
@ TRANS_STMT_BEGIN
@ TRANS_STMT_ROLLBACK
@ TRANS_STMT_COMMIT_PREPARED
@ TRANS_STMT_COMMIT
@ TRANS_STMT_ROLLBACK_PREPARED
@ TRANS_STMT_PREPARE
@ TRANS_STMT_RELEASE
WCOKind
@ WCO_RLS_MERGE_UPDATE_CHECK
@ WCO_RLS_CONFLICT_CHECK
@ WCO_RLS_INSERT_CHECK
@ WCO_VIEW_CHECK
@ WCO_RLS_UPDATE_CHECK
@ WCO_RLS_MERGE_DELETE_CHECK
JsonTableColumnType
@ JTC_FORMATTED
@ JTC_FOR_ORDINALITY
@ JTC_NESTED
@ JTC_EXISTS
@ JTC_REGULAR
SortByNulls
Definition parsenodes.h:53
RepackCommand
@ REPACK_COMMAND_REPACK
@ REPACK_COMMAND_CLUSTER
@ REPACK_COMMAND_VACUUMFULL
GroupingSetKind
@ GROUPING_SET_CUBE
@ GROUPING_SET_SIMPLE
@ GROUPING_SET_ROLLUP
@ GROUPING_SET_SETS
@ GROUPING_SET_EMPTY
SetOperation
@ SETOP_INTERSECT
@ SETOP_UNION
@ SETOP_EXCEPT
@ SETOP_NONE
uint64 AclMode
Definition parsenodes.h:74
JsonQuotes
@ JS_QUOTES_KEEP
@ JS_QUOTES_UNSPEC
@ JS_QUOTES_OMIT
FunctionParameterMode
@ FUNC_PARAM_IN
@ FUNC_PARAM_DEFAULT
@ FUNC_PARAM_OUT
@ FUNC_PARAM_INOUT
@ FUNC_PARAM_TABLE
@ FUNC_PARAM_VARIADIC
AlterTSConfigType
@ ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN
@ ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN
@ ALTER_TSCONFIG_REPLACE_DICT
@ ALTER_TSCONFIG_ADD_MAPPING
@ ALTER_TSCONFIG_DROP_MAPPING
PublicationObjSpecType
@ PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA
@ PUBLICATIONOBJ_TABLES_IN_SCHEMA
@ PUBLICATIONOBJ_TABLE
@ PUBLICATIONOBJ_EXCEPT_TABLE
@ PUBLICATIONOBJ_CONTINUATION
PartitionStrategy
Definition parsenodes.h:913
@ PARTITION_STRATEGY_HASH
Definition parsenodes.h:916
@ PARTITION_STRATEGY_LIST
Definition parsenodes.h:914
@ PARTITION_STRATEGY_RANGE
Definition parsenodes.h:915
ImportForeignSchemaType
@ FDW_IMPORT_SCHEMA_LIMIT_TO
@ FDW_IMPORT_SCHEMA_ALL
@ FDW_IMPORT_SCHEMA_EXCEPT
AlterPublicationAction
@ AP_DropObjects
@ AP_SetObjects
@ AP_AddObjects
RTEKind
@ RTE_JOIN
@ RTE_CTE
@ RTE_NAMEDTUPLESTORE
@ RTE_VALUES
@ RTE_SUBQUERY
@ RTE_RESULT
@ RTE_FUNCTION
@ RTE_TABLEFUNC
@ RTE_GROUP
@ RTE_GRAPH_TABLE
@ RTE_RELATION
DefElemAction
Definition parsenodes.h:846
@ DEFELEM_UNSPEC
Definition parsenodes.h:847
@ DEFELEM_DROP
Definition parsenodes.h:850
@ DEFELEM_SET
Definition parsenodes.h:848
@ DEFELEM_ADD
Definition parsenodes.h:849
ConstrType
@ CONSTR_ATTR_ENFORCED
@ CONSTR_FOREIGN
@ CONSTR_ATTR_DEFERRED
@ CONSTR_IDENTITY
@ CONSTR_UNIQUE
@ CONSTR_ATTR_NOT_DEFERRABLE
@ CONSTR_DEFAULT
@ CONSTR_NOTNULL
@ CONSTR_ATTR_IMMEDIATE
@ CONSTR_CHECK
@ CONSTR_NULL
@ CONSTR_GENERATED
@ CONSTR_EXCLUSION
@ CONSTR_ATTR_DEFERRABLE
@ CONSTR_ATTR_NOT_ENFORCED
@ CONSTR_PRIMARY
PartitionRangeDatumKind
Definition parsenodes.h:965
@ PARTITION_RANGE_DATUM_MAXVALUE
Definition parsenodes.h:968
@ PARTITION_RANGE_DATUM_VALUE
Definition parsenodes.h:967
@ PARTITION_RANGE_DATUM_MINVALUE
Definition parsenodes.h:966
GraphElementPatternKind
@ EDGE_PATTERN_RIGHT
@ VERTEX_PATTERN
@ EDGE_PATTERN_LEFT
@ PAREN_EXPR
@ EDGE_PATTERN_ANY
FetchDirection
@ FETCH_RELATIVE
@ FETCH_ABSOLUTE
@ FETCH_FORWARD
@ FETCH_BACKWARD
VariableSetKind
@ VAR_SET_DEFAULT
@ VAR_RESET
@ VAR_SET_MULTI
@ VAR_SET_VALUE
@ VAR_SET_CURRENT
@ VAR_RESET_ALL
DropBehavior
@ DROP_CASCADE
@ DROP_RESTRICT
ObjectType
@ OBJECT_EVENT_TRIGGER
@ OBJECT_FDW
@ OBJECT_TSPARSER
@ OBJECT_COLLATION
@ OBJECT_USER_MAPPING
@ OBJECT_PROPGRAPH
@ OBJECT_ACCESS_METHOD
@ OBJECT_OPCLASS
@ OBJECT_DEFACL
@ OBJECT_AGGREGATE
@ OBJECT_MATVIEW
@ OBJECT_SCHEMA
@ OBJECT_POLICY
@ OBJECT_OPERATOR
@ OBJECT_FOREIGN_TABLE
@ OBJECT_TSCONFIGURATION
@ OBJECT_OPFAMILY
@ OBJECT_DOMAIN
@ OBJECT_COLUMN
@ OBJECT_TABLESPACE
@ OBJECT_ROLE
@ OBJECT_ROUTINE
@ OBJECT_LARGEOBJECT
@ OBJECT_PUBLICATION_NAMESPACE
@ OBJECT_PROCEDURE
@ OBJECT_EXTENSION
@ OBJECT_INDEX
@ OBJECT_DEFAULT
@ OBJECT_DATABASE
@ OBJECT_SEQUENCE
@ OBJECT_TSTEMPLATE
@ OBJECT_LANGUAGE
@ OBJECT_AMOP
@ OBJECT_PUBLICATION_REL
@ OBJECT_FOREIGN_SERVER
@ OBJECT_TSDICTIONARY
@ OBJECT_ATTRIBUTE
@ OBJECT_PUBLICATION
@ OBJECT_RULE
@ OBJECT_CONVERSION
@ OBJECT_AMPROC
@ OBJECT_TABLE
@ OBJECT_VIEW
@ OBJECT_PARAMETER_ACL
@ OBJECT_TYPE
@ OBJECT_FUNCTION
@ OBJECT_TABCONSTRAINT
@ OBJECT_DOMCONSTRAINT
@ OBJECT_SUBSCRIPTION
@ OBJECT_STATISTIC_EXT
@ OBJECT_CAST
@ OBJECT_TRIGGER
@ OBJECT_TRANSFORM
ReindexObjectType
@ REINDEX_OBJECT_DATABASE
@ REINDEX_OBJECT_INDEX
@ REINDEX_OBJECT_SCHEMA
@ REINDEX_OBJECT_SYSTEM
@ REINDEX_OBJECT_TABLE
AlterPropGraphElementKind
@ PROPGRAPH_ELEMENT_KIND_EDGE
@ PROPGRAPH_ELEMENT_KIND_VERTEX
AlterTableType
@ AT_AddIndexConstraint
@ AT_MergePartitions
@ AT_DropOf
@ AT_SetOptions
@ AT_DropIdentity
@ AT_DisableTrigUser
@ AT_DropNotNull
@ AT_AddOf
@ AT_ResetOptions
@ AT_ReplicaIdentity
@ AT_ReplaceRelOptions
@ AT_EnableRowSecurity
@ AT_AddColumnToView
@ AT_ResetRelOptions
@ AT_EnableReplicaTrig
@ AT_DropOids
@ AT_SetIdentity
@ AT_ReAddStatistics
@ AT_SetUnLogged
@ AT_DisableTrig
@ AT_SetCompression
@ AT_DropExpression
@ AT_AddIndex
@ AT_EnableReplicaRule
@ AT_ReAddIndex
@ AT_DropConstraint
@ AT_SetNotNull
@ AT_ClusterOn
@ AT_AddIdentity
@ AT_ForceRowSecurity
@ AT_EnableAlwaysRule
@ AT_SetAccessMethod
@ AT_AlterColumnType
@ AT_DetachPartitionFinalize
@ AT_AddInherit
@ AT_ReAddDomainConstraint
@ AT_EnableTrig
@ AT_DropColumn
@ AT_ReAddComment
@ AT_AlterColumnGenericOptions
@ AT_DisableTrigAll
@ AT_EnableRule
@ AT_NoForceRowSecurity
@ AT_DetachPartition
@ AT_SetStatistics
@ AT_AttachPartition
@ AT_AddConstraint
@ AT_DropInherit
@ AT_EnableAlwaysTrig
@ AT_SetLogged
@ AT_SetStorage
@ AT_DisableRule
@ AT_DisableRowSecurity
@ AT_SetRelOptions
@ AT_ChangeOwner
@ AT_EnableTrigUser
@ AT_SetExpression
@ AT_ReAddConstraint
@ AT_SetTableSpace
@ AT_GenericOptions
@ AT_ColumnDefault
@ AT_CookedColumnDefault
@ AT_AlterConstraint
@ AT_EnableTrigAll
@ AT_SplitPartition
@ AT_DropCluster
@ AT_ValidateConstraint
@ AT_AddColumn
GrantTargetType
@ ACL_TARGET_DEFAULTS
@ ACL_TARGET_OBJECT
@ ACL_TARGET_ALL_IN_SCHEMA
FetchDirectionKeywords
@ FETCH_KEYWORD_LAST
@ FETCH_KEYWORD_RELATIVE
@ FETCH_KEYWORD_PRIOR
@ FETCH_KEYWORD_FIRST
@ FETCH_KEYWORD_NEXT
@ FETCH_KEYWORD_FORWARD_ALL
@ FETCH_KEYWORD_NONE
@ FETCH_KEYWORD_ABSOLUTE
@ FETCH_KEYWORD_FORWARD
@ FETCH_KEYWORD_BACKWARD
@ FETCH_KEYWORD_ALL
@ FETCH_KEYWORD_BACKWARD_ALL
DiscardMode
@ DISCARD_ALL
@ DISCARD_PLANS
@ DISCARD_SEQUENCES
@ DISCARD_TEMP
ReturningOptionKind
@ RETURNING_OPTION_NEW
@ RETURNING_OPTION_OLD
SortByDir
Definition parsenodes.h:45
RoleStmtType
@ ROLESTMT_ROLE
@ ROLESTMT_USER
@ ROLESTMT_GROUP
TableLikeOption
Definition parsenodes.h:801
@ CREATE_TABLE_LIKE_COMMENTS
Definition parsenodes.h:802
@ CREATE_TABLE_LIKE_GENERATED
Definition parsenodes.h:806
@ CREATE_TABLE_LIKE_IDENTITY
Definition parsenodes.h:807
@ CREATE_TABLE_LIKE_COMPRESSION
Definition parsenodes.h:803
@ CREATE_TABLE_LIKE_STORAGE
Definition parsenodes.h:810
@ CREATE_TABLE_LIKE_ALL
Definition parsenodes.h:811
@ CREATE_TABLE_LIKE_INDEXES
Definition parsenodes.h:808
@ CREATE_TABLE_LIKE_DEFAULTS
Definition parsenodes.h:805
@ CREATE_TABLE_LIKE_STATISTICS
Definition parsenodes.h:809
@ CREATE_TABLE_LIKE_CONSTRAINTS
Definition parsenodes.h:804
ViewCheckOption
@ NO_CHECK_OPTION
@ CASCADED_CHECK_OPTION
@ LOCAL_CHECK_OPTION
CTEMaterialize
@ CTEMaterializeNever
@ CTEMaterializeAlways
@ CTEMaterializeDefault
unsigned int Oid
static int fb(int x)
XmlOptionType
Definition primnodes.h:1617
JsonWrapper
Definition primnodes.h:1776
OnCommitAction
Definition primnodes.h:58
JsonExprOp
Definition primnodes.h:1828
OverridingKind
Definition primnodes.h:28
MergeMatchKind
Definition primnodes.h:2022
CoercionContext
Definition primnodes.h:746
Oid RelFileNumber
Definition relpath.h:25
char * priv_name
NodeTag type
List * cols
VariableSetStmt * setstmt
AlterDomainType subtype
DropBehavior behavior
char * newValNeighbor
bool skipIfNewValExists
List * func_options
ObjectWithArgs * func
ObjectType objtype
ObjectWithArgs * opername
RangeVar * relation
RoleSpec * newowner
ObjectType objectType
RangeVar * table
PropGraphProperties * add_properties
const char * alter_label
AlterPropGraphElementKind element_kind
DropBehavior drop_behavior
const char * element_alias
const char * drop_label
AlterPublicationAction action
RoleSpec * role
VariableSetStmt * setstmt
RoleSpec * role
RangeVar * sequence
Node * stxstattarget
AlterSubscriptionType kind
VariableSetStmt * setstmt
AlterTSConfigType kind
RoleSpec * newowner
DropBehavior behavior
AlterTableType subtype
RangeVar * relation
ObjectType objtype
char * cycle_path_column
ParseLoc location
Node * cycle_mark_default
List * cycle_col_list
char * cycle_mark_column
Node * cycle_mark_value
ParseLoc location
char * search_seq_column
bool search_breadth_first
List * search_col_list
FuncExpr * funcexpr
NodeTag type
List * outargs
bool is_not_null
Definition parsenodes.h:772
CollateClause * collClause
Definition parsenodes.h:782
char identity
Definition parsenodes.h:778
RangeVar * identitySequence
Definition parsenodes.h:779
List * constraints
Definition parsenodes.h:784
Node * cooked_default
Definition parsenodes.h:777
char * storage_name
Definition parsenodes.h:775
char * colname
Definition parsenodes.h:767
TypeName * typeName
Definition parsenodes.h:768
char generated
Definition parsenodes.h:781
NodeTag type
Definition parsenodes.h:766
bool is_from_type
Definition parsenodes.h:773
List * fdwoptions
Definition parsenodes.h:785
Node * raw_default
Definition parsenodes.h:776
char storage
Definition parsenodes.h:774
bool is_local
Definition parsenodes.h:771
int16 inhcount
Definition parsenodes.h:770
char * compression
Definition parsenodes.h:769
ParseLoc location
Definition parsenodes.h:786
char * comment
ObjectType objtype
NodeTag type
Node * object
CTEMaterialize ctematerialized
ParseLoc location
RangeVar * typevar
bool initdeferred
List * exclusions
ParseLoc location
bool reset_default_tblspc
List * keys
List * pk_attrs
List * fk_del_set_cols
bool fk_with_period
Node * where_clause
char * indexname
char generated_kind
char * indexspace
ConstrType contype
char * access_method
Oid old_pktable_oid
bool is_no_inherit
List * options
char fk_upd_action
List * old_conpfeqop
bool is_enforced
char fk_matchtype
bool nulls_not_distinct
bool pk_with_period
char * cooked_expr
bool initially_valid
bool skip_validation
bool without_overlaps
bool deferrable
NodeTag type
Node * raw_expr
char * conname
char generated_when
RangeVar * pktable
List * including
char fk_del_action
List * fk_attrs
bool is_program
RangeVar * relation
List * options
bool is_from
char * filename
NodeTag type
List * attlist
Node * whereClause
Node * query
List * handler_name
TypeName * sourcetype
TypeName * targettype
CoercionContext context
ObjectWithArgs * func
TypeName * typeName
CollateClause * collClause
List * func_options
TypeName * returnType
ObjectWithArgs * name
TypeName * storedtype
TypeName * datatype
RangeVar * table
RoleStmtType stmt_type
RoleSpec * authrole
RangeVar * sequence
List * tableElts
List * nnconstraints
TypeName * ofTypename
OnCommitAction oncommit
List * options
bool if_not_exists
List * inhRelations
RangeVar * relation
char * tablespacename
PartitionSpec * partspec
NodeTag type
PartitionBoundSpec * partbound
char * accessMethod
List * constraints
IntoClause * into
ObjectType objtype
ObjectWithArgs * tosql
ObjectWithArgs * fromsql
List * transitionRels
RangeVar * constrrel
RangeVar * relation
char * defnamespace
Definition parsenodes.h:856
NodeTag type
Definition parsenodes.h:855
DefElemAction defaction
Definition parsenodes.h:860
char * defname
Definition parsenodes.h:857
ParseLoc location
Definition parsenodes.h:861
Node * arg
Definition parsenodes.h:858
List * definition
List * defnames
List * args
NodeTag type
ObjectType kind
bool if_not_exists
ReturningClause * returningClause
WithClause * withClause
Node * whereClause
RangeVar * relation
List * usingClause
NodeTag type
NodeTag type
DiscardMode target
NodeTag type
List * args
DropBehavior behavior
bool missing_ok
List * objects
ObjectType removeType
bool concurrent
DropBehavior behavior
NodeTag type
DropBehavior behavior
List * options
char * dbname
bool missing_ok
NodeTag type
List * params
NodeTag type
NodeTag type
List * options
FetchDirection direction
char * portalname
FetchDirectionKeywords direction_keyword
NodeTag type
TypeName * argType
FunctionParameterMode mode
DropBehavior behavior
RoleSpec * grantor
List * grantee_roles
List * granted_roles
ObjectType objtype
bool is_grant
List * objects
bool grant_option
List * grantees
List * privileges
GrantTargetType targtype
NodeTag type
DropBehavior behavior
RoleSpec * grantor
GraphElementPatternKind kind
const char * variable
Node * whereClause
List * path_pattern_list
NodeTag type
List * content
ParseLoc location
ImportForeignSchemaType list_type
Node * expr
Definition parsenodes.h:825
SortByDir ordering
Definition parsenodes.h:830
List * opclassopts
Definition parsenodes.h:829
NodeTag type
Definition parsenodes.h:823
char * indexcolname
Definition parsenodes.h:826
ParseLoc location
Definition parsenodes.h:832
SortByNulls nulls_ordering
Definition parsenodes.h:831
List * opclass
Definition parsenodes.h:828
char * name
Definition parsenodes.h:824
List * collation
Definition parsenodes.h:827
bool reset_default_tblspc
NodeTag type
bool deferrable
List * indexParams
bool initdeferred
RangeVar * relation
SubTransactionId oldFirstRelfilelocatorSubid
bool iswithoutoverlaps
bool transformed
List * options
char * tableSpace
SubTransactionId oldCreateSubid
bool isconstraint
List * excludeOpNames
bool nulls_not_distinct
bool concurrent
char * idxname
Node * whereClause
bool if_not_exists
char * accessMethod
char * idxcomment
RelFileNumber oldNumber
List * indexIncludingParams
NodeTag type
ParseLoc location
char * conname
List * indexElems
Node * whereClause
OnConflictClause * onConflictClause
Node * selectStmt
ReturningClause * returningClause
WithClause * withClause
NodeTag type
RangeVar * relation
List * cols
struct WindowDef * over
JsonOutput * output
JsonValueExpr * val
bool absent_on_null
JsonValueExpr * arg
JsonAggConstructor * constructor
JsonOutput * output
JsonOutput * output
char * column_name
JsonWrapper wrapper
JsonQuotes quotes
JsonExprOp op
JsonBehavior * on_empty
ParseLoc location
Node * pathspec
JsonBehavior * on_error
JsonValueExpr * context_item
JsonValueExpr * value
JsonAggConstructor * constructor
JsonKeyValue * arg
JsonReturning * returning
TypeName * typeName
NodeTag type
JsonValueExpr * expr
ParseLoc location
JsonOutput * output
ParseLoc location
JsonOutput * output
JsonOutput * output
JsonValueExpr * expr
ParseLoc location
JsonTableColumnType coltype
JsonBehavior * on_empty
JsonWrapper wrapper
JsonBehavior * on_error
JsonQuotes quotes
JsonFormat * format
TypeName * typeName
JsonTablePathSpec * pathspec
ParseLoc name_location
JsonBehavior * on_error
List * columns
JsonTablePathSpec * pathspec
Alias * alias
NodeTag type
List * passing
JsonValueExpr * context_item
ParseLoc location
Definition pg_list.h:54
NodeTag type
char * conditionname
NodeTag type
char * filename
NodeTag type
bool nowait
List * relations
List * lockedRels
Definition parsenodes.h:876
LockClauseStrength strength
Definition parsenodes.h:877
LockWaitPolicy waitPolicy
Definition parsenodes.h:878
ReturningClause * returningClause
Node * sourceRelation
List * mergeWhenClauses
RangeVar * relation
Node * joinCondition
WithClause * withClause
NodeTag type
CmdType commandType
MergeMatchKind matchKind
Definition nodes.h:135
char * payload
char * conditionname
NodeTag type
InferClause * infer
OnConflictAction action
LockClauseStrength lockStrength
SelectStmt * val
ParseLoc location
List * indirection
PartitionBoundSpec * bound
List * partlist
RangeVar * name
List * collation
Definition parsenodes.h:907
ParseLoc location
Definition parsenodes.h:909
PartitionRangeDatumKind kind
Definition parsenodes.h:975
List * partParams
Definition parsenodes.h:928
ParseLoc location
Definition parsenodes.h:929
PartitionStrategy strategy
Definition parsenodes.h:927
List * argtypes
NodeTag type
List * edestvertexcols
char * esrcvertex
RangeVar * etable
char * edestvertex
ParseLoc location
List * esrcvertexcols
struct PropGraphProperties * properties
ParseLoc location
RangeVar * vtable
PublicationAllObjType pubobjtype
PublicationObjSpecType pubobjtype
PublicationTable * pubtable
RangeVar * relation
Bitmapset * selectedCols
Bitmapset * insertedCols
Bitmapset * updatedCols
Alias * alias
Definition parsenodes.h:672
List * coldeflist
Definition parsenodes.h:673
List * functions
Definition parsenodes.h:671
struct GraphPattern * graph_pattern
Definition parsenodes.h:720
ParseLoc location
Definition parsenodes.h:723
RangeVar * graph_name
Definition parsenodes.h:719
TypeName * typeName
Definition parsenodes.h:705
List * namespaces
Definition parsenodes.h:689
ParseLoc location
Definition parsenodes.h:692
ParseLoc location
Definition parsenodes.h:743
TableFunc * tablefunc
struct TableSampleClause * tablesample
Query * subquery
List * groupexprs
List * values_lists
JoinType jointype
List * graph_table_columns
GraphPattern * graph_pattern
RTEKind rtekind
ParseLoc stmt_location
ParseLoc stmt_len
Node * stmt
RoleSpec * newrole
RangeVar * relation
const char * name
ReindexObjectType kind
RangeVar * relation
List * params
NodeTag type
RangeVar * relation
bool missing_ok
ObjectType relationType
DropBehavior behavior
ObjectType renameType
NodeTag type
char * newname
char * subname
Node * object
bool usingindex
NodeTag type
VacuumRelation * relation
List * params
char * indexname
RepackCommand command
NodeTag type
Node * returnval
ReturningOptionKind option
ParseLoc location
LockClauseStrength strength
LockWaitPolicy waitPolicy
char * rulename
Node * whereClause
bool instead
RangeVar * relation
bool replace
CmdType event
List * actions
NodeTag type
ObjectType objtype
char * provider
LimitOption limitOption
List * sortClause
List * targetList
IntoClause * intoClause
Node * limitOffset
bool groupDistinct
List * fromClause
bool groupByAll
NodeTag type
List * groupClause
Node * havingClause
List * lockingClause
Node * limitCount
List * windowClause
List * distinctClause
List * valuesLists
struct SelectStmt * larg
struct SelectStmt * rarg
Node * whereClause
SetOperation op
WithClause * withClause
SetOperation op
PartitionBoundSpec * bound
Definition parsenodes.h:991
NodeTag type
char * name
Node * expr
Definition value.h:64
RangeVar * relation
Definition parsenodes.h:795
TransactionStmtKind kind
List * relations
DropBehavior behavior
char * conditionname
List * targetList
List * fromClause
NodeTag type
Node * whereClause
ReturningClause * returningClause
RangeVar * relation
WithClause * withClause
RangeVar * relation
NodeTag type
List * options
bool is_vacuumcmd
List * rels
VariableSetKind kind
bool replace
List * options
Node * query
List * aliases
RangeVar * view
NodeTag type
ViewCheckOption withCheckOption
NodeTag type
List * options
char * lsn_literal
Node * startOffset
List * partitionClause
Node * endOffset
List * orderClause
List * ctes
NodeTag type
ParseLoc location
ParseLoc location
Definition parsenodes.h:891
TypeName * typeName
Definition parsenodes.h:889
NodeTag type
Definition parsenodes.h:886
XmlOptionType xmloption
Definition parsenodes.h:887
const char * type
const char * name

◆ FRAMEOPTION_END_CURRENT_ROW

#define FRAMEOPTION_END_CURRENT_ROW   0x00400 /* end is C. R. */

Definition at line 619 of file parsenodes.h.

◆ FRAMEOPTION_END_OFFSET

Definition at line 630 of file parsenodes.h.

◆ FRAMEOPTION_END_OFFSET_FOLLOWING

#define FRAMEOPTION_END_OFFSET_FOLLOWING   0x04000 /* end is O. F. */

Definition at line 623 of file parsenodes.h.

◆ FRAMEOPTION_END_OFFSET_PRECEDING

#define FRAMEOPTION_END_OFFSET_PRECEDING   0x01000 /* end is O. P. */

Definition at line 621 of file parsenodes.h.

◆ FRAMEOPTION_END_UNBOUNDED_FOLLOWING

#define FRAMEOPTION_END_UNBOUNDED_FOLLOWING   0x00100 /* end is U. F. */

Definition at line 617 of file parsenodes.h.

◆ FRAMEOPTION_END_UNBOUNDED_PRECEDING

#define FRAMEOPTION_END_UNBOUNDED_PRECEDING   0x00040 /* (disallowed) */

Definition at line 615 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUDE_CURRENT_ROW

#define FRAMEOPTION_EXCLUDE_CURRENT_ROW   0x08000 /* omit C.R. */

Definition at line 624 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUDE_GROUP

#define FRAMEOPTION_EXCLUDE_GROUP   0x10000 /* omit C.R. & peers */

Definition at line 625 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUDE_TIES

#define FRAMEOPTION_EXCLUDE_TIES   0x20000 /* omit C.R.'s peers */

Definition at line 626 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUSION

#define FRAMEOPTION_EXCLUSION
Value:
#define FRAMEOPTION_EXCLUDE_CURRENT_ROW
Definition parsenodes.h:624
#define FRAMEOPTION_EXCLUDE_TIES
Definition parsenodes.h:626
#define FRAMEOPTION_EXCLUDE_GROUP
Definition parsenodes.h:625

Definition at line 632 of file parsenodes.h.

◆ FRAMEOPTION_GROUPS

#define FRAMEOPTION_GROUPS   0x00008 /* GROUPS behavior */

Definition at line 612 of file parsenodes.h.

◆ FRAMEOPTION_NONDEFAULT

#define FRAMEOPTION_NONDEFAULT   0x00001 /* any specified? */

Definition at line 609 of file parsenodes.h.

◆ FRAMEOPTION_RANGE

#define FRAMEOPTION_RANGE   0x00002 /* RANGE behavior */

Definition at line 610 of file parsenodes.h.

◆ FRAMEOPTION_ROWS

#define FRAMEOPTION_ROWS   0x00004 /* ROWS behavior */

Definition at line 611 of file parsenodes.h.

◆ FRAMEOPTION_START_CURRENT_ROW

#define FRAMEOPTION_START_CURRENT_ROW   0x00200 /* start is C. R. */

Definition at line 618 of file parsenodes.h.

◆ FRAMEOPTION_START_OFFSET

Definition at line 628 of file parsenodes.h.

◆ FRAMEOPTION_START_OFFSET_FOLLOWING

#define FRAMEOPTION_START_OFFSET_FOLLOWING   0x02000 /* start is O. F. */

Definition at line 622 of file parsenodes.h.

◆ FRAMEOPTION_START_OFFSET_PRECEDING

#define FRAMEOPTION_START_OFFSET_PRECEDING   0x00800 /* start is O. P. */

Definition at line 620 of file parsenodes.h.

◆ FRAMEOPTION_START_UNBOUNDED_FOLLOWING

#define FRAMEOPTION_START_UNBOUNDED_FOLLOWING   0x00080 /* (disallowed) */

Definition at line 616 of file parsenodes.h.

◆ FRAMEOPTION_START_UNBOUNDED_PRECEDING

#define FRAMEOPTION_START_UNBOUNDED_PRECEDING   0x00020 /* start is U. P. */

Definition at line 614 of file parsenodes.h.

◆ GetCTETargetList

#define GetCTETargetList (   cte)
Value:
(AssertMacro(IsA((cte)->ctequery, Query)), \
((Query *) (cte)->ctequery)->commandType == CMD_SELECT ? \
((Query *) (cte)->ctequery)->targetList : \
((Query *) (cte)->ctequery)->returningList)
#define AssertMacro(condition)
Definition c.h:946
#define IsA(nodeptr, _type_)
Definition nodes.h:164
@ CMD_SELECT
Definition nodes.h:275

Definition at line 1821 of file parsenodes.h.

1824 : \
1825 ((Query *) (cte)->ctequery)->returningList)

◆ IS_EDGE_PATTERN

#define IS_EDGE_PATTERN (   kind)
Value:
((kind) == EDGE_PATTERN_ANY || \
(kind) == EDGE_PATTERN_RIGHT || \
(kind) == EDGE_PATTERN_LEFT)

Definition at line 1039 of file parsenodes.h.

◆ N_ACL_RIGHTS

#define N_ACL_RIGHTS   15 /* 1 plus the last 1<<x */

Definition at line 91 of file parsenodes.h.

◆ OPCLASS_ITEM_FUNCTION

#define OPCLASS_ITEM_FUNCTION   2

Definition at line 3374 of file parsenodes.h.

◆ OPCLASS_ITEM_OPERATOR

#define OPCLASS_ITEM_OPERATOR   1

Definition at line 3373 of file parsenodes.h.

◆ OPCLASS_ITEM_STORAGETYPE

#define OPCLASS_ITEM_STORAGETYPE   3

Definition at line 3375 of file parsenodes.h.

Typedef Documentation

◆ A_ArrayExpr

◆ A_Const

◆ A_Expr

◆ A_Expr_Kind

◆ A_Indices

◆ A_Indirection

◆ A_Star

◆ AccessPriv

◆ AclMode

Definition at line 74 of file parsenodes.h.

◆ AlterCollationStmt

◆ AlterDatabaseRefreshCollStmt

◆ AlterDatabaseSetStmt

◆ AlterDatabaseStmt

◆ AlterDefaultPrivilegesStmt

◆ AlterDomainStmt

◆ AlterDomainType

◆ AlterEnumStmt

◆ AlterEventTrigStmt

◆ AlterExtensionContentsStmt

◆ AlterExtensionStmt

◆ AlterFdwStmt

◆ AlterForeignServerStmt

◆ AlterFunctionStmt

◆ AlterObjectDependsStmt

◆ AlterObjectSchemaStmt

◆ AlterOperatorStmt

◆ AlterOpFamilyStmt

◆ AlterOwnerStmt

◆ AlterPolicyStmt

◆ AlterPropGraphElementKind

◆ AlterPropGraphStmt

◆ AlterPublicationAction

◆ AlterPublicationStmt

◆ AlterRoleSetStmt

◆ AlterRoleStmt

◆ AlterSeqStmt

◆ AlterStatsStmt

◆ AlterSubscriptionStmt

◆ AlterSubscriptionType

◆ AlterSystemStmt

◆ AlterTableCmd

◆ AlterTableMoveAllStmt

◆ AlterTableSpaceOptionsStmt

◆ AlterTableStmt

◆ AlterTableType

◆ AlterTSConfigType

◆ AlterTSConfigurationStmt

◆ AlterTSDictionaryStmt

◆ AlterTypeStmt

◆ AlterUserMappingStmt

◆ ATAlterConstraint

◆ CallContext

◆ CallStmt

◆ CheckPointStmt

◆ ClosePortalStmt

◆ CollateClause

◆ ColumnDef

◆ ColumnRef

◆ CommentStmt

◆ CommonTableExpr

◆ CompositeTypeStmt

◆ Constraint

◆ ConstraintsSetStmt

◆ ConstrType

◆ CopyStmt

◆ CreateAmStmt

◆ CreateCastStmt

◆ CreateConversionStmt

◆ CreatedbStmt

◆ CreateDomainStmt

◆ CreateEnumStmt

◆ CreateEventTrigStmt

◆ CreateExtensionStmt

◆ CreateFdwStmt

◆ CreateForeignServerStmt

◆ CreateForeignTableStmt

◆ CreateFunctionStmt

◆ CreateOpClassItem

◆ CreateOpClassStmt

◆ CreateOpFamilyStmt

◆ CreatePLangStmt

◆ CreatePolicyStmt

◆ CreatePropGraphStmt

◆ CreatePublicationStmt

◆ CreateRangeStmt

◆ CreateRoleStmt

◆ CreateSchemaStmt

◆ CreateSeqStmt

◆ CreateStatsStmt

◆ CreateStmt

◆ CreateSubscriptionStmt

◆ CreateTableAsStmt

◆ CreateTableSpaceStmt

◆ CreateTransformStmt

◆ CreateTrigStmt

◆ CreateUserMappingStmt

◆ CTECycleClause

◆ CTEMaterialize

◆ CTESearchClause

◆ DeallocateStmt

◆ DeclareCursorStmt

◆ DefElem

◆ DefElemAction

◆ DefineStmt

◆ DeleteStmt

◆ DiscardMode

◆ DiscardStmt

◆ DoStmt

◆ DropBehavior

◆ DropdbStmt

◆ DropOwnedStmt

◆ DropRoleStmt

◆ DropStmt

◆ DropSubscriptionStmt

◆ DropTableSpaceStmt

◆ DropUserMappingStmt

◆ ExecuteStmt

◆ ExplainStmt

◆ FetchDirection

◆ FetchDirectionKeywords

◆ FetchStmt

◆ FuncCall

◆ FunctionParameter

◆ FunctionParameterMode

◆ GrantRoleStmt

◆ GrantStmt

◆ GrantTargetType

◆ GraphElementPattern

◆ GraphElementPatternKind

◆ GraphPattern

◆ GroupingSet

◆ GroupingSetKind

◆ ImportForeignSchemaStmt

◆ ImportForeignSchemaType

◆ IndexElem

◆ IndexStmt

◆ InferClause

◆ InlineCodeBlock

◆ InsertStmt

◆ JsonAggConstructor

◆ JsonArgument

◆ JsonArrayAgg

◆ JsonArrayConstructor

◆ JsonArrayQueryConstructor

◆ JsonFuncExpr

◆ JsonKeyValue

◆ JsonObjectAgg

◆ JsonObjectConstructor

◆ JsonOutput

◆ JsonParseExpr

◆ JsonQuotes

◆ JsonScalarExpr

◆ JsonSerializeExpr

◆ JsonTable

◆ JsonTableColumn

◆ JsonTableColumnType

◆ JsonTablePathSpec

◆ ListenStmt

◆ LoadStmt

◆ LockingClause

◆ LockStmt

◆ MergeStmt

◆ MergeWhenClause

◆ MultiAssignRef

◆ NotifyStmt

◆ ObjectType

◆ ObjectWithArgs

◆ OnConflictClause

◆ ParamRef

◆ PartitionCmd

◆ PartitionElem

◆ PartitionRangeDatum

◆ PartitionRangeDatumKind

◆ PartitionSpec

◆ PartitionStrategy

◆ PLAssignStmt

◆ PrepareStmt

◆ PropGraphEdge

◆ PropGraphLabelAndProperties

◆ PropGraphProperties

◆ PropGraphVertex

◆ PublicationAllObjSpec

◆ PublicationAllObjType

◆ PublicationObjSpec

◆ PublicationObjSpecType

◆ PublicationTable

◆ Query

◆ QuerySource

◆ RangeFunction

◆ RangeGraphTable

◆ RangeSubselect

◆ RangeTableFunc

◆ RangeTableFuncCol

◆ RangeTableSample

◆ RangeTblEntry

◆ RangeTblFunction

◆ RawStmt

◆ ReassignOwnedStmt

◆ RefreshMatViewStmt

◆ ReindexObjectType

◆ ReindexStmt

◆ RenameStmt

◆ RepackCommand

◆ RepackStmt

◆ ReplicaIdentityStmt

◆ ResTarget

◆ ReturningClause

◆ ReturningOption

◆ ReturningOptionKind

◆ ReturnStmt

◆ RoleSpec

◆ RoleSpecType

◆ RoleStmtType

◆ RowMarkClause

◆ RTEKind

◆ RTEPermissionInfo

◆ RuleStmt

◆ SecLabelStmt

◆ SelectStmt

◆ SetOperation

◆ SetOperationStmt

◆ SetQuantifier

◆ SinglePartitionSpec

◆ SortBy

◆ SortByDir

◆ SortByNulls

◆ SortGroupClause

◆ StatsElem

◆ TableLikeClause

◆ TableLikeOption

◆ TableSampleClause

◆ TransactionStmt

◆ TransactionStmtKind

◆ TriggerTransition

◆ TruncateStmt

◆ TypeCast

◆ TypeName

◆ UnlistenStmt

◆ UpdateStmt

◆ VacuumRelation

◆ VacuumStmt

◆ VariableSetKind

◆ VariableSetStmt

◆ VariableShowStmt

◆ ViewCheckOption

◆ ViewStmt

◆ WaitStmt

◆ WCOKind

◆ WindowClause

◆ WindowDef

◆ WithCheckOption

◆ WithClause

◆ XmlSerialize

Enumeration Type Documentation

◆ A_Expr_Kind

Enumerator
AEXPR_OP 
AEXPR_OP_ANY 
AEXPR_OP_ALL 
AEXPR_DISTINCT 
AEXPR_NOT_DISTINCT 
AEXPR_NULLIF 
AEXPR_IN 
AEXPR_LIKE 
AEXPR_ILIKE 
AEXPR_SIMILAR 
AEXPR_BETWEEN 
AEXPR_NOT_BETWEEN 
AEXPR_BETWEEN_SYM 
AEXPR_NOT_BETWEEN_SYM 

Definition at line 328 of file parsenodes.h.

329{
330 AEXPR_OP, /* normal operator */
331 AEXPR_OP_ANY, /* scalar op ANY (array) */
332 AEXPR_OP_ALL, /* scalar op ALL (array) */
333 AEXPR_DISTINCT, /* IS DISTINCT FROM - name must be "=" */
334 AEXPR_NOT_DISTINCT, /* IS NOT DISTINCT FROM - name must be "=" */
335 AEXPR_NULLIF, /* NULLIF - name must be "=" */
336 AEXPR_IN, /* [NOT] IN - name must be "=" or "<>" */
337 AEXPR_LIKE, /* [NOT] LIKE - name must be "~~" or "!~~" */
338 AEXPR_ILIKE, /* [NOT] ILIKE - name must be "~~*" or "!~~*" */
339 AEXPR_SIMILAR, /* [NOT] SIMILAR - name must be "~" or "!~" */
340 AEXPR_BETWEEN, /* name must be "BETWEEN" */
341 AEXPR_NOT_BETWEEN, /* name must be "NOT BETWEEN" */
342 AEXPR_BETWEEN_SYM, /* name must be "BETWEEN SYMMETRIC" */
343 AEXPR_NOT_BETWEEN_SYM, /* name must be "NOT BETWEEN SYMMETRIC" */
A_Expr_Kind
Definition parsenodes.h:329
@ AEXPR_BETWEEN
Definition parsenodes.h:340
@ AEXPR_NULLIF
Definition parsenodes.h:335
@ AEXPR_NOT_DISTINCT
Definition parsenodes.h:334
@ AEXPR_BETWEEN_SYM
Definition parsenodes.h:342
@ AEXPR_NOT_BETWEEN_SYM
Definition parsenodes.h:343
@ AEXPR_ILIKE
Definition parsenodes.h:338
@ AEXPR_IN
Definition parsenodes.h:336
@ AEXPR_NOT_BETWEEN
Definition parsenodes.h:341
@ AEXPR_DISTINCT
Definition parsenodes.h:333
@ AEXPR_SIMILAR
Definition parsenodes.h:339
@ AEXPR_LIKE
Definition parsenodes.h:337
@ AEXPR_OP
Definition parsenodes.h:330
@ AEXPR_OP_ANY
Definition parsenodes.h:331
@ AEXPR_OP_ALL
Definition parsenodes.h:332

◆ AlterDomainType

Enumerator
AD_AlterDefault 
AD_DropNotNull 
AD_SetNotNull 
AD_AddConstraint 
AD_DropConstraint 
AD_ValidateConstraint 

Definition at line 2630 of file parsenodes.h.

2631{
2632 AD_AlterDefault = 'T', /* SET|DROP DEFAULT */
2633 AD_DropNotNull = 'N', /* DROP NOT NULL */
2634 AD_SetNotNull = 'O', /* SET NOT NULL */
2635 AD_AddConstraint = 'C', /* ADD CONSTRAINT */
2636 AD_DropConstraint = 'X', /* DROP CONSTRAINT */
2637 AD_ValidateConstraint = 'V', /* VALIDATE CONSTRAINT */

◆ AlterPropGraphElementKind

Enumerator
PROPGRAPH_ELEMENT_KIND_VERTEX 
PROPGRAPH_ELEMENT_KIND_EDGE 

Definition at line 4303 of file parsenodes.h.

◆ AlterPublicationAction

Enumerator
AP_AddObjects 
AP_DropObjects 
AP_SetObjects 

Definition at line 4506 of file parsenodes.h.

4507{
4508 AP_AddObjects, /* add objects to publication */
4509 AP_DropObjects, /* remove objects from publication */
4510 AP_SetObjects, /* set list of objects */

◆ AlterSubscriptionType

Enumerator
ALTER_SUBSCRIPTION_OPTIONS 
ALTER_SUBSCRIPTION_SERVER 
ALTER_SUBSCRIPTION_CONNECTION 
ALTER_SUBSCRIPTION_SET_PUBLICATION 
ALTER_SUBSCRIPTION_ADD_PUBLICATION 
ALTER_SUBSCRIPTION_DROP_PUBLICATION 
ALTER_SUBSCRIPTION_REFRESH_PUBLICATION 
ALTER_SUBSCRIPTION_REFRESH_SEQUENCES 
ALTER_SUBSCRIPTION_ENABLED 
ALTER_SUBSCRIPTION_SKIP 

Definition at line 4542 of file parsenodes.h.

◆ AlterTableType

Enumerator
AT_AddColumn 
AT_AddColumnToView 
AT_ColumnDefault 
AT_CookedColumnDefault 
AT_DropNotNull 
AT_SetNotNull 
AT_SetExpression 
AT_DropExpression 
AT_SetStatistics 
AT_SetOptions 
AT_ResetOptions 
AT_SetStorage 
AT_SetCompression 
AT_DropColumn 
AT_AddIndex 
AT_ReAddIndex 
AT_AddConstraint 
AT_ReAddConstraint 
AT_ReAddDomainConstraint 
AT_AlterConstraint 
AT_ValidateConstraint 
AT_AddIndexConstraint 
AT_DropConstraint 
AT_ReAddComment 
AT_AlterColumnType 
AT_AlterColumnGenericOptions 
AT_ChangeOwner 
AT_ClusterOn 
AT_DropCluster 
AT_SetLogged 
AT_SetUnLogged 
AT_DropOids 
AT_SetAccessMethod 
AT_SetTableSpace 
AT_SetRelOptions 
AT_ResetRelOptions 
AT_ReplaceRelOptions 
AT_EnableTrig 
AT_EnableAlwaysTrig 
AT_EnableReplicaTrig 
AT_DisableTrig 
AT_EnableTrigAll 
AT_DisableTrigAll 
AT_EnableTrigUser 
AT_DisableTrigUser 
AT_EnableRule 
AT_EnableAlwaysRule 
AT_EnableReplicaRule 
AT_DisableRule 
AT_AddInherit 
AT_DropInherit 
AT_AddOf 
AT_DropOf 
AT_ReplicaIdentity 
AT_EnableRowSecurity 
AT_DisableRowSecurity 
AT_ForceRowSecurity 
AT_NoForceRowSecurity 
AT_GenericOptions 
AT_AttachPartition 
AT_DetachPartition 
AT_DetachPartitionFinalize 
AT_SplitPartition 
AT_MergePartitions 
AT_AddIdentity 
AT_SetIdentity 
AT_DropIdentity 
AT_ReAddStatistics 

Definition at line 2501 of file parsenodes.h.

2502{
2503 AT_AddColumn, /* add column */
2504 AT_AddColumnToView, /* implicitly via CREATE OR REPLACE VIEW */
2505 AT_ColumnDefault, /* alter column default */
2506 AT_CookedColumnDefault, /* add a pre-cooked column default */
2507 AT_DropNotNull, /* alter column drop not null */
2508 AT_SetNotNull, /* alter column set not null */
2509 AT_SetExpression, /* alter column set expression */
2510 AT_DropExpression, /* alter column drop expression */
2511 AT_SetStatistics, /* alter column set statistics */
2512 AT_SetOptions, /* alter column set ( options ) */
2513 AT_ResetOptions, /* alter column reset ( options ) */
2514 AT_SetStorage, /* alter column set storage */
2515 AT_SetCompression, /* alter column set compression */
2516 AT_DropColumn, /* drop column */
2517 AT_AddIndex, /* add index */
2518 AT_ReAddIndex, /* internal to commands/tablecmds.c */
2519 AT_AddConstraint, /* add constraint */
2520 AT_ReAddConstraint, /* internal to commands/tablecmds.c */
2521 AT_ReAddDomainConstraint, /* internal to commands/tablecmds.c */
2522 AT_AlterConstraint, /* alter constraint */
2523 AT_ValidateConstraint, /* validate constraint */
2524 AT_AddIndexConstraint, /* add constraint using existing index */
2525 AT_DropConstraint, /* drop constraint */
2526 AT_ReAddComment, /* internal to commands/tablecmds.c */
2527 AT_AlterColumnType, /* alter column type */
2528 AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */
2529 AT_ChangeOwner, /* change owner */
2530 AT_ClusterOn, /* CLUSTER ON */
2531 AT_DropCluster, /* SET WITHOUT CLUSTER */
2532 AT_SetLogged, /* SET LOGGED */
2533 AT_SetUnLogged, /* SET UNLOGGED */
2534 AT_DropOids, /* SET WITHOUT OIDS */
2535 AT_SetAccessMethod, /* SET ACCESS METHOD */
2536 AT_SetTableSpace, /* SET TABLESPACE */
2537 AT_SetRelOptions, /* SET (...) -- AM specific parameters */
2538 AT_ResetRelOptions, /* RESET (...) -- AM specific parameters */
2539 AT_ReplaceRelOptions, /* replace reloption list in its entirety */
2540 AT_EnableTrig, /* ENABLE TRIGGER name */
2541 AT_EnableAlwaysTrig, /* ENABLE ALWAYS TRIGGER name */
2542 AT_EnableReplicaTrig, /* ENABLE REPLICA TRIGGER name */
2543 AT_DisableTrig, /* DISABLE TRIGGER name */
2544 AT_EnableTrigAll, /* ENABLE TRIGGER ALL */
2545 AT_DisableTrigAll, /* DISABLE TRIGGER ALL */
2546 AT_EnableTrigUser, /* ENABLE TRIGGER USER */
2547 AT_DisableTrigUser, /* DISABLE TRIGGER USER */
2548 AT_EnableRule, /* ENABLE RULE name */
2549 AT_EnableAlwaysRule, /* ENABLE ALWAYS RULE name */
2550 AT_EnableReplicaRule, /* ENABLE REPLICA RULE name */
2551 AT_DisableRule, /* DISABLE RULE name */
2552 AT_AddInherit, /* INHERIT parent */
2553 AT_DropInherit, /* NO INHERIT parent */
2554 AT_AddOf, /* OF <type_name> */
2555 AT_DropOf, /* NOT OF */
2556 AT_ReplicaIdentity, /* REPLICA IDENTITY */
2557 AT_EnableRowSecurity, /* ENABLE ROW SECURITY */
2558 AT_DisableRowSecurity, /* DISABLE ROW SECURITY */
2559 AT_ForceRowSecurity, /* FORCE ROW SECURITY */
2560 AT_NoForceRowSecurity, /* NO FORCE ROW SECURITY */
2561 AT_GenericOptions, /* OPTIONS (...) */
2562 AT_AttachPartition, /* ATTACH PARTITION */
2563 AT_DetachPartition, /* DETACH PARTITION */
2564 AT_DetachPartitionFinalize, /* DETACH PARTITION FINALIZE */
2565 AT_SplitPartition, /* SPLIT PARTITION */
2566 AT_MergePartitions, /* MERGE PARTITIONS */
2567 AT_AddIdentity, /* ADD IDENTITY */
2568 AT_SetIdentity, /* SET identity column options */
2569 AT_DropIdentity, /* DROP IDENTITY */
2570 AT_ReAddStatistics, /* internal to commands/tablecmds.c */

◆ AlterTSConfigType

Enumerator
ALTER_TSCONFIG_ADD_MAPPING 
ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN 
ALTER_TSCONFIG_REPLACE_DICT 
ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN 
ALTER_TSCONFIG_DROP_MAPPING 

Definition at line 4421 of file parsenodes.h.

◆ ConstrType

Enumerator
CONSTR_NULL 
CONSTR_NOTNULL 
CONSTR_DEFAULT 
CONSTR_IDENTITY 
CONSTR_GENERATED 
CONSTR_CHECK 
CONSTR_PRIMARY 
CONSTR_UNIQUE 
CONSTR_EXCLUSION 
CONSTR_FOREIGN 
CONSTR_ATTR_DEFERRABLE 
CONSTR_ATTR_NOT_DEFERRABLE 
CONSTR_ATTR_DEFERRED 
CONSTR_ATTR_IMMEDIATE 
CONSTR_ATTR_ENFORCED 
CONSTR_ATTR_NOT_ENFORCED 

Definition at line 2885 of file parsenodes.h.

2886{
2887 CONSTR_NULL, /* not standard SQL, but a lot of people
2888 * expect it */
2898 CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */
2904} ConstrType;

◆ CTEMaterialize

Enumerator
CTEMaterializeDefault 
CTEMaterializeAlways 
CTEMaterializeNever 

Definition at line 1752 of file parsenodes.h.

1753{
1754 CTEMaterializeDefault, /* no option specified */
1755 CTEMaterializeAlways, /* MATERIALIZED */
1756 CTEMaterializeNever, /* NOT MATERIALIZED */

◆ DefElemAction

Enumerator
DEFELEM_UNSPEC 
DEFELEM_SET 
DEFELEM_ADD 
DEFELEM_DROP 

Definition at line 845 of file parsenodes.h.

846{
847 DEFELEM_UNSPEC, /* no action given */

◆ DiscardMode

Enumerator
DISCARD_ALL 
DISCARD_PLANS 
DISCARD_SEQUENCES 
DISCARD_TEMP 

Definition at line 4158 of file parsenodes.h.

4159{
4164} DiscardMode;

◆ DropBehavior

Enumerator
DROP_RESTRICT 
DROP_CASCADE 

Definition at line 2482 of file parsenodes.h.

2483{
2484 DROP_RESTRICT, /* drop fails if any dependent objects */
2485 DROP_CASCADE, /* remove dependent objects too */
2486} DropBehavior;

◆ FetchDirection

Enumerator
FETCH_FORWARD 
FETCH_BACKWARD 
FETCH_ABSOLUTE 
FETCH_RELATIVE 

Definition at line 3509 of file parsenodes.h.

3510{
3511 /* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
3514 /* for these, howMany indicates a position; only one row is fetched */

◆ FetchDirectionKeywords

Enumerator
FETCH_KEYWORD_NONE 
FETCH_KEYWORD_NEXT 
FETCH_KEYWORD_PRIOR 
FETCH_KEYWORD_FIRST 
FETCH_KEYWORD_LAST 
FETCH_KEYWORD_ABSOLUTE 
FETCH_KEYWORD_RELATIVE 
FETCH_KEYWORD_ALL 
FETCH_KEYWORD_FORWARD 
FETCH_KEYWORD_FORWARD_ALL 
FETCH_KEYWORD_BACKWARD 
FETCH_KEYWORD_BACKWARD_ALL 

Definition at line 3519 of file parsenodes.h.

◆ FunctionParameterMode

Enumerator
FUNC_PARAM_IN 
FUNC_PARAM_OUT 
FUNC_PARAM_INOUT 
FUNC_PARAM_VARIADIC 
FUNC_PARAM_TABLE 
FUNC_PARAM_DEFAULT 

Definition at line 3662 of file parsenodes.h.

3663{
3664 /* the assigned enum values appear in pg_proc, don't change 'em! */
3665 FUNC_PARAM_IN = 'i', /* input only */
3666 FUNC_PARAM_OUT = 'o', /* output only */
3667 FUNC_PARAM_INOUT = 'b', /* both */
3668 FUNC_PARAM_VARIADIC = 'v', /* variadic (always input) */
3669 FUNC_PARAM_TABLE = 't', /* table function output column */
3670 /* this is not used in pg_proc: */
3671 FUNC_PARAM_DEFAULT = 'd', /* default; effectively same as IN */

◆ GrantTargetType

Enumerator
ACL_TARGET_OBJECT 
ACL_TARGET_ALL_IN_SCHEMA 
ACL_TARGET_DEFAULTS 

Definition at line 2656 of file parsenodes.h.

2657{
2658 ACL_TARGET_OBJECT, /* grant on specific named object(s) */
2659 ACL_TARGET_ALL_IN_SCHEMA, /* grant on all objects in given schema(s) */
2660 ACL_TARGET_DEFAULTS, /* ALTER DEFAULT PRIVILEGES */

◆ GraphElementPatternKind

Enumerator
VERTEX_PATTERN 
EDGE_PATTERN_LEFT 
EDGE_PATTERN_RIGHT 
EDGE_PATTERN_ANY 
PAREN_EXPR 

Definition at line 1030 of file parsenodes.h.

◆ GroupingSetKind

Enumerator
GROUPING_SET_EMPTY 
GROUPING_SET_SIMPLE 
GROUPING_SET_ROLLUP 
GROUPING_SET_CUBE 
GROUPING_SET_SETS 

Definition at line 1612 of file parsenodes.h.

◆ ImportForeignSchemaType

Enumerator
FDW_IMPORT_SCHEMA_ALL 
FDW_IMPORT_SCHEMA_LIMIT_TO 
FDW_IMPORT_SCHEMA_EXCEPT 

Definition at line 3130 of file parsenodes.h.

3131{
3132 FDW_IMPORT_SCHEMA_ALL, /* all relations wanted */
3133 FDW_IMPORT_SCHEMA_LIMIT_TO, /* include only listed tables in import */
3134 FDW_IMPORT_SCHEMA_EXCEPT, /* exclude listed tables from import */

◆ JsonQuotes

Enumerator
JS_QUOTES_UNSPEC 
JS_QUOTES_KEEP 
JS_QUOTES_OMIT 

Definition at line 1924 of file parsenodes.h.

1925{
1926 JS_QUOTES_UNSPEC, /* unspecified */
1927 JS_QUOTES_KEEP, /* KEEP QUOTES */
1928 JS_QUOTES_OMIT, /* OMIT QUOTES */
1929} JsonQuotes;

◆ JsonTableColumnType

Enumerator
JTC_FOR_ORDINALITY 
JTC_REGULAR 
JTC_EXISTS 
JTC_FORMATTED 
JTC_NESTED 

Definition at line 1989 of file parsenodes.h.

◆ ObjectType

Enumerator
OBJECT_ACCESS_METHOD 
OBJECT_AGGREGATE 
OBJECT_AMOP 
OBJECT_AMPROC 
OBJECT_ATTRIBUTE 
OBJECT_CAST 
OBJECT_COLUMN 
OBJECT_COLLATION 
OBJECT_CONVERSION 
OBJECT_DATABASE 
OBJECT_DEFAULT 
OBJECT_DEFACL 
OBJECT_DOMAIN 
OBJECT_DOMCONSTRAINT 
OBJECT_EVENT_TRIGGER 
OBJECT_EXTENSION 
OBJECT_FDW 
OBJECT_FOREIGN_SERVER 
OBJECT_FOREIGN_TABLE 
OBJECT_FUNCTION 
OBJECT_INDEX 
OBJECT_LANGUAGE 
OBJECT_LARGEOBJECT 
OBJECT_MATVIEW 
OBJECT_OPCLASS 
OBJECT_OPERATOR 
OBJECT_OPFAMILY 
OBJECT_PARAMETER_ACL 
OBJECT_POLICY 
OBJECT_PROCEDURE 
OBJECT_PROPGRAPH 
OBJECT_PUBLICATION 
OBJECT_PUBLICATION_NAMESPACE 
OBJECT_PUBLICATION_REL 
OBJECT_ROLE 
OBJECT_ROUTINE 
OBJECT_RULE 
OBJECT_SCHEMA 
OBJECT_SEQUENCE 
OBJECT_SUBSCRIPTION 
OBJECT_STATISTIC_EXT 
OBJECT_TABCONSTRAINT 
OBJECT_TABLE 
OBJECT_TABLESPACE 
OBJECT_TRANSFORM 
OBJECT_TRIGGER 
OBJECT_TSCONFIGURATION 
OBJECT_TSDICTIONARY 
OBJECT_TSPARSER 
OBJECT_TSTEMPLATE 
OBJECT_TYPE 
OBJECT_USER_MAPPING 
OBJECT_VIEW 

Definition at line 2408 of file parsenodes.h.

◆ PartitionRangeDatumKind

Enumerator
PARTITION_RANGE_DATUM_MINVALUE 
PARTITION_RANGE_DATUM_VALUE 
PARTITION_RANGE_DATUM_MAXVALUE 

Definition at line 964 of file parsenodes.h.

965{
966 PARTITION_RANGE_DATUM_MINVALUE = -1, /* less than any other value */
967 PARTITION_RANGE_DATUM_VALUE = 0, /* a specific (bounded) value */
968 PARTITION_RANGE_DATUM_MAXVALUE = 1, /* greater than any other value */

◆ PartitionStrategy

Enumerator
PARTITION_STRATEGY_LIST 
PARTITION_STRATEGY_RANGE 
PARTITION_STRATEGY_HASH 

Definition at line 912 of file parsenodes.h.

◆ PublicationAllObjType

Enumerator
PUBLICATION_ALL_TABLES 
PUBLICATION_ALL_SEQUENCES 

Definition at line 4481 of file parsenodes.h.

◆ PublicationObjSpecType

Enumerator
PUBLICATIONOBJ_TABLE 
PUBLICATIONOBJ_EXCEPT_TABLE 
PUBLICATIONOBJ_TABLES_IN_SCHEMA 
PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA 
PUBLICATIONOBJ_CONTINUATION 

Definition at line 4459 of file parsenodes.h.

4460{
4461 PUBLICATIONOBJ_TABLE, /* A table */
4462 PUBLICATIONOBJ_EXCEPT_TABLE, /* A table in the EXCEPT clause */
4463 PUBLICATIONOBJ_TABLES_IN_SCHEMA, /* All tables in schema */
4464 PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA, /* All tables in first element of
4465 * search_path */
4466 PUBLICATIONOBJ_CONTINUATION, /* Continuation of previous type */

◆ QuerySource

Enumerator
QSRC_ORIGINAL 
QSRC_PARSER 
QSRC_INSTEAD_RULE 
QSRC_QUAL_INSTEAD_RULE 
QSRC_NON_INSTEAD_RULE 

Definition at line 34 of file parsenodes.h.

35{
36 QSRC_ORIGINAL, /* original parsetree (explicit query) */
37 QSRC_PARSER, /* added by parse analysis (now unused) */
38 QSRC_INSTEAD_RULE, /* added by unconditional INSTEAD rule */
39 QSRC_QUAL_INSTEAD_RULE, /* added by conditional INSTEAD rule */
40 QSRC_NON_INSTEAD_RULE, /* added by non-INSTEAD rule */
QuerySource
Definition parsenodes.h:35
@ QSRC_NON_INSTEAD_RULE
Definition parsenodes.h:40
@ QSRC_PARSER
Definition parsenodes.h:37
@ QSRC_QUAL_INSTEAD_RULE
Definition parsenodes.h:39
@ QSRC_ORIGINAL
Definition parsenodes.h:36
@ QSRC_INSTEAD_RULE
Definition parsenodes.h:38

◆ ReindexObjectType

Enumerator
REINDEX_OBJECT_INDEX 
REINDEX_OBJECT_TABLE 
REINDEX_OBJECT_SCHEMA 
REINDEX_OBJECT_SYSTEM 
REINDEX_OBJECT_DATABASE 

Definition at line 4199 of file parsenodes.h.

4200{
4201 REINDEX_OBJECT_INDEX, /* index */
4202 REINDEX_OBJECT_TABLE, /* table or materialized view */
4203 REINDEX_OBJECT_SCHEMA, /* schema */
4204 REINDEX_OBJECT_SYSTEM, /* system catalogs */
4205 REINDEX_OBJECT_DATABASE, /* database */

◆ RepackCommand

Enumerator
REPACK_COMMAND_CLUSTER 
REPACK_COMMAND_REPACK 
REPACK_COMMAND_VACUUMFULL 

Definition at line 4076 of file parsenodes.h.

◆ ReturningOptionKind

Enumerator
RETURNING_OPTION_OLD 
RETURNING_OPTION_NEW 

Definition at line 1851 of file parsenodes.h.

1852{
1853 RETURNING_OPTION_OLD, /* specify alias for OLD in RETURNING */
1854 RETURNING_OPTION_NEW, /* specify alias for NEW in RETURNING */

◆ RoleSpecType

Enumerator
ROLESPEC_CSTRING 
ROLESPEC_CURRENT_ROLE 
ROLESPEC_CURRENT_USER 
ROLESPEC_SESSION_USER 
ROLESPEC_PUBLIC 

Definition at line 417 of file parsenodes.h.

418{
419 ROLESPEC_CSTRING, /* role name is stored as a C string */
420 ROLESPEC_CURRENT_ROLE, /* role spec is CURRENT_ROLE */
421 ROLESPEC_CURRENT_USER, /* role spec is CURRENT_USER */
422 ROLESPEC_SESSION_USER, /* role spec is SESSION_USER */
423 ROLESPEC_PUBLIC, /* role name is "public" */
RoleSpecType
Definition parsenodes.h:418
@ ROLESPEC_CURRENT_USER
Definition parsenodes.h:421
@ ROLESPEC_CSTRING
Definition parsenodes.h:419
@ ROLESPEC_SESSION_USER
Definition parsenodes.h:422
@ ROLESPEC_CURRENT_ROLE
Definition parsenodes.h:420
@ ROLESPEC_PUBLIC
Definition parsenodes.h:423

◆ RoleStmtType

Enumerator
ROLESTMT_ROLE 
ROLESTMT_USER 
ROLESTMT_GROUP 

Definition at line 3267 of file parsenodes.h.

3268{
3272} RoleStmtType;

◆ RTEKind

Enumerator
RTE_RELATION 
RTE_SUBQUERY 
RTE_JOIN 
RTE_FUNCTION 
RTE_TABLEFUNC 
RTE_VALUES 
RTE_CTE 
RTE_NAMEDTUPLESTORE 
RTE_GRAPH_TABLE 
RTE_RESULT 
RTE_GROUP 

Definition at line 1117 of file parsenodes.h.

1118{
1119 RTE_RELATION, /* ordinary relation reference */
1120 RTE_SUBQUERY, /* subquery in FROM */
1121 RTE_JOIN, /* join */
1122 RTE_FUNCTION, /* function in FROM */
1123 RTE_TABLEFUNC, /* TableFunc(.., column list) */
1124 RTE_VALUES, /* VALUES (<exprlist>), (<exprlist>), ... */
1125 RTE_CTE, /* common table expr (WITH list element) */
1126 RTE_NAMEDTUPLESTORE, /* tuplestore, e.g. for AFTER triggers */
1127 RTE_GRAPH_TABLE, /* GRAPH_TABLE clause */
1128 RTE_RESULT, /* RTE represents an empty FROM clause; such
1129 * RTEs are added by the planner, they're not
1130 * present during parsing or rewriting */
1131 RTE_GROUP, /* the grouping step */
1132} RTEKind;

◆ SetOperation

Enumerator
SETOP_NONE 
SETOP_UNION 
SETOP_INTERSECT 
SETOP_EXCEPT 

Definition at line 2259 of file parsenodes.h.

2260{
2261 SETOP_NONE = 0,
2265} SetOperation;

◆ SetQuantifier

Enumerator
SET_QUANTIFIER_DEFAULT 
SET_QUANTIFIER_ALL 
SET_QUANTIFIER_DISTINCT 

Definition at line 60 of file parsenodes.h.

61{
SetQuantifier
Definition parsenodes.h:61
@ SET_QUANTIFIER_ALL
Definition parsenodes.h:63
@ SET_QUANTIFIER_DISTINCT
Definition parsenodes.h:64
@ SET_QUANTIFIER_DEFAULT
Definition parsenodes.h:62

◆ SortByDir

Enumerator
SORTBY_DEFAULT 
SORTBY_ASC 
SORTBY_DESC 
SORTBY_USING 

Definition at line 44 of file parsenodes.h.

45{
49 SORTBY_USING, /* not allowed in CREATE INDEX ... */
50} SortByDir;
@ SORTBY_USING
Definition parsenodes.h:49
@ SORTBY_DESC
Definition parsenodes.h:48
@ SORTBY_ASC
Definition parsenodes.h:47
@ SORTBY_DEFAULT
Definition parsenodes.h:46

◆ SortByNulls

Enumerator
SORTBY_NULLS_DEFAULT 
SORTBY_NULLS_FIRST 
SORTBY_NULLS_LAST 

Definition at line 52 of file parsenodes.h.

53{
@ SORTBY_NULLS_DEFAULT
Definition parsenodes.h:54
@ SORTBY_NULLS_LAST
Definition parsenodes.h:56
@ SORTBY_NULLS_FIRST
Definition parsenodes.h:55

◆ TableLikeOption

Enumerator
CREATE_TABLE_LIKE_COMMENTS 
CREATE_TABLE_LIKE_COMPRESSION 
CREATE_TABLE_LIKE_CONSTRAINTS 
CREATE_TABLE_LIKE_DEFAULTS 
CREATE_TABLE_LIKE_GENERATED 
CREATE_TABLE_LIKE_IDENTITY 
CREATE_TABLE_LIKE_INDEXES 
CREATE_TABLE_LIKE_STATISTICS 
CREATE_TABLE_LIKE_STORAGE 
CREATE_TABLE_LIKE_ALL 

Definition at line 800 of file parsenodes.h.

◆ TransactionStmtKind

Enumerator
TRANS_STMT_BEGIN 
TRANS_STMT_START 
TRANS_STMT_COMMIT 
TRANS_STMT_ROLLBACK 
TRANS_STMT_SAVEPOINT 
TRANS_STMT_RELEASE 
TRANS_STMT_ROLLBACK_TO 
TRANS_STMT_PREPARE 
TRANS_STMT_COMMIT_PREPARED 
TRANS_STMT_ROLLBACK_PREPARED 

Definition at line 3877 of file parsenodes.h.

◆ VariableSetKind

Enumerator
VAR_SET_VALUE 
VAR_SET_DEFAULT 
VAR_SET_CURRENT 
VAR_SET_MULTI 
VAR_RESET 
VAR_RESET_ALL 

Definition at line 2780 of file parsenodes.h.

2781{
2782 VAR_SET_VALUE, /* SET var = value */
2783 VAR_SET_DEFAULT, /* SET var TO DEFAULT */
2784 VAR_SET_CURRENT, /* SET var FROM CURRENT */
2785 VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
2786 VAR_RESET, /* RESET var */
2787 VAR_RESET_ALL, /* RESET ALL */

◆ ViewCheckOption

Enumerator
NO_CHECK_OPTION 
LOCAL_CHECK_OPTION 
CASCADED_CHECK_OPTION 

Definition at line 3957 of file parsenodes.h.

◆ WCOKind

Enumerator
WCO_VIEW_CHECK 
WCO_RLS_INSERT_CHECK 
WCO_RLS_UPDATE_CHECK 
WCO_RLS_CONFLICT_CHECK 
WCO_RLS_MERGE_UPDATE_CHECK 
WCO_RLS_MERGE_DELETE_CHECK 

Definition at line 1471 of file parsenodes.h.

1472{
1473 WCO_VIEW_CHECK, /* WCO on an auto-updatable view */
1474 WCO_RLS_INSERT_CHECK, /* RLS INSERT WITH CHECK policy */
1475 WCO_RLS_UPDATE_CHECK, /* RLS UPDATE WITH CHECK policy */
1476 WCO_RLS_CONFLICT_CHECK, /* RLS ON CONFLICT DO SELECT/UPDATE USING
1477 * policy */
1478 WCO_RLS_MERGE_UPDATE_CHECK, /* RLS MERGE UPDATE USING policy */
1479 WCO_RLS_MERGE_DELETE_CHECK, /* RLS MERGE DELETE USING policy */
1480} WCOKind;