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  ForPortionOfClause
 
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 ForPortionOfClause ForPortionOfClause
 
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 3496 of file parsenodes.h.

◆ CURSOR_OPT_BINARY

#define CURSOR_OPT_BINARY   0x0001 /* BINARY */

Definition at line 3492 of file parsenodes.h.

◆ CURSOR_OPT_CUSTOM_PLAN

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

Definition at line 3501 of file parsenodes.h.

◆ CURSOR_OPT_FAST_PLAN

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

Definition at line 3499 of file parsenodes.h.

◆ CURSOR_OPT_GENERIC_PLAN

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

Definition at line 3500 of file parsenodes.h.

◆ CURSOR_OPT_HOLD

#define CURSOR_OPT_HOLD   0x0020 /* WITH HOLD */

Definition at line 3497 of file parsenodes.h.

◆ CURSOR_OPT_INSENSITIVE

#define CURSOR_OPT_INSENSITIVE   0x0008 /* INSENSITIVE */

Definition at line 3495 of file parsenodes.h.

◆ CURSOR_OPT_NO_SCROLL

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

Definition at line 3494 of file parsenodes.h.

◆ CURSOR_OPT_PARALLEL_OK

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

Definition at line 3502 of file parsenodes.h.

◆ CURSOR_OPT_SCROLL

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

Definition at line 3493 of file parsenodes.h.

◆ FETCH_ALL

#define FETCH_ALL   LONG_MAX

Definition at line 3553 of file parsenodes.h.

◆ FKCONSTR_ACTION_CASCADE

#define FKCONSTR_ACTION_CASCADE   'c'

Definition at line 2927 of file parsenodes.h.

◆ FKCONSTR_ACTION_NOACTION

#define FKCONSTR_ACTION_NOACTION   'a'

Definition at line 2925 of file parsenodes.h.

◆ FKCONSTR_ACTION_RESTRICT

#define FKCONSTR_ACTION_RESTRICT   'r'

Definition at line 2926 of file parsenodes.h.

◆ FKCONSTR_ACTION_SETDEFAULT

#define FKCONSTR_ACTION_SETDEFAULT   'd'

Definition at line 2929 of file parsenodes.h.

◆ FKCONSTR_ACTION_SETNULL

#define FKCONSTR_ACTION_SETNULL   'n'

Definition at line 2928 of file parsenodes.h.

◆ FKCONSTR_MATCH_FULL

#define FKCONSTR_MATCH_FULL   'f'

Definition at line 2932 of file parsenodes.h.

◆ FKCONSTR_MATCH_PARTIAL

#define FKCONSTR_MATCH_PARTIAL   'p'

Definition at line 2933 of file parsenodes.h.

◆ FKCONSTR_MATCH_SIMPLE

#define FKCONSTR_MATCH_SIMPLE   's'

Definition at line 2934 of file parsenodes.h.

◆ FRAMEOPTION_BETWEEN

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

Definition at line 618 of file parsenodes.h.

◆ FRAMEOPTION_DEFAULTS

#define FRAMEOPTION_DEFAULTS
Value:
#define FRAMEOPTION_END_CURRENT_ROW
Definition parsenodes.h:624
#define FRAMEOPTION_START_UNBOUNDED_PRECEDING
Definition parsenodes.h:619
#define FRAMEOPTION_RANGE
Definition parsenodes.h:615

Definition at line 641 of file parsenodes.h.

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

◆ FRAMEOPTION_END_CURRENT_ROW

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

Definition at line 624 of file parsenodes.h.

◆ FRAMEOPTION_END_OFFSET

Definition at line 635 of file parsenodes.h.

◆ FRAMEOPTION_END_OFFSET_FOLLOWING

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

Definition at line 628 of file parsenodes.h.

◆ FRAMEOPTION_END_OFFSET_PRECEDING

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

Definition at line 626 of file parsenodes.h.

◆ FRAMEOPTION_END_UNBOUNDED_FOLLOWING

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

Definition at line 622 of file parsenodes.h.

◆ FRAMEOPTION_END_UNBOUNDED_PRECEDING

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

Definition at line 620 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUDE_CURRENT_ROW

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

Definition at line 629 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUDE_GROUP

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

Definition at line 630 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUDE_TIES

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

