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  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  RangeTblEntry
 
struct  RTEPermissionInfo
 
struct  RangeTblFunction
 
struct  TableSampleClause
 
struct  WithCheckOption
 
struct  SortGroupClause
 
struct  GroupingSet
 
struct  WindowClause
 
struct  RowMarkClause
 
struct  WithClause
 
struct  InferClause
 
struct  OnConflictClause
 
struct  CTESearchClause
 
struct  CTECycleClause
 
struct  CommonTableExpr
 
struct  MergeWhenClause
 
struct  ReturningOption
 
struct  ReturningClause
 
struct  TriggerTransition
 
struct  JsonOutput
 
struct  JsonArgument
 
struct  JsonFuncExpr
 
struct  JsonTablePathSpec
 
struct  JsonTable
 
struct  JsonTableColumn
 
struct  JsonKeyValue
 
struct  JsonParseExpr
 
struct  JsonScalarExpr
 
struct  JsonSerializeExpr
 
struct  JsonObjectConstructor
 
struct  JsonArrayConstructor
 
struct  JsonArrayQueryConstructor
 
struct  JsonAggConstructor
 
struct  JsonObjectAgg
 
struct  JsonArrayAgg
 
struct  RawStmt
 
struct  InsertStmt
 
struct  DeleteStmt
 
struct  UpdateStmt
 
struct  MergeStmt
 
struct  SelectStmt
 
struct  SetOperationStmt
 
struct  ReturnStmt
 
struct  PLAssignStmt
 
struct  CreateSchemaStmt
 
struct  AlterTableStmt
 
struct  AlterTableCmd
 
struct  ATAlterConstraint
 
struct  ReplicaIdentityStmt
 
struct  AlterCollationStmt
 
struct  AlterDomainStmt
 
struct  GrantStmt
 
struct  ObjectWithArgs
 
struct  AccessPriv
 
struct  GrantRoleStmt
 
struct  AlterDefaultPrivilegesStmt
 
struct  CopyStmt
 
struct  VariableSetStmt
 
struct  VariableShowStmt
 
struct  CreateStmt
 
struct  Constraint
 
struct  CreateTableSpaceStmt
 
struct  DropTableSpaceStmt
 
struct  AlterTableSpaceOptionsStmt
 
struct  AlterTableMoveAllStmt
 
struct  CreateExtensionStmt
 
struct  AlterExtensionStmt
 
struct  AlterExtensionContentsStmt
 
struct  CreateFdwStmt
 
struct  AlterFdwStmt
 
struct  CreateForeignServerStmt
 
struct  AlterForeignServerStmt
 
struct  CreateForeignTableStmt
 
struct  CreateUserMappingStmt
 
struct  AlterUserMappingStmt
 
struct  DropUserMappingStmt
 
struct  ImportForeignSchemaStmt
 
struct  CreatePolicyStmt
 
struct  AlterPolicyStmt
 
struct  CreateAmStmt
 
struct  CreateTrigStmt
 
struct  CreateEventTrigStmt
 
struct  AlterEventTrigStmt
 
struct  CreatePLangStmt
 
struct  CreateRoleStmt
 
struct  AlterRoleStmt
 
struct  AlterRoleSetStmt
 
struct  DropRoleStmt
 
struct  CreateSeqStmt
 
struct  AlterSeqStmt
 
struct  DefineStmt
 
struct  CreateDomainStmt
 
struct  CreateOpClassStmt
 
struct  CreateOpClassItem
 
struct  CreateOpFamilyStmt
 
struct  AlterOpFamilyStmt
 
struct  DropStmt
 
struct  TruncateStmt
 
struct  CommentStmt
 
struct  SecLabelStmt
 
struct  DeclareCursorStmt
 
struct  ClosePortalStmt
 
struct  FetchStmt
 
struct  IndexStmt
 
struct  CreateStatsStmt
 
struct  StatsElem
 
struct  AlterStatsStmt
 
struct  CreateFunctionStmt
 
struct  FunctionParameter
 
struct  AlterFunctionStmt
 
struct  DoStmt
 
struct  InlineCodeBlock
 
struct  CallStmt
 
struct  CallContext
 
struct  RenameStmt
 
struct  AlterObjectDependsStmt
 
struct  AlterObjectSchemaStmt
 
struct  AlterOwnerStmt
 
struct  AlterOperatorStmt
 
struct  AlterTypeStmt
 
struct  RuleStmt
 
struct  NotifyStmt
 
struct  ListenStmt
 
struct  UnlistenStmt
 
struct  TransactionStmt
 
struct  CompositeTypeStmt
 
struct  CreateEnumStmt
 
struct  CreateRangeStmt
 
struct  AlterEnumStmt
 
struct  ViewStmt
 
struct  LoadStmt
 
struct  CreatedbStmt
 
struct  AlterDatabaseStmt
 
struct  AlterDatabaseRefreshCollStmt
 
struct  AlterDatabaseSetStmt
 
struct  DropdbStmt
 
struct  AlterSystemStmt
 
struct  ClusterStmt
 
struct  VacuumStmt
 
struct  VacuumRelation
 
struct  ExplainStmt
 
struct  CreateTableAsStmt
 
