13
13
#include < cstdint>
14
14
15
15
#include " nodes.h"
16
- #include " pg_list.h"
16
+ #include " parser/ pg_list.h"
17
17
18
18
typedef enum SetOperation {
19
19
SETOP_NONE = 0 ,
@@ -73,7 +73,8 @@ typedef struct Expr { NodeTag type; } Expr;
73
73
* of the lefthand expression (if any), and operName is the String name of
74
74
* the combining operator. Also, subselect is a raw parsetree. During parse
75
75
* analysis, the parser transforms testexpr into a complete boolean expression
76
- * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the
76
+ * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing
77
+ *the
77
78
* output columns of the subselect. And subselect is transformed to a Query.
78
79
* This is the representation seen in saved rules and in the rewriter.
79
80
*
@@ -89,28 +90,25 @@ typedef struct Expr { NodeTag type; } Expr;
89
90
* The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used
90
91
* in SubPlans generated for WITH subqueries.
91
92
*/
92
- typedef enum SubLinkType
93
- {
93
+ typedef enum SubLinkType {
94
94
EXISTS_SUBLINK,
95
95
ALL_SUBLINK,
96
96
ANY_SUBLINK,
97
97
ROWCOMPARE_SUBLINK,
98
98
EXPR_SUBLINK,
99
99
MULTIEXPR_SUBLINK,
100
100
ARRAY_SUBLINK,
101
- CTE_SUBLINK /* for SubPlans only */
101
+ CTE_SUBLINK /* for SubPlans only */
102
102
} SubLinkType;
103
103
104
-
105
- typedef struct SubLink
106
- {
107
- Expr xpr;
108
- SubLinkType subLinkType; /* see above */
109
- int subLinkId; /* ID (1..n); 0 if not MULTIEXPR */
110
- Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */
111
- List *operName; /* originally specified operator name */
112
- Node *subselect; /* subselect as Query* or raw parsetree */
113
- int location; /* token location, or -1 if unknown */
104
+ typedef struct SubLink {
105
+ Expr xpr;
106
+ SubLinkType subLinkType; /* see above */
107
+ int subLinkId; /* ID (1..n); 0 if not MULTIEXPR */
108
+ Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */
109
+ List *operName; /* originally specified operator name */
110
+ Node *subselect; /* subselect as Query* or raw parsetree */
111
+ int location; /* token location, or -1 if unknown */
114
112
} SubLink;
115
113
116
114
typedef struct BoolExpr {
@@ -650,8 +648,8 @@ typedef struct DropStmt {
650
648
651
649
typedef struct DropDatabaseStmt {
652
650
NodeTag type;
653
- char *dbname; /* name of database to drop */
654
- bool missing_ok; /* skip error if object is missing? */
651
+ char *dbname; /* name of database to drop */
652
+ bool missing_ok; /* skip error if object is missing? */
655
653
} DropDatabaseStmt;
656
654
657
655
typedef struct TruncateStmt {
@@ -708,47 +706,42 @@ typedef struct CreateDatabaseStmt {
708
706
List *options; /* List of DefElem nodes */
709
707
} CreateDatabaseStmt;
710
708
711
- typedef struct CreateSchemaStmt
712
- {
713
- NodeTag type;
714
- char *schemaname; /* the name of the schema to create */
715
- Node *authrole; /* the owner of the created schema */
716
- List *schemaElts; /* schema components (list of parsenodes) */
717
- bool if_not_exists; /* just do nothing if schema already exists? */
709
+ typedef struct CreateSchemaStmt {
710
+ NodeTag type;
711
+ char *schemaname; /* the name of the schema to create */
712
+ Node *authrole; /* the owner of the created schema */
713
+ List *schemaElts; /* schema components (list of parsenodes) */
714
+ bool if_not_exists; /* just do nothing if schema already exists? */
718
715
} CreateSchemaStmt;
719
716
720
- typedef enum RoleSpecType
721
- {
722
- ROLESPEC_CSTRING, /* role name is stored as a C string */
723
- ROLESPEC_CURRENT_USER, /* role spec is CURRENT_USER */
724
- ROLESPEC_SESSION_USER, /* role spec is SESSION_USER */
725
- ROLESPEC_PUBLIC /* role name is "public" */
717
+ typedef enum RoleSpecType {
718
+ ROLESPEC_CSTRING, /* role name is stored as a C string */
719
+ ROLESPEC_CURRENT_USER, /* role spec is CURRENT_USER */
720
+ ROLESPEC_SESSION_USER, /* role spec is SESSION_USER */
721
+ ROLESPEC_PUBLIC /* role name is "public" */
726
722
} RoleSpecType;
727
723
728
- typedef struct RoleSpec
729
- {
730
- NodeTag type;
731
- RoleSpecType roletype; /* Type of this rolespec */
732
- char *rolename; /* filled only for ROLESPEC_CSTRING */
733
- int location; /* token location, or -1 if unknown */
724
+ typedef struct RoleSpec {
725
+ NodeTag type;
726
+ RoleSpecType roletype; /* Type of this rolespec */
727
+ char *rolename; /* filled only for ROLESPEC_CSTRING */
728
+ int location; /* token location, or -1 if unknown */
734
729
} RoleSpec;
735
730
736
- typedef enum ViewCheckOption
737
- {
731
+ typedef enum ViewCheckOption {
738
732
NO_CHECK_OPTION,
739
733
LOCAL_CHECK_OPTION,
740
734
CASCADED_CHECK_OPTION
741
735
} ViewCheckOption;
742
736
743
- typedef struct ViewStmt
744
- {
745
- NodeTag type;
746
- RangeVar *view; /* the view to be created */
747
- List *aliases; /* target column names */
748
- Node *query; /* the SELECT query */
749
- bool replace; /* replace an existing view? */
750
- List *options; /* options from WITH clause */
751
- ViewCheckOption withCheckOption; /* WITH CHECK OPTION */
737
+ typedef struct ViewStmt {
738
+ NodeTag type;
739
+ RangeVar *view; /* the view to be created */
740
+ List *aliases; /* target column names */
741
+ Node *query; /* the SELECT query */
742
+ bool replace; /* replace an existing view? */
743
+ List *options; /* options from WITH clause */
744
+ ViewCheckOption withCheckOption; /* WITH CHECK OPTION */
752
745
} ViewStmt;
753
746
754
747
typedef struct ParamRef {
@@ -774,29 +767,26 @@ typedef struct VacuumStmt {
774
767
List *va_cols; /* list of column names, or NIL for all */
775
768
} VacuumStmt;
776
769
777
- typedef enum
778
- {
779
- VAR_SET_VALUE, /* SET var = value */
780
- VAR_SET_DEFAULT, /* SET var TO DEFAULT */
781
- VAR_SET_CURRENT, /* SET var FROM CURRENT */
782
- VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
783
- VAR_RESET, /* RESET var */
784
- VAR_RESET_ALL /* RESET ALL */
770
+ typedef enum {
771
+ VAR_SET_VALUE, /* SET var = value */
772
+ VAR_SET_DEFAULT, /* SET var TO DEFAULT */
773
+ VAR_SET_CURRENT, /* SET var FROM CURRENT */
774
+ VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
775
+ VAR_RESET, /* RESET var */
776
+ VAR_RESET_ALL /* RESET ALL */
785
777
} VariableSetKind;
786
778
787
- typedef struct VariableSetStmt
788
- {
789
- NodeTag type;
779
+ typedef struct VariableSetStmt {
780
+ NodeTag type;
790
781
VariableSetKind kind;
791
- char *name; /* variable to be set */
792
- List *args; /* List of A_Const nodes */
793
- bool is_local; /* SET LOCAL? */
782
+ char *name; /* variable to be set */
783
+ List *args; /* List of A_Const nodes */
784
+ bool is_local; /* SET LOCAL? */
794
785
} VariableSetStmt;
795
786
796
- typedef struct VariableShowStmt
797
- {
798
- NodeTag type;
799
- char *name;
787
+ typedef struct VariableShowStmt {
788
+ NodeTag type;
789
+ char *name;
800
790
} VariableShowStmt;
801
791
802
792
// / ********** For UDFs *********** ///
0 commit comments