Definition at line 631 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUSION

#define FRAMEOPTION_EXCLUSION
Value:
#define FRAMEOPTION_EXCLUDE_CURRENT_ROW
Definition parsenodes.h:629
#define FRAMEOPTION_EXCLUDE_TIES
Definition parsenodes.h:631
#define FRAMEOPTION_EXCLUDE_GROUP
Definition parsenodes.h:630

Definition at line 637 of file parsenodes.h.

◆ FRAMEOPTION_GROUPS

#define FRAMEOPTION_GROUPS   0x00008 /* GROUPS behavior */

Definition at line 617 of file parsenodes.h.

◆ FRAMEOPTION_NONDEFAULT

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

Definition at line 614 of file parsenodes.h.

◆ FRAMEOPTION_RANGE

#define FRAMEOPTION_RANGE   0x00002 /* RANGE behavior */

Definition at line 615 of file parsenodes.h.

◆ FRAMEOPTION_ROWS

#define FRAMEOPTION_ROWS   0x00004 /* ROWS behavior */

Definition at line 616 of file parsenodes.h.

◆ FRAMEOPTION_START_CURRENT_ROW

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

Definition at line 623 of file parsenodes.h.

◆ FRAMEOPTION_START_OFFSET

Definition at line 633 of file parsenodes.h.

◆ FRAMEOPTION_START_OFFSET_FOLLOWING

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

Definition at line 627 of file parsenodes.h.

◆ FRAMEOPTION_START_OFFSET_PRECEDING

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

Definition at line 625 of file parsenodes.h.

◆ FRAMEOPTION_START_UNBOUNDED_FOLLOWING

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

Definition at line 621 of file parsenodes.h.

◆ FRAMEOPTION_START_UNBOUNDED_PRECEDING

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

Definition at line 619 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:1000
#define IsA(nodeptr, _type_)
Definition nodes.h:162
@ CMD_SELECT
Definition nodes.h:273

Definition at line 1837 of file parsenodes.h.