struct  RefreshMatViewStmt
 
struct  CheckPointStmt
 
struct  DiscardStmt
 
struct  LockStmt
 
struct  ConstraintsSetStmt
 
struct  ReindexStmt
 
struct  CreateConversionStmt
 
struct  CreateCastStmt
 
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 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 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 enum RTEKind RTEKind
 
typedef struct RangeTblEntry RangeTblEntry
 
typedef struct RTEPermissionInfo RTEPermissionInfo
 
typedef struct RangeTblFunction RangeTblFunction
 
typedef struct TableSampleClause TableSampleClause
 
typedef enum WCOKind WCOKind
 
typedef struct WithCheckOption WithCheckOption
 
typedef struct SortGroupClause SortGroupClause
 
typedef enum GroupingSetKind GroupingSetKind
 
typedef struct GroupingSet GroupingSet
 
typedef struct WindowClause WindowClause
 
typedef struct RowMarkClause RowMarkClause
 
typedef struct WithClause WithClause
 
typedef struct InferClause InferClause
 
typedef struct OnConflictClause OnConflictClause
 
typedef enum CTEMaterialize CTEMaterialize
 
typedef struct CTESearchClause CTESearchClause
 
typedef struct CTECycleClause CTECycleClause
 
typedef struct CommonTableExpr CommonTableExpr
 
typedef struct MergeWhenClause MergeWhenClause
 
typedef enum ReturningOptionKind ReturningOptionKind
 
typedef struct ReturningOption ReturningOption
 
typedef struct ReturningClause ReturningClause
 
typedef struct TriggerTransition TriggerTransition
 
typedef struct JsonOutput JsonOutput
 
typedef struct JsonArgument JsonArgument
 
typedef enum JsonQuotes JsonQuotes
 
typedef struct JsonFuncExpr JsonFuncExpr
 
typedef struct JsonTablePathSpec JsonTablePathSpec
 
typedef struct JsonTable JsonTable
 
typedef enum JsonTableColumnType JsonTableColumnType
 
typedef struct JsonTableColumn JsonTableColumn
 
typedef struct JsonKeyValue JsonKeyValue
 
typedef struct JsonParseExpr JsonParseExpr
 
typedef struct JsonScalarExpr JsonScalarExpr
 
typedef struct JsonSerializeExpr JsonSerializeExpr
 
typedef struct JsonObjectConstructor JsonObjectConstructor
 
typedef struct JsonArrayConstructor JsonArrayConstructor
 
typedef struct JsonArrayQueryConstructor JsonArrayQueryConstructor
 
typedef struct JsonAggConstructor JsonAggConstructor
 
typedef struct JsonObjectAgg JsonObjectAgg
 
typedef struct JsonArrayAgg JsonArrayAgg
 
typedef struct RawStmt RawStmt
 
typedef struct InsertStmt InsertStmt
 
typedef struct DeleteStmt DeleteStmt
 
typedef struct UpdateStmt UpdateStmt
 
typedef struct MergeStmt MergeStmt
 
typedef enum SetOperation SetOperation
 
typedef struct SelectStmt SelectStmt
 
typedef struct SetOperationStmt SetOperationStmt
 
typedef struct ReturnStmt ReturnStmt
 
typedef struct PLAssignStmt PLAssignStmt
 
typedef enum ObjectType ObjectType
 
typedef struct CreateSchemaStmt CreateSchemaStmt
 
typedef enum DropBehavior DropBehavior
 
typedef struct AlterTableStmt AlterTableStmt
 
typedef enum AlterTableType AlterTableType
 
typedef struct AlterTableCmd AlterTableCmd
 
typedef struct ATAlterConstraint ATAlterConstraint
 
typedef struct ReplicaIdentityStmt ReplicaIdentityStmt
 
typedef struct AlterCollationStmt AlterCollationStmt
 
typedef enum AlterDomainType AlterDomainType
 
typedef struct AlterDomainStmt AlterDomainStmt
 
typedef enum GrantTargetType GrantTargetType
 
typedef struct GrantStmt GrantStmt
 
typedef struct ObjectWithArgs ObjectWithArgs
 
typedef struct AccessPriv AccessPriv
 
typedef struct GrantRoleStmt GrantRoleStmt
 
typedef struct AlterDefaultPrivilegesStmt AlterDefaultPrivilegesStmt
 
typedef struct CopyStmt CopyStmt
 
typedef enum VariableSetKind VariableSetKind
 
typedef struct VariableSetStmt VariableSetStmt
 
typedef struct VariableShowStmt VariableShowStmt
 
typedef struct CreateStmt CreateStmt
 
typedef enum ConstrType ConstrType
 
typedef struct Constraint Constraint
 
typedef struct CreateTableSpaceStmt CreateTableSpaceStmt
 
typedef struct DropTableSpaceStmt DropTableSpaceStmt
 
typedef struct AlterTableSpaceOptionsStmt AlterTableSpaceOptionsStmt
 
typedef struct AlterTableMoveAllStmt AlterTableMoveAllStmt
 
typedef struct CreateExtensionStmt CreateExtensionStmt
 
typedef struct AlterExtensionStmt AlterExtensionStmt
 
typedef struct AlterExtensionContentsStmt AlterExtensionContentsStmt
 
typedef struct CreateFdwStmt CreateFdwStmt
 
typedef struct AlterFdwStmt AlterFdwStmt
 
typedef struct CreateForeignServerStmt CreateForeignServerStmt
 
typedef struct AlterForeignServerStmt AlterForeignServerStmt
 
typedef struct CreateForeignTableStmt CreateForeignTableStmt
 
typedef struct CreateUserMappingStmt CreateUserMappingStmt
 
typedef struct AlterUserMappingStmt AlterUserMappingStmt
 
typedef struct DropUserMappingStmt DropUserMappingStmt
 
typedef enum ImportForeignSchemaType ImportForeignSchemaType
 
typedef struct ImportForeignSchemaStmt ImportForeignSchemaStmt
 
typedef struct CreatePolicyStmt CreatePolicyStmt
 
typedef struct AlterPolicyStmt AlterPolicyStmt
 
typedef struct CreateAmStmt CreateAmStmt
 
typedef struct CreateTrigStmt CreateTrigStmt
 
typedef struct CreateEventTrigStmt CreateEventTrigStmt
 
typedef struct AlterEventTrigStmt AlterEventTrigStmt
 
typedef struct CreatePLangStmt CreatePLangStmt
 
typedef enum RoleStmtType RoleStmtType
 
typedef struct CreateRoleStmt CreateRoleStmt
 
typedef struct AlterRoleStmt AlterRoleStmt
 
typedef struct AlterRoleSetStmt AlterRoleSetStmt
 
typedef struct DropRoleStmt DropRoleStmt
 
typedef struct CreateSeqStmt CreateSeqStmt
 
typedef struct AlterSeqStmt AlterSeqStmt
 
typedef struct DefineStmt DefineStmt
 
typedef struct CreateDomainStmt CreateDomainStmt
 
typedef struct CreateOpClassStmt CreateOpClassStmt
 
typedef struct CreateOpClassItem CreateOpClassItem
 
typedef struct CreateOpFamilyStmt CreateOpFamilyStmt
 
typedef struct AlterOpFamilyStmt AlterOpFamilyStmt
 
typedef struct DropStmt DropStmt
 
typedef struct TruncateStmt TruncateStmt
 
typedef struct CommentStmt CommentStmt
 
typedef struct SecLabelStmt SecLabelStmt
 
typedef struct DeclareCursorStmt DeclareCursorStmt
 
typedef struct ClosePortalStmt ClosePortalStmt
 
typedef enum FetchDirection FetchDirection
 
typedef enum FetchDirectionKeywords FetchDirectionKeywords
 
typedef struct FetchStmt FetchStmt
 
typedef struct IndexStmt IndexStmt
 
typedef struct CreateStatsStmt CreateStatsStmt
 
typedef struct StatsElem StatsElem
 
typedef struct AlterStatsStmt AlterStatsStmt
 
typedef struct CreateFunctionStmt CreateFunctionStmt
 
typedef enum FunctionParameterMode FunctionParameterMode
 
typedef struct FunctionParameter FunctionParameter
 
typedef struct AlterFunctionStmt AlterFunctionStmt
 
typedef struct DoStmt DoStmt
 
typedef struct InlineCodeBlock InlineCodeBlock
 
typedef struct CallStmt CallStmt
 
typedef struct CallContext CallContext
 
typedef struct RenameStmt RenameStmt
 
typedef struct AlterObjectDependsStmt AlterObjectDependsStmt
 
typedef struct AlterObjectSchemaStmt AlterObjectSchemaStmt
 
typedef struct AlterOwnerStmt AlterOwnerStmt
 
typedef struct AlterOperatorStmt AlterOperatorStmt
 
typedef struct AlterTypeStmt AlterTypeStmt
 
typedef struct RuleStmt RuleStmt
 
typedef struct NotifyStmt NotifyStmt
 
typedef struct ListenStmt ListenStmt
 
typedef struct UnlistenStmt UnlistenStmt
 
typedef enum TransactionStmtKind TransactionStmtKind
 
typedef struct TransactionStmt TransactionStmt
 
typedef struct CompositeTypeStmt CompositeTypeStmt
 
typedef struct CreateEnumStmt CreateEnumStmt
 
typedef struct CreateRangeStmt CreateRangeStmt
 
typedef struct AlterEnumStmt AlterEnumStmt
 
typedef enum ViewCheckOption ViewCheckOption
 
typedef struct ViewStmt ViewStmt
 
typedef struct LoadStmt LoadStmt
 
typedef struct CreatedbStmt CreatedbStmt
 
typedef struct AlterDatabaseStmt AlterDatabaseStmt
 
typedef struct AlterDatabaseRefreshCollStmt AlterDatabaseRefreshCollStmt
 
typedef struct AlterDatabaseSetStmt AlterDatabaseSetStmt
 
typedef struct DropdbStmt DropdbStmt
 
typedef struct AlterSystemStmt AlterSystemStmt
 
typedef struct ClusterStmt ClusterStmt
 
typedef struct VacuumStmt VacuumStmt
 