1840 : \
1841 ((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 1044 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 3392 of file parsenodes.h.

◆ OPCLASS_ITEM_OPERATOR

#define OPCLASS_ITEM_OPERATOR   1

Definition at line 3391 of file parsenodes.h.

◆ OPCLASS_ITEM_STORAGETYPE

#define OPCLASS_ITEM_STORAGETYPE   3

Definition at line 3393 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

◆ ForPortionOfClause

◆ 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 333 of file parsenodes.h.

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

◆ AlterDomainType

Enumerator
AD_AlterDefault 
AD_DropNotNull 
AD_SetNotNull 
AD_AddConstraint 
AD_DropConstraint 
AD_ValidateConstraint 

Definition at line 2648 of file parsenodes.h.

2649{
2650 AD_AlterDefault = 'T', /* SET|DROP DEFAULT */
2651 AD_DropNotNull = 'N', /* DROP NOT NULL */
2652 AD_SetNotNull = 'O', /* SET NOT NULL */
2653 AD_AddConstraint = 'C', /* ADD CONSTRAINT */
2654 AD_DropConstraint = 'X', /* DROP CONSTRAINT */
2655 AD_ValidateConstraint = 'V', /* VALIDATE CONSTRAINT */

◆ AlterPropGraphElementKind

Enumerator
PROPGRAPH_ELEMENT_KIND_VERTEX 
PROPGRAPH_ELEMENT_KIND_EDGE 

Definition at line 4319 of file parsenodes.h.

◆ AlterPublicationAction

Enumerator
AP_AddObjects 
AP_DropObjects 
AP_SetObjects 

Definition at line 4522 of file parsenodes.h.

4523{
4524 AP_AddObjects, /* add objects to publication */
4525 AP_DropObjects, /* remove objects from publication */
4526 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 4558 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 2519 of file parsenodes.h.

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

2904{
2905 CONSTR_NULL, /* not standard SQL, but a lot of people
2906 * expect it */
2916 CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */
2922} ConstrType;

◆ CTEMaterialize

Enumerator
CTEMaterializeDefault 
CTEMaterializeAlways 
CTEMaterializeNever 

Definition at line 1768 of file parsenodes.h.

1769{
1770 CTEMaterializeDefault, /* no option specified */
1771 CTEMaterializeAlways, /* MATERIALIZED */
1772 CTEMaterializeNever, /* NOT MATERIALIZED */

◆ DefElemAction

Enumerator
DEFELEM_UNSPEC 
DEFELEM_SET 
DEFELEM_ADD 
DEFELEM_DROP 

Definition at line 850 of file parsenodes.h.

851{
852 DEFELEM_UNSPEC, /* no action given */

◆ DiscardMode

Enumerator
DISCARD_ALL 
DISCARD_PLANS 
DISCARD_SEQUENCES 
DISCARD_TEMP 

Definition at line 4174 of file parsenodes.h.

4175{
4180} DiscardMode;

◆ DropBehavior

Enumerator
DROP_RESTRICT 
DROP_CASCADE 

Definition at line 2500 of file parsenodes.h.

2501{
2502 DROP_RESTRICT, /* drop fails if any dependent objects */
2503 DROP_CASCADE, /* remove dependent objects too */
2504} DropBehavior;

◆ FetchDirection

Enumerator
FETCH_FORWARD 
FETCH_BACKWARD 
FETCH_ABSOLUTE 
FETCH_RELATIVE 

Definition at line 3527 of file parsenodes.h.

3528{
3529 /* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
3532 /* 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 3537 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 3680 of file parsenodes.h.

3681{
3682 /* the assigned enum values appear in pg_proc, don't change 'em! */
3683 FUNC_PARAM_IN = 'i', /* input only */
3684 FUNC_PARAM_OUT = 'o', /* output only */
3685 FUNC_PARAM_INOUT = 'b', /* both */
3686 FUNC_PARAM_VARIADIC = 'v', /* variadic (always input) */
3687 FUNC_PARAM_TABLE = 't', /* table function output column */
3688 /* this is not used in pg_proc: */
3689 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 2674 of file parsenodes.h.

2675{
2676 ACL_TARGET_OBJECT, /* grant on specific named object(s) */
2677 ACL_TARGET_ALL_IN_SCHEMA, /* grant on all objects in given schema(s) */
2678 ACL_TARGET_DEFAULTS, /* ALTER DEFAULT PRIVILEGES */

◆ GraphElementPatternKind

Enumerator
VERTEX_PATTERN 
EDGE_PATTERN_LEFT 
EDGE_PATTERN_RIGHT 
EDGE_PATTERN_ANY 
PAREN_EXPR 

Definition at line 1035 of file parsenodes.h.

◆ GroupingSetKind

Enumerator
GROUPING_SET_EMPTY 
GROUPING_SET_SIMPLE 
GROUPING_SET_ROLLUP 
GROUPING_SET_CUBE 
GROUPING_SET_SETS 

Definition at line 1615 of file parsenodes.h.

◆ ImportForeignSchemaType

Enumerator
FDW_IMPORT_SCHEMA_ALL 
FDW_IMPORT_SCHEMA_LIMIT_TO 
FDW_IMPORT_SCHEMA_EXCEPT 

Definition at line 3148 of file parsenodes.h.

3149{
3150 FDW_IMPORT_SCHEMA_ALL, /* all relations wanted */
3151 FDW_IMPORT_SCHEMA_LIMIT_TO, /* include only listed tables in import */
3152 FDW_IMPORT_SCHEMA_EXCEPT, /* exclude listed tables from import */

◆ JsonQuotes

Enumerator
JS_QUOTES_UNSPEC 
JS_QUOTES_KEEP 
JS_QUOTES_OMIT 

Definition at line 1940 of file parsenodes.h.

1941{
1942 JS_QUOTES_UNSPEC, /* unspecified */
1943 JS_QUOTES_KEEP, /* KEEP QUOTES */
1944 JS_QUOTES_OMIT, /* OMIT QUOTES */
1945} JsonQuotes;

◆ JsonTableColumnType

Enumerator
JTC_FOR_ORDINALITY 
JTC_REGULAR 
JTC_EXISTS 
JTC_FORMATTED 
JTC_NESTED 

Definition at line 2005 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 2426 of file parsenodes.h.

◆ PartitionRangeDatumKind

Enumerator
PARTITION_RANGE_DATUM_MINVALUE 
PARTITION_RANGE_DATUM_VALUE 
PARTITION_RANGE_DATUM_MAXVALUE 

Definition at line 969 of file parsenodes.h.

970{
971 PARTITION_RANGE_DATUM_MINVALUE = -1, /* less than any other value */
972 PARTITION_RANGE_DATUM_VALUE = 0, /* a specific (bounded) value */
973 PARTITION_RANGE_DATUM_MAXVALUE = 1, /* greater than any other value */

◆ PartitionStrategy

Enumerator
PARTITION_STRATEGY_LIST 
PARTITION_STRATEGY_RANGE 
PARTITION_STRATEGY_HASH 

Definition at line 917 of file parsenodes.h.

◆ PublicationAllObjType

Enumerator
PUBLICATION_ALL_TABLES 
PUBLICATION_ALL_SEQUENCES 

Definition at line 4497 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 4475 of file parsenodes.h.

4476{
4477 PUBLICATIONOBJ_TABLE, /* A table */
4478 PUBLICATIONOBJ_EXCEPT_TABLE, /* A table in the EXCEPT clause */
4479 PUBLICATIONOBJ_TABLES_IN_SCHEMA, /* All tables in schema */
4480 PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA, /* All tables in first element of
4481 * search_path */
4482 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 4215 of file parsenodes.h.

4216{
4217 REINDEX_OBJECT_INDEX, /* index */
4218 REINDEX_OBJECT_TABLE, /* table or materialized view */
4219 REINDEX_OBJECT_SCHEMA, /* schema */
4220 REINDEX_OBJECT_SYSTEM, /* system catalogs */
4221 REINDEX_OBJECT_DATABASE, /* database */

◆ RepackCommand

Enumerator
REPACK_COMMAND_CLUSTER 
REPACK_COMMAND_REPACK 
REPACK_COMMAND_VACUUMFULL 

Definition at line 4092 of file parsenodes.h.

◆ ReturningOptionKind

Enumerator
RETURNING_OPTION_OLD 
RETURNING_OPTION_NEW 

Definition at line 1867 of file parsenodes.h.

1868{
1869 RETURNING_OPTION_OLD, /* specify alias for OLD in RETURNING */
1870 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 422 of file parsenodes.h.

423{
424 ROLESPEC_CSTRING, /* role name is stored as a C string */
425 ROLESPEC_CURRENT_ROLE, /* role spec is CURRENT_ROLE */
426 ROLESPEC_CURRENT_USER, /* role spec is CURRENT_USER */
427 ROLESPEC_SESSION_USER, /* role spec is SESSION_USER */
428 ROLESPEC_PUBLIC, /* role name is "public" */
RoleSpecType
Definition parsenodes.h:423
@ ROLESPEC_CURRENT_USER
Definition parsenodes.h:426
@ ROLESPEC_CSTRING
Definition parsenodes.h:424
@ ROLESPEC_SESSION_USER
Definition parsenodes.h:427
@ ROLESPEC_CURRENT_ROLE
Definition parsenodes.h:425
@ ROLESPEC_PUBLIC
Definition parsenodes.h:428

◆ RoleStmtType

Enumerator
ROLESTMT_ROLE 
ROLESTMT_USER 
ROLESTMT_GROUP 

Definition at line 3285 of file parsenodes.h.

3286{
3290} 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 1122 of file parsenodes.h.

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

◆ SetOperation

Enumerator
SETOP_NONE 
SETOP_UNION 
SETOP_INTERSECT 
SETOP_EXCEPT 

Definition at line 2277 of file parsenodes.h.

2278{
2279 SETOP_NONE = 0,
2283} 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 805 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 3893 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 2798 of file parsenodes.h.

2799{
2800 VAR_SET_VALUE, /* SET var = value */
2801 VAR_SET_DEFAULT, /* SET var TO DEFAULT */
2802 VAR_SET_CURRENT, /* SET var FROM CURRENT */
2803 VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
2804 VAR_RESET, /* RESET var */
2805 VAR_RESET_ALL, /* RESET ALL */

◆ ViewCheckOption

Enumerator
NO_CHECK_OPTION 
LOCAL_CHECK_OPTION 
CASCADED_CHECK_OPTION 

Definition at line 3973 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 1474 of file parsenodes.h.

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