typedef struct VacuumRelation VacuumRelation
 
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 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  RTEKind {
  RTE_RELATION , RTE_SUBQUERY , RTE_JOIN , RTE_FUNCTION ,
  RTE_TABLEFUNC , RTE_VALUES , RTE_CTE , RTE_NAMEDTUPLESTORE ,
  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_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  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  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_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_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 3421 of file parsenodes.h.

◆ CURSOR_OPT_BINARY

#define CURSOR_OPT_BINARY   0x0001 /* BINARY */

Definition at line 3417 of file parsenodes.h.

◆ CURSOR_OPT_CUSTOM_PLAN

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

Definition at line 3426 of file parsenodes.h.

◆ CURSOR_OPT_FAST_PLAN

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

Definition at line 3424 of file parsenodes.h.

◆ CURSOR_OPT_GENERIC_PLAN

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

Definition at line 3425 of file parsenodes.h.

◆ CURSOR_OPT_HOLD

#define CURSOR_OPT_HOLD   0x0020 /* WITH HOLD */

Definition at line 3422 of file parsenodes.h.

◆ CURSOR_OPT_INSENSITIVE

#define CURSOR_OPT_INSENSITIVE   0x0008 /* INSENSITIVE */

Definition at line 3420 of file parsenodes.h.

◆ CURSOR_OPT_NO_SCROLL

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

Definition at line 3419 of file parsenodes.h.

◆ CURSOR_OPT_PARALLEL_OK

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

Definition at line 3427 of file parsenodes.h.

◆ CURSOR_OPT_SCROLL

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

Definition at line 3418 of file parsenodes.h.

◆ FETCH_ALL

#define FETCH_ALL   LONG_MAX

Definition at line 3478 of file parsenodes.h.

◆ FKCONSTR_ACTION_CASCADE

#define FKCONSTR_ACTION_CASCADE   'c'

Definition at line 2852 of file parsenodes.h.

◆ FKCONSTR_ACTION_NOACTION

#define FKCONSTR_ACTION_NOACTION   'a'

Definition at line 2850 of file parsenodes.h.

◆ FKCONSTR_ACTION_RESTRICT

#define FKCONSTR_ACTION_RESTRICT   'r'

Definition at line 2851 of file parsenodes.h.

◆ FKCONSTR_ACTION_SETDEFAULT

#define FKCONSTR_ACTION_SETDEFAULT   'd'

Definition at line 2854 of file parsenodes.h.

◆ FKCONSTR_ACTION_SETNULL

#define FKCONSTR_ACTION_SETNULL   'n'

Definition at line 2853 of file parsenodes.h.

◆ FKCONSTR_MATCH_FULL

#define FKCONSTR_MATCH_FULL   'f'

Definition at line 2857 of file parsenodes.h.

◆ FKCONSTR_MATCH_PARTIAL

#define FKCONSTR_MATCH_PARTIAL   'p'

Definition at line 2858 of file parsenodes.h.

◆ FKCONSTR_MATCH_SIMPLE

#define FKCONSTR_MATCH_SIMPLE   's'

Definition at line 2859 of file parsenodes.h.

◆ FRAMEOPTION_BETWEEN

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

Definition at line 613 of file parsenodes.h.

◆ FRAMEOPTION_DEFAULTS

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

Definition at line 636 of file parsenodes.h.

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

◆ FRAMEOPTION_END_CURRENT_ROW

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

Definition at line 619 of file parsenodes.h.

◆ FRAMEOPTION_END_OFFSET

Definition at line 630 of file parsenodes.h.

◆ FRAMEOPTION_END_OFFSET_FOLLOWING

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

Definition at line 623 of file parsenodes.h.

◆ FRAMEOPTION_END_OFFSET_PRECEDING

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

Definition at line 621 of file parsenodes.h.

◆ FRAMEOPTION_END_UNBOUNDED_FOLLOWING

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

Definition at line 617 of file parsenodes.h.

◆ FRAMEOPTION_END_UNBOUNDED_PRECEDING

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

Definition at line 615 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUDE_CURRENT_ROW

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

Definition at line 624 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUDE_GROUP

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

Definition at line 625 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUDE_TIES

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

Definition at line 626 of file parsenodes.h.

◆ FRAMEOPTION_EXCLUSION

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

Definition at line 632 of file parsenodes.h.

◆ FRAMEOPTION_GROUPS

#define FRAMEOPTION_GROUPS   0x00008 /* GROUPS behavior */

Definition at line 612 of file parsenodes.h.

◆ FRAMEOPTION_NONDEFAULT

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

Definition at line 609 of file parsenodes.h.

◆ FRAMEOPTION_RANGE

#define FRAMEOPTION_RANGE   0x00002 /* RANGE behavior */

Definition at line 610 of file parsenodes.h.

◆ FRAMEOPTION_ROWS

#define FRAMEOPTION_ROWS   0x00004 /* ROWS behavior */

Definition at line 611 of file parsenodes.h.

◆ FRAMEOPTION_START_CURRENT_ROW

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

Definition at line 618 of file parsenodes.h.

◆ FRAMEOPTION_START_OFFSET

Definition at line 628 of file parsenodes.h.

◆ FRAMEOPTION_START_OFFSET_FOLLOWING

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

Definition at line 622 of file parsenodes.h.

◆ FRAMEOPTION_START_OFFSET_PRECEDING

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

Definition at line 620 of file parsenodes.h.

◆ FRAMEOPTION_START_UNBOUNDED_FOLLOWING

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

Definition at line 616 of file parsenodes.h.

◆ FRAMEOPTION_START_UNBOUNDED_PRECEDING

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

Definition at line 614 of file parsenodes.h.

◆ GetCTETargetList

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

Definition at line 1765 of file parsenodes.h.

1768 : \
1769 ((Query *) (cte)->ctequery)->returningList)

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

◆ OPCLASS_ITEM_OPERATOR

#define OPCLASS_ITEM_OPERATOR   1

Definition at line 3316 of file parsenodes.h.

◆ OPCLASS_ITEM_STORAGETYPE

#define OPCLASS_ITEM_STORAGETYPE   3

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

◆ AlterPublicationAction

◆ AlterPublicationStmt

◆ AlterRoleSetStmt

◆ AlterRoleStmt

◆ AlterSeqStmt

◆ AlterStatsStmt

◆ AlterSubscriptionStmt

◆ AlterSubscriptionType

◆ AlterSystemStmt

◆ AlterTableCmd

◆ AlterTableMoveAllStmt

◆ AlterTableSpaceOptionsStmt

◆ AlterTableStmt

◆ AlterTableType

◆ AlterTSConfigType

◆ AlterTSConfigurationStmt

◆ AlterTSDictionaryStmt

◆ AlterTypeStmt

◆ AlterUserMappingStmt

◆ ATAlterConstraint

◆ CallContext

◆ CallStmt

◆ CheckPointStmt

◆ ClosePortalStmt

◆ ClusterStmt

◆ 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

◆ CreatePublicationStmt

◆ CreateRangeStmt

◆ CreateRoleStmt

◆ CreateSchemaStmt

◆ CreateSeqStmt

◆ CreateStatsStmt

◆ CreateStmt

◆ CreateSubscriptionStmt

◆ CreateTableAsStmt

◆ CreateTableSpaceStmt

◆ CreateTransformStmt

◆ CreateTrigStmt

◆ CreateUserMappingStmt

◆ CTECycleClause

◆ CTEMaterialize

◆ CTESearchClause

◆ DeallocateStmt

◆ DeclareCursorStmt

◆ DefElem

◆ DefElemAction

◆ DefineStmt

◆ DeleteStmt

◆ DiscardMode

◆ DiscardStmt

◆ DoStmt

◆ DropBehavior

◆ DropdbStmt

◆ DropOwnedStmt

◆ DropRoleStmt

◆ DropStmt

◆ DropSubscriptionStmt

◆ DropTableSpaceStmt

◆ DropUserMappingStmt

◆ ExecuteStmt

◆ ExplainStmt

◆ FetchDirection

◆ FetchDirectionKeywords

◆ FetchStmt

◆ FuncCall

◆ FunctionParameter

◆ FunctionParameterMode

◆ GrantRoleStmt

◆ GrantStmt

◆ GrantTargetType

◆ 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

◆ PublicationAllObjSpec

◆ PublicationAllObjType

◆ PublicationObjSpec

◆ PublicationObjSpecType

◆ PublicationTable

◆ Query

◆ QuerySource

◆ RangeFunction

◆ RangeSubselect

◆ RangeTableFunc

◆ RangeTableFuncCol

◆ RangeTableSample

◆ RangeTblEntry

◆ RangeTblFunction

◆ RawStmt

◆ ReassignOwnedStmt

◆ RefreshMatViewStmt

◆ ReindexObjectType

◆ ReindexStmt

◆ RenameStmt

◆ ReplicaIdentityStmt

◆ ResTarget

◆ ReturningClause

◆ ReturningOption

◆ ReturningOptionKind

◆ ReturnStmt

◆ RoleSpec

◆ RoleSpecType

◆ RoleStmtType

◆ RowMarkClause

◆ RTEKind

◆ RTEPermissionInfo

◆ RuleStmt

◆ SecLabelStmt

◆ SelectStmt

◆ SetOperation

◆ SetOperationStmt

◆ SetQuantifier

◆ SinglePartitionSpec

◆ SortBy

◆ SortByDir

◆ SortByNulls

◆ SortGroupClause

◆ StatsElem

◆ TableLikeClause

◆ TableLikeOption

◆ TableSampleClause

◆ TransactionStmt

◆ TransactionStmtKind

◆ TriggerTransition

◆ TruncateStmt

◆ TypeCast

◆ TypeName

◆ UnlistenStmt

◆ UpdateStmt

◆ VacuumRelation

◆ VacuumStmt

◆ VariableSetKind

◆ VariableSetStmt

◆ VariableShowStmt

◆ ViewCheckOption

◆ ViewStmt

◆ WaitStmt

◆ WCOKind

◆ WindowClause

◆ WindowDef

◆ WithCheckOption

◆ WithClause

◆ XmlSerialize

Enumeration Type Documentation

◆ A_Expr_Kind

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

Definition at line 328 of file parsenodes.h.

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

◆ AlterDomainType

Enumerator
AD_AlterDefault 
AD_DropNotNull 
AD_SetNotNull 
AD_AddConstraint 
AD_DropConstraint 
AD_ValidateConstraint 

Definition at line 2573 of file parsenodes.h.

2574{
2575 AD_AlterDefault = 'T', /* SET|DROP DEFAULT */
2576 AD_DropNotNull = 'N', /* DROP NOT NULL */
2577 AD_SetNotNull = 'O', /* SET NOT NULL */
2578 AD_AddConstraint = 'C', /* ADD CONSTRAINT */
2579 AD_DropConstraint = 'X', /* DROP CONSTRAINT */
2580 AD_ValidateConstraint = 'V', /* VALIDATE CONSTRAINT */

◆ AlterPublicationAction

Enumerator
AP_AddObjects 
AP_DropObjects 
AP_SetObjects 

Definition at line 4355 of file parsenodes.h.

4356{
4357 AP_AddObjects, /* add objects to publication */
4358 AP_DropObjects, /* remove objects from publication */
4359 AP_SetObjects, /* set list of objects */

◆ AlterSubscriptionType

Enumerator
ALTER_SUBSCRIPTION_OPTIONS 
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 4388 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 2444 of file parsenodes.h.

2445{
2446 AT_AddColumn, /* add column */
2447 AT_AddColumnToView, /* implicitly via CREATE OR REPLACE VIEW */
2448 AT_ColumnDefault, /* alter column default */
2449 AT_CookedColumnDefault, /* add a pre-cooked column default */
2450 AT_DropNotNull, /* alter column drop not null */
2451 AT_SetNotNull, /* alter column set not null */
2452 AT_SetExpression, /* alter column set expression */
2453 AT_DropExpression, /* alter column drop expression */
2454 AT_SetStatistics, /* alter column set statistics */
2455 AT_SetOptions, /* alter column set ( options ) */
2456 AT_ResetOptions, /* alter column reset ( options ) */
2457 AT_SetStorage, /* alter column set storage */
2458 AT_SetCompression, /* alter column set compression */
2459 AT_DropColumn, /* drop column */
2460 AT_AddIndex, /* add index */
2461 AT_ReAddIndex, /* internal to commands/tablecmds.c */
2462 AT_AddConstraint, /* add constraint */
2463 AT_ReAddConstraint, /* internal to commands/tablecmds.c */
2464 AT_ReAddDomainConstraint, /* internal to commands/tablecmds.c */
2465 AT_AlterConstraint, /* alter constraint */
2466 AT_ValidateConstraint, /* validate constraint */
2467 AT_AddIndexConstraint, /* add constraint using existing index */
2468 AT_DropConstraint, /* drop constraint */
2469 AT_ReAddComment, /* internal to commands/tablecmds.c */
2470 AT_AlterColumnType, /* alter column type */
2471 AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */
2472 AT_ChangeOwner, /* change owner */
2473 AT_ClusterOn, /* CLUSTER ON */
2474 AT_DropCluster, /* SET WITHOUT CLUSTER */
2475 AT_SetLogged, /* SET LOGGED */
2476 AT_SetUnLogged, /* SET UNLOGGED */
2477 AT_DropOids, /* SET WITHOUT OIDS */
2478 AT_SetAccessMethod, /* SET ACCESS METHOD */
2479 AT_SetTableSpace, /* SET TABLESPACE */
2480 AT_SetRelOptions, /* SET (...) -- AM specific parameters */
2481 AT_ResetRelOptions, /* RESET (...) -- AM specific parameters */
2482 AT_ReplaceRelOptions, /* replace reloption list in its entirety */
2483 AT_EnableTrig, /* ENABLE TRIGGER name */
2484 AT_EnableAlwaysTrig, /* ENABLE ALWAYS TRIGGER name */
2485 AT_EnableReplicaTrig, /* ENABLE REPLICA TRIGGER name */
2486 AT_DisableTrig, /* DISABLE TRIGGER name */
2487 AT_EnableTrigAll, /* ENABLE TRIGGER ALL */
2488 AT_DisableTrigAll, /* DISABLE TRIGGER ALL */
2489 AT_EnableTrigUser, /* ENABLE TRIGGER USER */
2490 AT_DisableTrigUser, /* DISABLE TRIGGER USER */
2491 AT_EnableRule, /* ENABLE RULE name */
2492 AT_EnableAlwaysRule, /* ENABLE ALWAYS RULE name */
2493 AT_EnableReplicaRule, /* ENABLE REPLICA RULE name */
2494 AT_DisableRule, /* DISABLE RULE name */
2495 AT_AddInherit, /* INHERIT parent */
2496 AT_DropInherit, /* NO INHERIT parent */
2497 AT_AddOf, /* OF <type_name> */
2498 AT_DropOf, /* NOT OF */
2499 AT_ReplicaIdentity, /* REPLICA IDENTITY */
2500 AT_EnableRowSecurity, /* ENABLE ROW SECURITY */
2501 AT_DisableRowSecurity, /* DISABLE ROW SECURITY */
2502 AT_ForceRowSecurity, /* FORCE ROW SECURITY */
2503 AT_NoForceRowSecurity, /* NO FORCE ROW SECURITY */
2504 AT_GenericOptions, /* OPTIONS (...) */
2505 AT_AttachPartition, /* ATTACH PARTITION */
2506 AT_DetachPartition, /* DETACH PARTITION */
2507 AT_DetachPartitionFinalize, /* DETACH PARTITION FINALIZE */
2508 AT_SplitPartition, /* SPLIT PARTITION */
2509 AT_MergePartitions, /* MERGE PARTITIONS */
2510 AT_AddIdentity, /* ADD IDENTITY */
2511 AT_SetIdentity, /* SET identity column options */
2512 AT_DropIdentity, /* DROP IDENTITY */
2513 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 4273 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 2828 of file parsenodes.h.

2829{
2830 CONSTR_NULL, /* not standard SQL, but a lot of people
2831 * expect it */
2841 CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */
2847} ConstrType;

◆ CTEMaterialize

Enumerator
CTEMaterializeDefault 
CTEMaterializeAlways 
CTEMaterializeNever 

Definition at line 1696 of file parsenodes.h.

1697{
1698 CTEMaterializeDefault, /* no option specified */
1699 CTEMaterializeAlways, /* MATERIALIZED */
1700 CTEMaterializeNever, /* NOT MATERIALIZED */

◆ DefElemAction

Enumerator
DEFELEM_UNSPEC 
DEFELEM_SET 
DEFELEM_ADD 
DEFELEM_DROP 

Definition at line 832 of file parsenodes.h.

833{
834 DEFELEM_UNSPEC, /* no action given */

◆ DiscardMode

Enumerator
DISCARD_ALL 
DISCARD_PLANS 
DISCARD_SEQUENCES 
DISCARD_TEMP 

Definition at line 4092 of file parsenodes.h.

4093{
4098} DiscardMode;

◆ DropBehavior

Enumerator
DROP_RESTRICT 
DROP_CASCADE 

Definition at line 2425 of file parsenodes.h.

2426{
2427 DROP_RESTRICT, /* drop fails if any dependent objects */
2428 DROP_CASCADE, /* remove dependent objects too */
2429} DropBehavior;

◆ FetchDirection

Enumerator
FETCH_FORWARD 
FETCH_BACKWARD 
FETCH_ABSOLUTE 
FETCH_RELATIVE 

Definition at line 3452 of file parsenodes.h.

3453{
3454 /* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
3457 /* 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 3462 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 3605 of file parsenodes.h.

3606{
3607 /* the assigned enum values appear in pg_proc, don't change 'em! */
3608 FUNC_PARAM_IN = 'i', /* input only */
3609 FUNC_PARAM_OUT = 'o', /* output only */
3610 FUNC_PARAM_INOUT = 'b', /* both */
3611 FUNC_PARAM_VARIADIC = 'v', /* variadic (always input) */
3612 FUNC_PARAM_TABLE = 't', /* table function output column */
3613 /* this is not used in pg_proc: */
3614 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 2599 of file parsenodes.h.

2600{
2601 ACL_TARGET_OBJECT, /* grant on specific named object(s) */
2602 ACL_TARGET_ALL_IN_SCHEMA, /* grant on all objects in given schema(s) */
2603 ACL_TARGET_DEFAULTS, /* ALTER DEFAULT PRIVILEGES */

◆ GroupingSetKind

Enumerator
GROUPING_SET_EMPTY 
GROUPING_SET_SIMPLE 
GROUPING_SET_ROLLUP 
GROUPING_SET_CUBE 
GROUPING_SET_SETS 

Definition at line 1556 of file parsenodes.h.

◆ ImportForeignSchemaType

Enumerator
FDW_IMPORT_SCHEMA_ALL 
FDW_IMPORT_SCHEMA_LIMIT_TO 
FDW_IMPORT_SCHEMA_EXCEPT 

Definition at line 3073 of file parsenodes.h.

3074{
3075 FDW_IMPORT_SCHEMA_ALL, /* all relations wanted */
3076 FDW_IMPORT_SCHEMA_LIMIT_TO, /* include only listed tables in import */
3077 FDW_IMPORT_SCHEMA_EXCEPT, /* exclude listed tables from import */

◆ JsonQuotes

Enumerator
JS_QUOTES_UNSPEC 
JS_QUOTES_KEEP 
JS_QUOTES_OMIT 

Definition at line 1868 of file parsenodes.h.

1869{
1870 JS_QUOTES_UNSPEC, /* unspecified */
1871 JS_QUOTES_KEEP, /* KEEP QUOTES */
1872 JS_QUOTES_OMIT, /* OMIT QUOTES */
1873} JsonQuotes;

◆ JsonTableColumnType

Enumerator
JTC_FOR_ORDINALITY 
JTC_REGULAR 
JTC_EXISTS 
JTC_FORMATTED 
JTC_NESTED 

Definition at line 1933 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_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 2352 of file parsenodes.h.

◆ PartitionRangeDatumKind

Enumerator
PARTITION_RANGE_DATUM_MINVALUE 
PARTITION_RANGE_DATUM_VALUE 
PARTITION_RANGE_DATUM_MAXVALUE 

Definition at line 951 of file parsenodes.h.

952{
953 PARTITION_RANGE_DATUM_MINVALUE = -1, /* less than any other value */
954 PARTITION_RANGE_DATUM_VALUE = 0, /* a specific (bounded) value */
955 PARTITION_RANGE_DATUM_MAXVALUE = 1, /* greater than any other value */

◆ PartitionStrategy

Enumerator
PARTITION_STRATEGY_LIST 
PARTITION_STRATEGY_RANGE 
PARTITION_STRATEGY_HASH 

Definition at line 899 of file parsenodes.h.

◆ PublicationAllObjType

Enumerator
PUBLICATION_ALL_TABLES 
PUBLICATION_ALL_SEQUENCES 

Definition at line 4331 of file parsenodes.h.

◆ PublicationObjSpecType

Enumerator
PUBLICATIONOBJ_TABLE 
PUBLICATIONOBJ_TABLES_IN_SCHEMA 
PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA 
PUBLICATIONOBJ_CONTINUATION 

Definition at line 4310 of file parsenodes.h.

4311{
4312 PUBLICATIONOBJ_TABLE, /* A table */
4313 PUBLICATIONOBJ_TABLES_IN_SCHEMA, /* All tables in schema */
4314 PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA, /* All tables in first element of
4315 * search_path */
4316 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 4133 of file parsenodes.h.

4134{
4135 REINDEX_OBJECT_INDEX, /* index */
4136 REINDEX_OBJECT_TABLE, /* table or materialized view */
4137 REINDEX_OBJECT_SCHEMA, /* schema */
4138 REINDEX_OBJECT_SYSTEM, /* system catalogs */
4139 REINDEX_OBJECT_DATABASE, /* database */

◆ ReturningOptionKind

Enumerator
RETURNING_OPTION_OLD 
RETURNING_OPTION_NEW 

Definition at line 1795 of file parsenodes.h.

1796{
1797 RETURNING_OPTION_OLD, /* specify alias for OLD in RETURNING */
1798 RETURNING_OPTION_NEW, /* specify alias for NEW in RETURNING */

◆ RoleSpecType

Enumerator
ROLESPEC_CSTRING 
ROLESPEC_CURRENT_ROLE 
ROLESPEC_CURRENT_USER 
ROLESPEC_SESSION_USER 
ROLESPEC_PUBLIC 

Definition at line 417 of file parsenodes.h.

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

◆ RoleStmtType

Enumerator
ROLESTMT_ROLE 
ROLESTMT_USER 
ROLESTMT_GROUP 

Definition at line 3210 of file parsenodes.h.

3211{
3215} RoleStmtType;

◆ RTEKind

Enumerator
RTE_RELATION 
RTE_SUBQUERY 
RTE_JOIN 
RTE_FUNCTION 
RTE_TABLEFUNC 
RTE_VALUES 
RTE_CTE 
RTE_NAMEDTUPLESTORE 
RTE_RESULT 
RTE_GROUP 

Definition at line 1068 of file parsenodes.h.

1069{
1070 RTE_RELATION, /* ordinary relation reference */
1071 RTE_SUBQUERY, /* subquery in FROM */
1072 RTE_JOIN, /* join */
1073 RTE_FUNCTION, /* function in FROM */
1074 RTE_TABLEFUNC, /* TableFunc(.., column list) */
1075 RTE_VALUES, /* VALUES (<exprlist>), (<exprlist>), ... */
1076 RTE_CTE, /* common table expr (WITH list element) */
1077 RTE_NAMEDTUPLESTORE, /* tuplestore, e.g. for AFTER triggers */
1078 RTE_RESULT, /* RTE represents an empty FROM clause; such
1079 * RTEs are added by the planner, they're not
1080 * present during parsing or rewriting */
1081 RTE_GROUP, /* the grouping step */
1082} RTEKind;

◆ SetOperation

Enumerator
SETOP_NONE 
SETOP_UNION 
SETOP_INTERSECT 
SETOP_EXCEPT 

Definition at line 2203 of file parsenodes.h.

2204{
2205 SETOP_NONE = 0,
2209} 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 787 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 3820 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 2723 of file parsenodes.h.

2724{
2725 VAR_SET_VALUE, /* SET var = value */
2726 VAR_SET_DEFAULT, /* SET var TO DEFAULT */
2727 VAR_SET_CURRENT, /* SET var FROM CURRENT */
2728 VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
2729 VAR_RESET, /* RESET var */
2730 VAR_RESET_ALL, /* RESET ALL */

◆ ViewCheckOption

Enumerator
NO_CHECK_OPTION 
LOCAL_CHECK_OPTION 
CASCADED_CHECK_OPTION 

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

1416{
1417 WCO_VIEW_CHECK, /* WCO on an auto-updatable view */
1418 WCO_RLS_INSERT_CHECK, /* RLS INSERT WITH CHECK policy */
1419 WCO_RLS_UPDATE_CHECK, /* RLS UPDATE WITH CHECK policy */
1420 WCO_RLS_CONFLICT_CHECK, /* RLS ON CONFLICT DO SELECT/UPDATE USING
1421 * policy */
1422 WCO_RLS_MERGE_UPDATE_CHECK, /* RLS MERGE UPDATE USING policy */
1423 WCO_RLS_MERGE_DELETE_CHECK, /* RLS MERGE DELETE USING policy */
1424} WCOKind;