* Definitions that are needed outside the core parser should be in parser.h.
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/gramparse.h
* lexical token lookup for key words in PostgreSQL
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/keywords.h
* by the PG_KEYWORD macro, which is not defined in this file; it can
* be defined by the caller for special purposes.
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
PG_KEYWORD("both", BOTH, RESERVED_KEYWORD)
PG_KEYWORD("by", BY, UNRESERVED_KEYWORD)
PG_KEYWORD("cache", CACHE, UNRESERVED_KEYWORD)
+PG_KEYWORD("call", CALL, UNRESERVED_KEYWORD)
PG_KEYWORD("called", CALLED, UNRESERVED_KEYWORD)
PG_KEYWORD("cascade", CASCADE, UNRESERVED_KEYWORD)
PG_KEYWORD("cascaded", CASCADED, UNRESERVED_KEYWORD)
PG_KEYWORD("greatest", GREATEST, COL_NAME_KEYWORD)
PG_KEYWORD("group", GROUP_P, RESERVED_KEYWORD)
PG_KEYWORD("grouping", GROUPING, COL_NAME_KEYWORD)
+PG_KEYWORD("groups", GROUPS, UNRESERVED_KEYWORD)
PG_KEYWORD("handler", HANDLER, UNRESERVED_KEYWORD)
PG_KEYWORD("having", HAVING, RESERVED_KEYWORD)
PG_KEYWORD("header", HEADER_P, UNRESERVED_KEYWORD)
PG_KEYWORD("implicit", IMPLICIT_P, UNRESERVED_KEYWORD)
PG_KEYWORD("import", IMPORT_P, UNRESERVED_KEYWORD)
PG_KEYWORD("in", IN_P, RESERVED_KEYWORD)
+PG_KEYWORD("include", INCLUDE, UNRESERVED_KEYWORD)
PG_KEYWORD("including", INCLUDING, UNRESERVED_KEYWORD)
PG_KEYWORD("increment", INCREMENT, UNRESERVED_KEYWORD)
PG_KEYWORD("index", INDEX, UNRESERVED_KEYWORD)
PG_KEYWORD("or", OR, RESERVED_KEYWORD)
PG_KEYWORD("order", ORDER, RESERVED_KEYWORD)
PG_KEYWORD("ordinality", ORDINALITY, UNRESERVED_KEYWORD)
+PG_KEYWORD("others", OTHERS, UNRESERVED_KEYWORD)
PG_KEYWORD("out", OUT_P, COL_NAME_KEYWORD)
PG_KEYWORD("outer", OUTER_P, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("over", OVER, UNRESERVED_KEYWORD)
PG_KEYWORD("privileges", PRIVILEGES, UNRESERVED_KEYWORD)
PG_KEYWORD("procedural", PROCEDURAL, UNRESERVED_KEYWORD)
PG_KEYWORD("procedure", PROCEDURE, UNRESERVED_KEYWORD)
+PG_KEYWORD("procedures", PROCEDURES, UNRESERVED_KEYWORD)
PG_KEYWORD("program", PROGRAM, UNRESERVED_KEYWORD)
PG_KEYWORD("publication", PUBLICATION, UNRESERVED_KEYWORD)
PG_KEYWORD("quote", QUOTE, UNRESERVED_KEYWORD)
PG_KEYWORD("role", ROLE, UNRESERVED_KEYWORD)
PG_KEYWORD("rollback", ROLLBACK, UNRESERVED_KEYWORD)
PG_KEYWORD("rollup", ROLLUP, UNRESERVED_KEYWORD)
+PG_KEYWORD("routine", ROUTINE, UNRESERVED_KEYWORD)
+PG_KEYWORD("routines", ROUTINES, UNRESERVED_KEYWORD)
PG_KEYWORD("row", ROW, COL_NAME_KEYWORD)
PG_KEYWORD("rows", ROWS, UNRESERVED_KEYWORD)
PG_KEYWORD("rule", RULE, UNRESERVED_KEYWORD)
PG_KEYWORD("temporary", TEMPORARY, UNRESERVED_KEYWORD)
PG_KEYWORD("text", TEXT_P, UNRESERVED_KEYWORD)
PG_KEYWORD("then", THEN, RESERVED_KEYWORD)
+PG_KEYWORD("ties", TIES, UNRESERVED_KEYWORD)
PG_KEYWORD("time", TIME, COL_NAME_KEYWORD)
PG_KEYWORD("timestamp", TIMESTAMP, COL_NAME_KEYWORD)
PG_KEYWORD("to", TO, RESERVED_KEYWORD)
* prototypes for the creator functions (for primitive nodes)
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/makefuncs.h
extern GroupingSet *makeGroupingSet(GroupingSetKind kind, List *content, int location);
+extern VacuumRelation *makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols);
+
#endif /* MAKEFUNC_H */
* Definitions for tagged nodes.
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/nodes.h
T_ExprContext,
T_ProjectionInfo,
T_JunkFilter,
+ T_OnConflictSetState,
T_ResultRelInfo,
T_EState,
T_TupleTableSlot,
/* these aren't subclasses of Plan: */
T_NestLoopParam,
T_PlanRowMark,
+ T_PartitionPruneInfo,
+ T_PartitionedRelPruneInfo,
+ T_PartitionPruneStepOp,
+ T_PartitionPruneStepCombine,
T_PlanInvalItem,
/*
T_PlaceHolderVar,
T_SpecialJoinInfo,
T_AppendRelInfo,
- T_PartitionedChildRelInfo,
T_PlaceHolderInfo,
T_MinMaxAggInfo,
T_PlannerParamItem,
T_MemoryContext,
T_AllocSetContext,
T_SlabContext,
+ T_GenerationContext,
/*
* TAGS FOR VALUE NODES (value.h)
T_DropSubscriptionStmt,
T_CreateStatsStmt,
T_AlterCollationStmt,
+ T_CallStmt,
/*
* TAGS FOR PARSE TREE NODES (parsenodes.h)
T_PartitionBoundSpec,
T_PartitionRangeDatum,
T_PartitionCmd,
+ T_VacuumRelation,
/*
* TAGS FOR REPLICATION GRAMMAR PARSE NODES (replnodes.h)
T_FdwRoutine, /* in foreign/fdwapi.h */
T_IndexAmRoutine, /* in access/amapi.h */
TsmRoutine , /* in access/tsmapi.h */
- T_ForeignKeyCacheInfo, /* in utils/rel.h */
+ T_ForeignKeyCacheInfo, /* in utils/rel.h */
+ T_CallContext, /* in nodes/parsenodes.h */
/* pgpool Extention */
T_PgpoolVariableSetStmt,
T_PgpoolVariableShowStmt
* identifying statement boundaries in multi-statement source strings.
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/parsenodes.h
QuerySource querySource; /* where did I come from? */
- uint32 queryId; /* query identifier (can be set by plugins) */
+ uint64 queryId; /* query identifier (can be set by plugins) */
bool canSetTag; /* do I set the command result tag? */
* Similarly, if "typmods" is NIL then the actual typmod is expected to
* be prespecified in typemod, otherwise typemod is unused.
*
- * If pct_type is TRUE, then names is actually a field name and we look up
+ * If pct_type is true, then names is actually a field name and we look up
* the type of that field. Otherwise (the normal case), names is a type
* name possibly qualified with schema and database name.
*/
* which were defaulted; the correct behavioral bits must be set either way.
* The START_foo and END_foo options must come in pairs of adjacent bits for
* the convenience of gram.y, even though some of them are useless/invalid.
- * We will need more bits (and fields) to cover the full SQL:2008 option set.
*/
#define FRAMEOPTION_NONDEFAULT 0x00001 /* any specified? */
#define FRAMEOPTION_RANGE 0x00002 /* RANGE behavior */
#define FRAMEOPTION_ROWS 0x00004 /* ROWS behavior */
-#define FRAMEOPTION_BETWEEN 0x00008 /* BETWEEN given? */
-#define FRAMEOPTION_START_UNBOUNDED_PRECEDING 0x00010 /* start is U. P. */
-#define FRAMEOPTION_END_UNBOUNDED_PRECEDING 0x00020 /* (disallowed) */
-#define FRAMEOPTION_START_UNBOUNDED_FOLLOWING 0x00040 /* (disallowed) */
-#define FRAMEOPTION_END_UNBOUNDED_FOLLOWING 0x00080 /* end is U. F. */
-#define FRAMEOPTION_START_CURRENT_ROW 0x00100 /* start is C. R. */
-#define FRAMEOPTION_END_CURRENT_ROW 0x00200 /* end is C. R. */
-#define FRAMEOPTION_START_VALUE_PRECEDING 0x00400 /* start is V. P. */
-#define FRAMEOPTION_END_VALUE_PRECEDING 0x00800 /* end is V. P. */
-#define FRAMEOPTION_START_VALUE_FOLLOWING 0x01000 /* start is V. F. */
-#define FRAMEOPTION_END_VALUE_FOLLOWING 0x02000 /* end is V. F. */
-
-#define FRAMEOPTION_START_VALUE \
- (FRAMEOPTION_START_VALUE_PRECEDING | FRAMEOPTION_START_VALUE_FOLLOWING)
-#define FRAMEOPTION_END_VALUE \
- (FRAMEOPTION_END_VALUE_PRECEDING | FRAMEOPTION_END_VALUE_FOLLOWING)
+#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 \
+ (FRAMEOPTION_EXCLUDE_CURRENT_ROW | FRAMEOPTION_EXCLUDE_GROUP | \
+ FRAMEOPTION_EXCLUDE_TIES)
#define FRAMEOPTION_DEFAULTS \
(FRAMEOPTION_RANGE | FRAMEOPTION_START_UNBOUNDED_PRECEDING | \
Node *raw_default; /* default value (untransformed parse tree) */
Node *cooked_default; /* default value (transformed expr tree) */
char identity; /* attidentity setting */
+ RangeVar *identitySequence; /* to store identity sequence name for
+ * ALTER TABLE ... ADD COLUMN */
CollateClause *collClause; /* untransformed COLLATE spec, if any */
Oid collOid; /* collation OID (InvalidOid if not set) */
List *constraints; /* other constraints on column */
typedef enum TableLikeOption
{
- CREATE_TABLE_LIKE_DEFAULTS = 1 << 0,
+ CREATE_TABLE_LIKE_COMMENTS = 1 << 0,
CREATE_TABLE_LIKE_CONSTRAINTS = 1 << 1,
- CREATE_TABLE_LIKE_IDENTITY = 1 << 2,
- CREATE_TABLE_LIKE_INDEXES = 1 << 3,
- CREATE_TABLE_LIKE_STORAGE = 1 << 4,
- CREATE_TABLE_LIKE_COMMENTS = 1 << 5,
+ CREATE_TABLE_LIKE_DEFAULTS = 1 << 2,
+ CREATE_TABLE_LIKE_IDENTITY = 1 << 3,
+ CREATE_TABLE_LIKE_INDEXES = 1 << 4,
+ CREATE_TABLE_LIKE_STATISTICS = 1 << 5,
+ CREATE_TABLE_LIKE_STORAGE = 1 << 6,
CREATE_TABLE_LIKE_ALL = PG_INT32_MAX
} TableLikeOption;
typedef struct PartitionSpec
{
NodeTag type;
- char *strategy; /* partitioning strategy ('list' or 'range') */
+ char *strategy; /* partitioning strategy ('hash', 'list' or
+ * 'range') */
List *partParams; /* List of PartitionElems */
int location; /* token location, or -1 if unknown */
} PartitionSpec;
/* Internal codes for partitioning strategies */
+#define PARTITION_STRATEGY_HASH 'h'
#define PARTITION_STRATEGY_LIST 'l'
#define PARTITION_STRATEGY_RANGE 'r'
NodeTag type;
char strategy; /* see PARTITION_STRATEGY codes above */
+ bool is_default; /* is it a default partition bound? */
+
+ /* Partitioning info for HASH strategy: */
+ int modulus;
+ int remainder;
/* Partitioning info for LIST strategy: */
List *listdatums; /* List of Consts (or A_Consts in raw tree) */
} PartitionRangeDatum;
/*
- * PartitionCmd - info for ALTER TABLE ATTACH/DETACH PARTITION commands
+ * PartitionCmd - info for ALTER TABLE/INDEX ATTACH/DETACH PARTITION commands
*/
typedef struct PartitionCmd
{
* them from the joinaliasvars list, because that would affect the attnums
* of Vars referencing the rest of the list.)
*
- * inh is TRUE for relation references that should be expanded to include
- * inheritance children, if the rel has any. This *must* be FALSE for
+ * inh is true for relation references that should be expanded to include
+ * inheritance children, if the rel has any. This *must* be false for
* RTEs other than RTE_RELATION entries.
*
* inFromCl marks those range variables that are listed in the FROM clause.
* from the catalogs if 'relid' was supplied, but we'd still need these
* for TupleDesc-based ENRs, so we might as well always store the type
* info here).
+ *
+ * For ENRs only, we have to consider the possibility of dropped columns.
+ * A dropped column is included in these lists, but it will have zeroes in
+ * all three lists (as well as an empty-string entry in eref). Testing
+ * for zero coltype is the standard way to detect a dropped column.
*/
List *coltypes; /* OID list of column type OIDs */
List *coltypmods; /* integer list of column typmods */
* or InvalidOid if not available.
* nulls_first means about what you'd expect. If sortop is InvalidOid
* then nulls_first is meaningless and should be set to false.
- * hashable is TRUE if eqop is hashable (note this condition also depends
+ * hashable is true if eqop is hashable (note this condition also depends
* on the datatype of the input expression).
*
* In an ORDER BY item, all fields must be valid. (The eqop isn't essential
* if the clause originally came from WINDOW, and is NULL if it originally
* was an OVER clause (but note that we collapse out duplicate OVERs).
* partitionClause and orderClause are lists of SortGroupClause structs.
+ * If we have RANGE with offset PRECEDING/FOLLOWING, the semantics of that are
+ * specified by startInRangeFunc/inRangeColl/inRangeAsc/inRangeNullsFirst
+ * for the start offset, or endInRangeFunc/inRange* for the end offset.
* winref is an ID number referenced by WindowFunc nodes; it must be unique
* among the members of a Query's windowClause list.
* When refname isn't null, the partitionClause is always copied from there;
int frameOptions; /* frame_clause options, see WindowDef */
Node *startOffset; /* expression for starting bound, if any */
Node *endOffset; /* expression for ending bound, if any */
+ Oid startInRangeFunc; /* in_range function for startOffset */
+ Oid endInRangeFunc; /* in_range function for endOffset */
+ Oid inRangeColl; /* collation for in_range tests */
+ bool inRangeAsc; /* use ASC sort order for in_range tests? */
+ bool inRangeNullsFirst; /* nulls sort first for in_range tests? */
Index winref; /* ID referenced by window functions */
bool copiedOrder; /* did we copy orderClause from refname? */
} WindowClause;
OBJECT_OPERATOR,
OBJECT_OPFAMILY,
OBJECT_POLICY,
+ OBJECT_PROCEDURE,
OBJECT_PUBLICATION,
OBJECT_PUBLICATION_REL,
OBJECT_ROLE,
+ OBJECT_ROUTINE,
OBJECT_RULE,
OBJECT_SCHEMA,
OBJECT_SEQUENCE,
AT_AddConstraint, /* add constraint */
AT_AddConstraintRecurse, /* internal to commands/tablecmds.c */
AT_ReAddConstraint, /* internal to commands/tablecmds.c */
+ AT_ReAddDomainConstraint, /* internal to commands/tablecmds.c */
AT_AlterConstraint, /* alter constraint */
AT_ValidateConstraint, /* validate constraint */
AT_ValidateConstraintRecurse, /* internal to commands/tablecmds.c */
AlterTableType subtype; /* Type of table alteration to apply */
char *name; /* column, constraint, or trigger to act on,
* or tablespace */
+ int16 num; /* attribute number for columns referenced by
+ * number */
RoleSpec *newowner;
Node *def; /* definition of new column, index,
* constraint, or parent table */
ACL_TARGET_DEFAULTS /* ALTER DEFAULT PRIVILEGES */
} GrantTargetType;
-typedef enum GrantObjectType
-{
- ACL_OBJECT_COLUMN, /* column */
- ACL_OBJECT_RELATION, /* table, view */
- ACL_OBJECT_SEQUENCE, /* sequence */
- ACL_OBJECT_DATABASE, /* database */
- ACL_OBJECT_DOMAIN, /* domain */
- ACL_OBJECT_FDW, /* foreign-data wrapper */
- ACL_OBJECT_FOREIGN_SERVER, /* foreign server */
- ACL_OBJECT_FUNCTION, /* function */
- ACL_OBJECT_LANGUAGE, /* procedural language */
- ACL_OBJECT_LARGEOBJECT, /* largeobject */
- ACL_OBJECT_NAMESPACE, /* namespace */
- ACL_OBJECT_TABLESPACE, /* tablespace */
- ACL_OBJECT_TYPE /* type */
-} GrantObjectType;
-
typedef struct GrantStmt
{
NodeTag type;
bool is_grant; /* true = GRANT, false = REVOKE */
GrantTargetType targtype; /* type of the grant target */
- GrantObjectType objtype; /* kind of object being operated on */
+ ObjectType objtype; /* kind of object being operated on */
List *objects; /* list of RangeVar nodes, ObjectWithArgs
* nodes, or plain names (as Value strings) */
List *privileges; /* list of AccessPriv nodes */
char generated_when;
/* Fields used for unique constraints (UNIQUE and PRIMARY KEY): */
- List *keys; /* String nodes naming referenced column(s) */
+ List *keys; /* String nodes naming referenced key
+ * column(s) */
+ List *including; /* String nodes naming referenced nonkey
+ * column(s) */
/* Fields used for EXCLUSION constraints: */
List *exclusions; /* list of (IndexElem, operator name) pairs */
FetchDirection direction; /* see above */
long howMany; /* number of rows, or position argument */
char *portalname; /* name of portal (cursor) */
- bool ismove; /* TRUE if MOVE */
+ bool ismove; /* true if MOVE */
} FetchStmt;
/* ----------------------
* index, just a UNIQUE/PKEY constraint using an existing index. isconstraint
* must always be true in this case, and the fields describing the index
* properties are empty.
+ *
+ * The relation to build the index on can be represented either by name
+ * (in which case the RangeVar indicates whether to recurse or not) or by OID
+ * (in which case the command is always recursive).
* ----------------------
*/
typedef struct IndexStmt
NodeTag type;
char *idxname; /* name of new index, or NULL for default */
RangeVar *relation; /* relation to build index on */
+ Oid relationId; /* OID of relation to build index on */
char *accessMethod; /* name of access method (eg. btree) */
char *tableSpace; /* tablespace, or NULL for default */
List *indexParams; /* columns to index: a list of IndexElem */
+ List *indexIncludingParams; /* additional columns to index: a list
+ * of IndexElem */
List *options; /* WITH clause options: a list of DefElem */
Node *whereClause; /* qualification (partial-index predicate) */
List *excludeOpNames; /* exclusion operator names, or NIL if none */
List *stat_types; /* stat types (list of Value strings) */
List *exprs; /* expressions to build statistics on */
List *relations; /* rels to build stats on (list of RangeVar) */
+ char *stxcomment; /* comment to apply to stats, or NULL */
bool if_not_exists; /* do nothing if stats name already exists */
} CreateStatsStmt;
typedef struct CreateFunctionStmt
{
NodeTag type;
+ bool is_procedure; /* it's really CREATE PROCEDURE */
bool replace; /* T => replace if already exists */
List *funcname; /* qualified name of function to create */
List *parameters; /* a list of FunctionParameter */
TypeName *returnType; /* the return type */
List *options; /* a list of DefElem */
- List *withClause; /* a list of DefElem */
} CreateFunctionStmt;
typedef enum FunctionParameterMode
typedef struct AlterFunctionStmt
{
NodeTag type;
+ ObjectType objtype;
ObjectWithArgs *func; /* name and args of function */
List *actions; /* list of DefElem */
} AlterFunctionStmt;
char *source_text; /* source text of anonymous code block */
Oid langOid; /* OID of selected language */
bool langIsTrusted; /* trusted property of the language */
+ bool atomic; /* atomic execution context */
} InlineCodeBlock;
+/* ----------------------
+ * CALL statement
+ * ----------------------
+ */
+typedef struct CallStmt
+{
+ NodeTag type;
+ FuncCall *funccall; /* from the parser */
+ FuncExpr *funcexpr; /* transformed */
+} CallStmt;
+
+typedef struct CallContext
+{
+ NodeTag type;
+ bool atomic;
+} CallContext;
+
/* ----------------------
* Alter Object Rename Statement
* ----------------------
{
NodeTag type;
TransactionStmtKind kind; /* see above */
- List *options; /* for BEGIN/START and savepoint commands */
+ List *options; /* for BEGIN/START commands */
+ char *savepoint_name; /* for savepoint commands */
char *gid; /* for two-phase-commit related commands */
} TransactionStmt;
VACOPT_DISABLE_PAGE_SKIPPING = 1 << 7 /* don't skip any pages */
} VacuumOption;
+/*
+ * Info about a single target table of VACUUM/ANALYZE.
+ *
+ * If the OID field is set, it always identifies the table to process.
+ * Then the relation field can be NULL; if it isn't, it's used only to report
+ * failure to open/lock the relation.
+ */
+typedef struct VacuumRelation
+{
+ NodeTag type;
+ RangeVar *relation; /* table name to process, or NULL */
+ Oid oid; /* table's OID; InvalidOid if not looked up */
+ List *va_cols; /* list of column names, or NIL for all */
+} VacuumRelation;
+
typedef struct VacuumStmt
{
NodeTag type;
int options; /* OR of VacuumOption flags */
- RangeVar *relation; /* single table to process, or NULL */
- List *va_cols; /* list of column names, or NIL for all */
+ List *rels; /* list of VacuumRelation, or NIL for all */
} VacuumStmt;
/* ----------------------
typedef struct CreatePublicationStmt
{
NodeTag type;
- char *pubname; /* Name of of the publication */
+ char *pubname; /* Name of the publication */
List *options; /* List of DefElem nodes */
List *tables; /* Optional list of tables to add */
bool for_all_tables; /* Special publication for all tables in db */
typedef struct AlterPublicationStmt
{
NodeTag type;
- char *pubname; /* Name of of the publication */
+ char *pubname; /* Name of the publication */
/* parameters used for ALTER PUBLICATION ... WITH */
List *options; /* List of DefElem nodes */
typedef struct CreateSubscriptionStmt
{
NodeTag type;
- char *subname; /* Name of of the subscription */
+ char *subname; /* Name of the subscription */
char *conninfo; /* Connection string to publisher */
List *publication; /* One or more publication to subscribe to */
List *options; /* List of DefElem nodes */
{
NodeTag type;
AlterSubscriptionType kind; /* ALTER_SUBSCRIPTION_OPTIONS, etc */
- char *subname; /* Name of of the subscription */
+ char *subname; /* Name of the subscription */
char *conninfo; /* Connection string to publisher */
List *publication; /* One or more publication to subscribe to */
List *options; /* List of DefElem nodes */
typedef struct DropSubscriptionStmt
{
NodeTag type;
- char *subname; /* Name of of the subscription */
+ char *subname; /* Name of the subscription */
bool missing_ok; /* Skip error if missing? */
DropBehavior behavior; /* RESTRICT or CASCADE behavior */
} DropSubscriptionStmt;
*
* This is the external API for the raw lexing/parsing functions.
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parser.h
extern bool escape_string_warning;
extern PGDLLIMPORT bool standard_conforming_strings;
-
/* Primary entry point for the raw parsing functions */
extern List *raw_parser(const char *str, bool *error);
extern Node *raw_parser2(List *parse_tree_list);
+/* from src/backend/commands/define.c */
+extern int32 defGetInt32(DefElem *def);
+
/* Utility functions exported by gram.y (perhaps these should be elsewhere) */
extern List *SystemFuncName(char *name);
extern TypeName *SystemTypeName(char *name);
/*-------------------------------------------------------------------------
*
* pg_class.h
- * definition of the system "relation" relation (pg_class)
- * along with the relation's initial contents.
+ * definition of the "relation" system catalog (pg_class)
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_class.h
*
* NOTES
- * the genbki.pl script reads this file and generates .bki
- * information from the DATA() statements.
+ * The Catalog.pm module reads this file and derives schema
+ * information.
*
*-------------------------------------------------------------------------
*/
#if 0 /* NOT_USED_IN_PGPOOL */
#include "catalog/genbki.h"
+#include "catalog/pg_class_d.h"
/* ----------------
* pg_class definition. cpp turns this into
* typedef struct FormData_pg_class
* ----------------
*/
-#define RelationRelationId 1259
-#define RelationRelation_Rowtype_Id 83
-
-CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83) BKI_SCHEMA_MACRO
+CATALOG(pg_class,1259,RelationRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83,RelationRelation_Rowtype_Id) BKI_SCHEMA_MACRO
{
NameData relname; /* class name */
Oid relnamespace; /* OID of namespace containing this class */
*/
int16 relchecks; /* # of CHECK constraints for class */
bool relhasoids; /* T if we generate OIDs for rows of rel */
- bool relhaspkey; /* has (or has had) PRIMARY KEY index */
bool relhasrules; /* has (or has had) any rules */
bool relhastriggers; /* has (or has had) any TRIGGERs */
bool relhassubclass; /* has (or has had) derived classes */
bool relispopulated; /* matview currently holds query results */
char relreplident; /* see REPLICA_IDENTITY_xxx constants */
bool relispartition; /* is relation a partition? */
+ Oid relrewrite; /* heap for rewrite during DDL, link to
+ * original rel */
TransactionId relfrozenxid; /* all Xids < this are frozen in this rel */
TransactionId relminmxid; /* all multixacts in this rel are >= this.
* this is really a MultiXactId */
*/
typedef FormData_pg_class *Form_pg_class;
-/* ----------------
- * compiler constants for pg_class
- * ----------------
- */
-
-#define Natts_pg_class 33
-#define Anum_pg_class_relname 1
-#define Anum_pg_class_relnamespace 2
-#define Anum_pg_class_reltype 3
-#define Anum_pg_class_reloftype 4
-#define Anum_pg_class_relowner 5
-#define Anum_pg_class_relam 6
-#define Anum_pg_class_relfilenode 7
-#define Anum_pg_class_reltablespace 8
-#define Anum_pg_class_relpages 9
-#define Anum_pg_class_reltuples 10
-#define Anum_pg_class_relallvisible 11
-#define Anum_pg_class_reltoastrelid 12
-#define Anum_pg_class_relhasindex 13
-#define Anum_pg_class_relisshared 14
-#define Anum_pg_class_relpersistence 15
-#define Anum_pg_class_relkind 16
-#define Anum_pg_class_relnatts 17
-#define Anum_pg_class_relchecks 18
-edefine Anum_pg_class_relhasoids 19
-#define Anum_pg_class_relhaspkey 20
-#define Anum_pg_class_relhasrules 21
-#define Anum_pg_class_relhastriggers 22
-#define Anum_pg_class_relhassubclass 23
-#define Anum_pg_class_relrowsecurity 24
-#define Anum_pg_class_relforcerowsecurity 25
-#define Anum_pg_class_relispopulated 26
-#define Anum_pg_class_relreplident 27
-#define Anum_pg_class_relispartition 28
-#define Anum_pg_class_relfrozenxid 29
-#define Anum_pg_class_relminmxid 30
-#define Anum_pg_class_relacl 31
-#define Anum_pg_class_reloptions 32
-#define Anum_pg_class_relpartbound 33
-
-/* ----------------
- * initial contents of pg_class
- *
- * NOTE: only "bootstrapped" relations need to be declared here. Be sure that
- * the OIDs listed here match those given in their CATALOG macros, and that
- * the relnatts values are correct.
- * ----------------
- */
-
-/*
- * Note: "3" in the relfrozenxid column stands for FirstNormalTransactionId;
- * similarly, "1" in relminmxid stands for FirstMultiXactId
- */
- DATA(insert OID = 1247(pg_type PGNSP 71 0 PGUID 0 0 0 0 0 0 0 f f p r 30 0 t f f f f f f t n f 3 1 _null_ _null_ _null_));
-
-DESCR("");
-DATA(insert OID = 1249(pg_attribute PGNSP 75 0 PGUID 0 0 0 0 0 0 0 f f p r 22 0 f f f f f f f t n f 3 1 _null_ _null_ _null_));
-DESCR("");
-DATA(insert OID = 1255(pg_proc PGNSP 81 0 PGUID 0 0 0 0 0 0 0 f f p r 29 0 t f f f f f f t n f 3 1 _null_ _null_ _null_));
-DESCR("");
-DATA(insert OID = 1259(pg_class PGNSP 83 0 PGUID 0 0 0 0 0 0 0 f f p r 33 0 t f f f f f f t n f 3 1 _null_ _null_ _null_));
-DESCR("");
-
#define RELKIND_RELATION 'r' /* ordinary table */
#define RELKIND_INDEX 'i' /* secondary index */
#define RELKIND_COMPOSITE_TYPE 'c' /* composite type */
#define RELKIND_FOREIGN_TABLE 'f' /* foreign table */
#define RELKIND_PARTITIONED_TABLE 'p' /* partitioned table */
+#define RELKIND_PARTITIONED_INDEX 'I' /* partitioned index */
#endif /* NOT_USED_IN_PGPOOL */
* for developers. If you edit any of these, be sure to do a *full*
* rebuild (and an initdb if noted).
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/pg_config_manual.h
#define pg_attribute_format_arg(a)
#define pg_attribute_printf(f,a)
#endif
+/*
+ * This is default value for wal_segment_size to be used at initdb when run
+ * without --walsegsize option. Must be a valid segment size.
+ */
+#define DEFAULT_XLOG_SEG_SIZE (16*1024*1024)
+
/*
* Maximum length for identifiers (e.g. table names, column names,
* function names). Names actually are limited to one less byte than this,
*/
#define NUM_ATOMICS_SEMAPHORES 64
-/*
- * Define this if you want to allow the lo_import and lo_export SQL
- * functions to be executed by ordinary users. By default these
- * functions are only available to the Postgres superuser. CAUTION:
- * These functions are SECURITY HOLES since they can read and write
- * any file that the PostgreSQL server has permission to access. If
- * you turn this on, don't say we didn't warn you.
- */
-/* #define ALLOW_DANGEROUS_LO_FUNCTIONS */
-
/*
* MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
* maximum usable pathname length is one less).
* always be so; try to be careful to maintain the distinction.)
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/pg_list.h
extern List *list_copy(const List *list);
extern List *list_copy_tail(const List *list, int nskip);
+typedef int (*list_qsort_comparator) (const void *a, const void *b);
+extern List *list_qsort(const List *list, list_qsort_comparator cmp);
+
/*
* To ease migration to the new list API, a set of compatibility
* macros are provided that reduce the impact of the list API changes
/*-------------------------------------------------------------------------
*
* pg_trigger.h
- * definition of the system "trigger" relation (pg_trigger)
- * along with the relation's initial contents.
+ * definition of the "trigger" system catalog (pg_trigger)
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_trigger.h
*
* NOTES
- * the genbki.pl script reads this file and generates .bki
- * information from the DATA() statements.
+ * The Catalog.pm module reads this file and derives schema
+ * information.
*
*-------------------------------------------------------------------------
*/
#if 0
#include "catalog/genbki.h"
+#include "catalog/pg_trigger_d.h"
/* ----------------
* pg_trigger definition. cpp turns this into
* to be associated with a deferrable constraint.
* ----------------
*/
-#define TriggerRelationId 2620
-
-CATALOG(pg_trigger,2620)
+CATALOG(pg_trigger,2620,TriggerRelationId)
{
Oid tgrelid; /* relation trigger is attached to */
NameData tgname; /* trigger's name */
typedef FormData_pg_trigger *Form_pg_trigger;
#endif
-/* ----------------
- * compiler constants for pg_trigger
- * ----------------
- */
-#define Natts_pg_trigger 17
-#define Anum_pg_trigger_tgrelid 1
-#define Anum_pg_trigger_tgname 2
-#define Anum_pg_trigger_tgfoid 3
-#define Anum_pg_trigger_tgtype 4
-#define Anum_pg_trigger_tgenabled 5
-#define Anum_pg_trigger_tgisinternal 6
-#define Anum_pg_trigger_tgconstrrelid 7
-#define Anum_pg_trigger_tgconstrindid 8
-#define Anum_pg_trigger_tgconstraint 9
-#define Anum_pg_trigger_tgdeferrable 10
-#define Anum_pg_trigger_tginitdeferred 11
-#define Anum_pg_trigger_tgnargs 12
-#define Anum_pg_trigger_tgattr 13
-#define Anum_pg_trigger_tgargs 14
-#define Anum_pg_trigger_tgqual 15
-#define Anum_pg_trigger_tgoldtable 16
-#define Anum_pg_trigger_tgnewtable 17
+#define EXPOSE_TO_CLIENT_CODE
+#ifdef EXPOSE_TO_CLIENT_CODE
/* Bits within tgtype */
#define TRIGGER_TYPE_ROW (1 << 0)
#define TRIGGER_USES_TRANSITION_TABLE(namepointer) \
((namepointer) != (char *) NULL)
+#endif /* EXPOSE_TO_CLIENT_CODE */
+
#endif /* PG_TRIGGER_H */
* pg_wchar.h
* multibyte-character support
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/mb/pg_wchar.h
/* On FE are possible all encodings */
#define PG_VALID_FE_ENCODING(_enc) PG_VALID_ENCODING(_enc)
+/*
+ * When converting strings between different encodings, we assume that space
+ * for converted result is 4-to-1 growth in the worst case. The rate for
+ * currently supported encoding pairs are within 3 (SJIS JIS X0201 half width
+ * kanna -> UTF8 is the worst case). So "4" should be enough for the moment.
+ *
+ * Note that this is not the same as the maximum character width in any
+ * particular encoding.
+ */
+#define MAX_CONVERSION_GROWTH 4
+
/*
* Table for mapping an encoding number to official encoding name and
* possibly other subsidiary data. Be careful to check encoding number
* points to a lookup table for the second byte. And so on.
*
* Physically, all the trees are stored in one big array, in 'chars16' or
- * 'chars32', depending on the maximum value that needs to be reprented. For
+ * 'chars32', depending on the maximum value that needs to be represented. For
* each level in each tree, we also store lower and upper bound of allowed
* values - values outside those bounds are considered invalid, and are left
* out of the tables.
* Currently, these are mostly nodes for executable expressions
* and join trees.
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group *
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group *
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/primnodes.h
Index varno; /* index of this var's relation in the range
* table, or INNER_VAR/OUTER_VAR/INDEX_VAR */
AttrNumber varattno; /* attribute number of this var, or zero for
- * all */
+ * all attrs ("whole-row Var") */
Oid vartype; /* pg_type OID for the type of this var */
int32 vartypmod; /* pg_attribute typmod value */
Oid varcollid; /* OID of collation, or InvalidOid if none */
List *aggorder; /* ORDER BY (list of SortGroupClause) */
List *aggdistinct; /* DISTINCT (list of SortGroupClause) */
Expr *aggfilter; /* FILTER expression, if any */
- bool aggstar; /* TRUE if argument list was really '*' */
+ bool aggstar; /* true if argument list was really '*' */
bool aggvariadic; /* true if variadic arguments have been
* combined into an array last argument */
char aggkind; /* aggregate kind (see pg_aggregate.h) */
List *args; /* arguments to the window function */
Expr *aggfilter; /* FILTER expression, if any */
Index winref; /* index of associated WindowClause */
- bool winstar; /* TRUE if argument list was really '*' */
+ bool winstar; /* true if argument list was really '*' */
bool winagg; /* is function a simple aggregate? */
int location; /* token location, or -1 if unknown */
} WindowFunc;
Oid firstColCollation; /* Collation of first column of subplan
* result */
/* Information about execution strategy: */
- bool useHashTable; /* TRUE to store subselect output in a hash
+ bool useHashTable; /* true to store subselect output in a hash
* table (implies we are doing "IN") */
- bool unknownEqFalse; /* TRUE if it's okay to return FALSE when the
+ bool unknownEqFalse; /* true if it's okay to return FALSE when the
* spec result is UNKNOWN; this allows much
* simpler handling of null values */
bool parallel_safe; /* is the subplan parallel-safe? */
* the assign case of ArrayRef, this is used to implement UPDATE of a
* portion of a column.
*
+ * resulttype is always a named composite type (not a domain). To update
+ * a composite domain value, apply CoerceToDomain to the FieldStore.
+ *
* A single FieldStore can actually represent updates of several different
* fields. The parser only generates FieldStores with single-element lists,
* but the planner will collapse multiple updates of the same base column
* ArrayCoerceExpr
*
* ArrayCoerceExpr represents a type coercion from one array type to another,
- * which is implemented by applying the indicated element-type coercion
- * function to each element of the source array. If elemfuncid is InvalidOid
- * then the element types are binary-compatible, but the coercion still
- * requires some effort (we have to fix the element type ID stored in the
- * array header).
+ * which is implemented by applying the per-element coercion expression
+ * "elemexpr" to each element of the source array. Within elemexpr, the
+ * source element is represented by a CaseTestExpr node. Note that even if
+ * elemexpr is a no-op (that is, just CaseTestExpr + RelabelType), the
+ * coercion still requires some effort: we have to fix the element type OID
+ * stored in the array header.
* ----------------
*/
{
Expr xpr;
Expr *arg; /* input expression (yields an array) */
- Oid elemfuncid; /* OID of element coercion function, or 0 */
+ Expr *elemexpr; /* expression representing per-element work */
Oid resulttype; /* output type of coercion (an array type) */
int32 resulttypmod; /* output typmod (also element typmod) */
Oid resultcollid; /* OID of collation, or InvalidOid if none */
- bool isExplicit; /* conversion semantics flag to pass to func */
CoercionForm coerceformat; /* how to display this node */
int location; /* token location, or -1 if unknown */
} ArrayCoerceExpr;
* needed for the destination type plus possibly others; the columns need not
* be in the same positions, but are matched up by name. This is primarily
* used to convert a whole-row value of an inheritance child table into a
- * valid whole-row value of its parent table's rowtype.
+ * valid whole-row value of its parent table's rowtype. Both resulttype
+ * and the exposed type of "arg" must be named composite types (not domains).
* ----------------
*/
Oid row_typeid; /* RECORDOID or a composite type's ID */
/*
+ * row_typeid cannot be a domain over composite, only plain composite. To
+ * create a composite domain value, apply CoerceToDomain to the RowExpr.
+ *
* Note: we deliberately do NOT store a typmod. Although a typmod will be
* associated with specific RECORD types at runtime, it will differ for
* different backends, and so cannot safely be stored in stored
* higher-level API provided by parser.h.
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/scanner.h
* scanner support routines. used by both the bootstrap lexer
* as well as the normal lexer
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/scansup.h
* It can be used to buffer either ordinary C strings (null-terminated text)
* or arbitrary binary data. All storage is allocated with palloc().
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/lib/stringinfo.h
extern void appendBinaryStringInfo(StringInfo str,
const char *data, int datalen);
+/*------------------------
+ * appendBinaryStringInfoNT
+ * Append arbitrary binary data to a StringInfo, allocating more space
+ * if necessary. Does not ensure a trailing null-byte exists.
+ */
+extern void appendBinaryStringInfoNT(StringInfo str,
+ const char *data, int datalen);
+
/*------------------------
* enlargeStringInfo
* Make sure a StringInfo's buffer can hold at least 'needed' more bytes.
* interface for Value nodes
*
*
- * Copyright (c) 2003-2017, PgPool Global Development Group
- * Copyright (c) 2003-2017, PostgreSQL Global Development Group
+ * Copyright (c) 2003-2018, PgPool Global Development Group
+ * Copyright (c) 2003-2018, PostgreSQL Global Development Group
*
* src/include/nodes/value.h
*
* better to use the more general representation.)
*
* Note that an integer-looking string will get lexed as T_Float if
- * the value is too large to fit in a 'long'.
+ * the value is too large to fit in an 'int'.
*
* Nulls, of course, don't need the value part at all.
*----------------------
NodeTag type; /* tag appropriately (eg. T_String) */
union ValUnion
{
- long ival; /* machine integer */
+ int ival; /* machine integer */
char *str; /* string */
} val;
} Value;
#define floatVal(v) atof(((Value *)(v))->val.str)
#define strVal(v) (((Value *)(v))->val.str)
-extern Value *makeInteger(long i);
+extern Value *makeInteger(int i);
extern Value *makeFloat(char *numericStr);
extern Value *makeString(char *str);
extern Value *makeBitString(char *str);
* be handled easily in a simple depth-first traversal.
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
COPY_SCALAR_FIELD(transientPlan);
COPY_SCALAR_FIELD(dependsOnRole);
COPY_SCALAR_FIELD(parallelModeNeeded);
+ COPY_SCALAR_FIELD(jitFlags);
COPY_NODE_FIELD(planTree);
COPY_NODE_FIELD(rtable);
COPY_NODE_FIELD(resultRelations);
COPY_NODE_FIELD(rowMarks);
COPY_NODE_FIELD(relationOids);
COPY_NODE_FIELD(invalItems);
- COPY_SCALAR_FIELD(nParamExec);
+ COPY_NODE_FIELD(paramExecTypes);
COPY_NODE_FIELD(utilityStmt);
COPY_LOCATION_FIELD(stmt_location);
COPY_LOCATION_FIELD(stmt_len);
COPY_SCALAR_FIELD(canSetTag);
COPY_SCALAR_FIELD(nominalRelation);
COPY_NODE_FIELD(partitioned_rels);
+ COPY_SCALAR_FIELD(partColsUpdated);
COPY_NODE_FIELD(resultRelations);
COPY_SCALAR_FIELD(resultRelIndex);
COPY_SCALAR_FIELD(rootResultRelIndex);
/*
* copy remainder of node
*/
- COPY_NODE_FIELD(partitioned_rels);
COPY_NODE_FIELD(appendplans);
+ COPY_SCALAR_FIELD(first_partial_plan);
+ COPY_NODE_FIELD(partitioned_rels);
+ COPY_NODE_FIELD(part_prune_info);
return newnode;
}
COPY_SCALAR_FIELD(rescan_param);
COPY_SCALAR_FIELD(single_copy);
COPY_SCALAR_FIELD(invisible);
+ COPY_BITMAPSET_FIELD(initParam);
return newnode;
}
COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+ COPY_BITMAPSET_FIELD(initParam);
return newnode;
}
COPY_SCALAR_FIELD(frameOptions);
COPY_NODE_FIELD(startOffset);
COPY_NODE_FIELD(endOffset);
+ COPY_SCALAR_FIELD(startInRangeFunc);
+ COPY_SCALAR_FIELD(endInRangeFunc);
+ COPY_SCALAR_FIELD(inRangeColl);
+ COPY_SCALAR_FIELD(inRangeAsc);
+ COPY_SCALAR_FIELD(inRangeNullsFirst);
return newnode;
}
COPY_SCALAR_FIELD(skewTable);
COPY_SCALAR_FIELD(skewColumn);
COPY_SCALAR_FIELD(skewInherit);
+ COPY_SCALAR_FIELD(rows_total);
return newnode;
}
return newnode;
}
+static PartitionPruneInfo *
+_copyPartitionPruneInfo(const PartitionPruneInfo *from)
+{
+ PartitionPruneInfo *newnode = makeNode(PartitionPruneInfo);
+
+ COPY_NODE_FIELD(prune_infos);
+ COPY_BITMAPSET_FIELD(other_subplans);
+
+ return newnode;
+}
+
+static PartitionedRelPruneInfo *
+_copyPartitionedRelPruneInfo(const PartitionedRelPruneInfo *from)
+{
+ PartitionedRelPruneInfo *newnode = makeNode(PartitionedRelPruneInfo);
+
+ COPY_SCALAR_FIELD(reloid);
+ COPY_NODE_FIELD(pruning_steps);
+ COPY_BITMAPSET_FIELD(present_parts);
+ COPY_SCALAR_FIELD(nparts);
+ COPY_SCALAR_FIELD(nexprs);
+ COPY_POINTER_FIELD(subplan_map, from->nparts * sizeof(int));
+ COPY_POINTER_FIELD(subpart_map, from->nparts * sizeof(int));
+ COPY_POINTER_FIELD(hasexecparam, from->nexprs * sizeof(bool));
+ COPY_SCALAR_FIELD(do_initial_prune);
+ COPY_SCALAR_FIELD(do_exec_prune);
+ COPY_BITMAPSET_FIELD(execparamids);
+
+ return newnode;
+}
+
+/*
+ * _copyPartitionPruneStepOp
+ */
+static PartitionPruneStepOp *
+_copyPartitionPruneStepOp(const PartitionPruneStepOp *from)
+{
+ PartitionPruneStepOp *newnode = makeNode(PartitionPruneStepOp);
+
+ COPY_SCALAR_FIELD(step.step_id);
+ COPY_SCALAR_FIELD(opstrategy);
+ COPY_NODE_FIELD(exprs);
+ COPY_NODE_FIELD(cmpfns);
+ COPY_BITMAPSET_FIELD(nullkeys);
+
+ return newnode;
+}
+
+/*
+ * _copyPartitionPruneStepCombine
+ */
+static PartitionPruneStepCombine *
+_copyPartitionPruneStepCombine(const PartitionPruneStepCombine *from)
+{
+ PartitionPruneStepCombine *newnode = makeNode(PartitionPruneStepCombine);
+
+ COPY_SCALAR_FIELD(step.step_id);
+ COPY_SCALAR_FIELD(combineOp);
+ COPY_NODE_FIELD(source_stepids);
+
+ return newnode;
+}
+
/*
* _copyPlanInvalItem
*/
ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(elemfuncid);
+ COPY_NODE_FIELD(elemexpr);
COPY_SCALAR_FIELD(resulttype);
COPY_SCALAR_FIELD(resulttypmod);
COPY_SCALAR_FIELD(resultcollid);
- COPY_SCALAR_FIELD(isExplicit);
COPY_SCALAR_FIELD(coerceformat);
COPY_LOCATION_FIELD(location);
COPY_SCALAR_FIELD(hashjoinoperator);
COPY_SCALAR_FIELD(left_bucketsize);
COPY_SCALAR_FIELD(right_bucketsize);
+ COPY_SCALAR_FIELD(left_mcvfreq);
+ COPY_SCALAR_FIELD(right_mcvfreq);
return newnode;
}
return newnode;
}
-/*
- * _copyPartitionedChildRelInfo
- */
-static PartitionedChildRelInfo *
-_copyPartitionedChildRelInfo(const PartitionedChildRelInfo * from)
-{
- PartitionedChildRelInfo *newnode = makeNode(PartitionedChildRelInfo);
-
- COPY_SCALAR_FIELD(parent_relid);
- COPY_NODE_FIELD(child_rels);
-
- return newnode;
-}
-
/*
* _copyPlaceHolderInfo
*/
COPY_SCALAR_FIELD(frameOptions);
COPY_NODE_FIELD(startOffset);
COPY_NODE_FIELD(endOffset);
+ COPY_SCALAR_FIELD(startInRangeFunc);
+ COPY_SCALAR_FIELD(endInRangeFunc);
+ COPY_SCALAR_FIELD(inRangeColl);
+ COPY_SCALAR_FIELD(inRangeAsc);
+ COPY_SCALAR_FIELD(inRangeNullsFirst);
COPY_SCALAR_FIELD(winref);
COPY_SCALAR_FIELD(copiedOrder);
COPY_NODE_FIELD(raw_default);
COPY_NODE_FIELD(cooked_default);
COPY_SCALAR_FIELD(identity);
+ COPY_NODE_FIELD(identitySequence);
COPY_NODE_FIELD(collClause);
COPY_SCALAR_FIELD(collOid);
COPY_NODE_FIELD(constraints);
COPY_STRING_FIELD(cooked_expr);
COPY_SCALAR_FIELD(generated_when);
COPY_NODE_FIELD(keys);
+ COPY_NODE_FIELD(including);
COPY_NODE_FIELD(exclusions);
COPY_NODE_FIELD(options);
COPY_STRING_FIELD(indexname);
COPY_SCALAR_FIELD(subtype);
COPY_STRING_FIELD(name);
+ COPY_SCALAR_FIELD(num);
COPY_NODE_FIELD(newowner);
COPY_NODE_FIELD(def);
COPY_SCALAR_FIELD(behavior);
return newnode;
}
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+ CallStmt *newnode = makeNode(CallStmt);
+
+ COPY_NODE_FIELD(funccall);
+ COPY_NODE_FIELD(funcexpr);
+
+ return newnode;
+}
+
static ClusterStmt *
_copyClusterStmt(const ClusterStmt *from)
{
COPY_STRING_FIELD(idxname);
COPY_NODE_FIELD(relation);
+ COPY_SCALAR_FIELD(relationId);
COPY_STRING_FIELD(accessMethod);
COPY_STRING_FIELD(tableSpace);
COPY_NODE_FIELD(indexParams);
+ COPY_NODE_FIELD(indexIncludingParams);
COPY_NODE_FIELD(options);
COPY_NODE_FIELD(whereClause);
COPY_NODE_FIELD(excludeOpNames);
COPY_NODE_FIELD(stat_types);
COPY_NODE_FIELD(exprs);
COPY_NODE_FIELD(relations);
+ COPY_STRING_FIELD(stxcomment);
COPY_SCALAR_FIELD(if_not_exists);
return newnode;
{
CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+ COPY_SCALAR_FIELD(is_procedure);
COPY_SCALAR_FIELD(replace);
COPY_NODE_FIELD(funcname);
COPY_NODE_FIELD(parameters);
COPY_NODE_FIELD(returnType);
COPY_NODE_FIELD(options);
- COPY_NODE_FIELD(withClause);
return newnode;
}
{
AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+ COPY_SCALAR_FIELD(objtype);
COPY_NODE_FIELD(func);
COPY_NODE_FIELD(actions);
COPY_SCALAR_FIELD(kind);
COPY_NODE_FIELD(options);
+ COPY_STRING_FIELD(savepoint_name);
COPY_STRING_FIELD(gid);
return newnode;
VacuumStmt *newnode = makeNode(VacuumStmt);
COPY_SCALAR_FIELD(options);
+ COPY_NODE_FIELD(rels);
+
+ return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+ VacuumRelation *newnode = makeNode(VacuumRelation);
+
COPY_NODE_FIELD(relation);
+ COPY_SCALAR_FIELD(oid);
COPY_NODE_FIELD(va_cols);
return newnode;
PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
COPY_SCALAR_FIELD(strategy);
+ COPY_SCALAR_FIELD(is_default);
+ COPY_SCALAR_FIELD(modulus);
+ COPY_SCALAR_FIELD(remainder);
COPY_NODE_FIELD(listdatums);
COPY_NODE_FIELD(lowerdatums);
COPY_NODE_FIELD(upperdatums);
case T_PlanRowMark:
retval = _copyPlanRowMark(from);
break;
+ case T_PartitionPruneInfo:
+ retval = _copyPartitionPruneInfo(from);
+ break;
+ case T_PartitionedRelPruneInfo:
+ retval = _copyPartitionedRelPruneInfo(from);
+ break;
+ case T_PartitionPruneStepOp:
+ retval = _copyPartitionPruneStepOp(from);
+ break;
+ case T_PartitionPruneStepCombine:
+ retval = _copyPartitionPruneStepCombine(from);
+ break;
case T_PlanInvalItem:
retval = _copyPlanInvalItem(from);
break;
case T_AppendRelInfo:
retval = _copyAppendRelInfo(from);
break;
- case T_PartitionedChildRelInfo:
- retval = _copyPartitionedChildRelInfo(from);
- break;
case T_PlaceHolderInfo:
retval = _copyPlaceHolderInfo(from);
break;
case T_ClosePortalStmt:
retval = _copyClosePortalStmt(from);
break;
+ case T_CallStmt:
+ retval = _copyCallStmt(from);
+ break;
case T_ClusterStmt:
retval = _copyClusterStmt(from);
break;
case T_VacuumStmt:
retval = _copyVacuumStmt(from);
break;
+ case T_VacuumRelation:
+ retval = _copyVacuumRelation(from);
+ break;
case T_ExplainStmt:
retval = _copyExplainStmt(from);
break;
BOTH = 307,
BY = 308,
CACHE = 309,
- CALLED = 310,
- CASCADE = 311,
- CASCADED = 312,
- CASE = 313,
- CAST = 314,
- CATALOG_P = 315,
- CHAIN = 316,
- CHAR_P = 317,
- CHARACTER = 318,
- CHARACTERISTICS = 319,
- CHECK = 320,
- CHECKPOINT = 321,
- CLASS = 322,
- CLOSE = 323,
- CLUSTER = 324,
- COALESCE = 325,
- COLLATE = 326,
- COLLATION = 327,
- COLUMN = 328,
- COLUMNS = 329,
- COMMENT = 330,
- COMMENTS = 331,
- COMMIT = 332,
- COMMITTED = 333,
- CONCURRENTLY = 334,
- CONFIGURATION = 335,
- CONFLICT = 336,
- CONNECTION = 337,
- CONSTRAINT = 338,
- CONSTRAINTS = 339,
- CONTENT_P = 340,
- CONTINUE_P = 341,
- CONVERSION_P = 342,
- COPY = 343,
- COST = 344,
- CREATE = 345,
- CROSS = 346,
- CSV = 347,
- CUBE = 348,
- CURRENT_P = 349,
- CURRENT_CATALOG = 350,
- CURRENT_DATE = 351,
- CURRENT_ROLE = 352,
- CURRENT_SCHEMA = 353,
- CURRENT_TIME = 354,
- CURRENT_TIMESTAMP = 355,
- CURRENT_USER = 356,
- CURSOR = 357,
- CYCLE = 358,
- DATA_P = 359,
- DATABASE = 360,
- DAY_P = 361,
- DEALLOCATE = 362,
- DEC = 363,
- DECIMAL_P = 364,
- DECLARE = 365,
- DEFAULT = 366,
- DEFAULTS = 367,
- DEFERRABLE = 368,
- DEFERRED = 369,
- DEFINER = 370,
- DELETE_P = 371,
- DELIMITER = 372,
- DELIMITERS = 373,
- DEPENDS = 374,
- DESC = 375,
- DETACH = 376,
- DICTIONARY = 377,
- DISABLE_P = 378,
- DISCARD = 379,
- DISTINCT = 380,
- DO = 381,
- DOCUMENT_P = 382,
- DOMAIN_P = 383,
- DOUBLE_P = 384,
- DROP = 385,
- EACH = 386,
- ELSE = 387,
- ENABLE_P = 388,
- ENCODING = 389,
- ENCRYPTED = 390,
- END_P = 391,
- ENUM_P = 392,
- ESCAPE = 393,
- EVENT = 394,
- EXCEPT = 395,
- EXCLUDE = 396,
- EXCLUDING = 397,
- EXCLUSIVE = 398,
- EXECUTE = 399,
- EXISTS = 400,
- EXPLAIN = 401,
- EXTENSION = 402,
- EXTERNAL = 403,
- EXTRACT = 404,
- FALSE_P = 405,
- FAMILY = 406,
- FETCH = 407,
- FILTER = 408,
- FIRST_P = 409,
- FLOAT_P = 410,
- FOLLOWING = 411,
- FOR = 412,
- FORCE = 413,
- FOREIGN = 414,
- FORWARD = 415,
- FREEZE = 416,
- FROM = 417,
- FULL = 418,
- FUNCTION = 419,
- FUNCTIONS = 420,
- GENERATED = 421,
- GLOBAL = 422,
- GRANT = 423,
- GRANTED = 424,
- GREATEST = 425,
- GROUP_P = 426,
- GROUPING = 427,
- HANDLER = 428,
- HAVING = 429,
- HEADER_P = 430,
- HOLD = 431,
- HOUR_P = 432,
- IDENTITY_P = 433,
- IF_P = 434,
- ILIKE = 435,
- IMMEDIATE = 436,
- IMMUTABLE = 437,
- IMPLICIT_P = 438,
- IMPORT_P = 439,
- IN_P = 440,
- INCLUDING = 441,
- INCREMENT = 442,
- INDEX = 443,
- INDEXES = 444,
- INHERIT = 445,
- INHERITS = 446,
- INITIALLY = 447,
- INLINE_P = 448,
- INNER_P = 449,
- INOUT = 450,
- INPUT_P = 451,
- INSENSITIVE = 452,
- INSERT = 453,
- INSTEAD = 454,
- INT_P = 455,
- INTEGER = 456,
- INTERSECT = 457,
- INTERVAL = 458,
- INTO = 459,
- INVOKER = 460,
- IS = 461,
- ISNULL = 462,
- ISOLATION = 463,
- JOIN = 464,
- KEY = 465,
- LABEL = 466,
- LANGUAGE = 467,
- LARGE_P = 468,
- LAST_P = 469,
- LATERAL_P = 470,
- LEADING = 471,
- LEAKPROOF = 472,
- LEAST = 473,
- LEFT = 474,
- LEVEL = 475,
- LIKE = 476,
- LIMIT = 477,
- LISTEN = 478,
- LOAD = 479,
- LOCAL = 480,
- LOCALTIME = 481,
- LOCALTIMESTAMP = 482,
- LOCATION = 483,
- LOCK_P = 484,
- LOCKED = 485,
- LOGGED = 486,
- MAPPING = 487,
- MATCH = 488,
- MATERIALIZED = 489,
- MAXVALUE = 490,
- METHOD = 491,
- MINUTE_P = 492,
- MINVALUE = 493,
- MODE = 494,
- MONTH_P = 495,
- MOVE = 496,
- NAME_P = 497,
- NAMES = 498,
- NATIONAL = 499,
- NATURAL = 500,
- NCHAR = 501,
- NEW = 502,
- NEXT = 503,
- NO = 504,
- NONE = 505,
- NOT = 506,
- NOTHING = 507,
- NOTIFY = 508,
- NOTNULL = 509,
- NOWAIT = 510,
- NULL_P = 511,
- NULLIF = 512,
- NULLS_P = 513,
- NUMERIC = 514,
- OBJECT_P = 515,
- OF = 516,
- OFF = 517,
- OFFSET = 518,
- OIDS = 519,
- OLD = 520,
- ON = 521,
- ONLY = 522,
- OPERATOR = 523,
- OPTION = 524,
- OPTIONS = 525,
- OR = 526,
- ORDER = 527,
- ORDINALITY = 528,
- OUT_P = 529,
- OUTER_P = 530,
- OVER = 531,
- OVERLAPS = 532,
- OVERLAY = 533,
- OVERRIDING = 534,
- OWNED = 535,
- OWNER = 536,
- PARALLEL = 537,
- PARSER = 538,
- PARTIAL = 539,
- PARTITION = 540,
- PASSING = 541,
- PASSWORD = 542,
- PGPOOL = 543,
- PLACING = 544,
- PLANS = 545,
- POLICY = 546,
- POSITION = 547,
- PRECEDING = 548,
- PRECISION = 549,
- PRESERVE = 550,
- PREPARE = 551,
- PREPARED = 552,
- PRIMARY = 553,
- PRIOR = 554,
- PRIVILEGES = 555,
- PROCEDURAL = 556,
- PROCEDURE = 557,
- PROGRAM = 558,
- PUBLICATION = 559,
- QUOTE = 560,
- RANGE = 561,
- READ = 562,
- REAL = 563,
- REASSIGN = 564,
- RECHECK = 565,
- RECURSIVE = 566,
- REF = 567,
- REFERENCES = 568,
- REFERENCING = 569,
- REFRESH = 570,
- REINDEX = 571,
- RELATIVE_P = 572,
- RELEASE = 573,
- RENAME = 574,
- REPEATABLE = 575,
- REPLACE = 576,
- REPLICA = 577,
- RESET = 578,
- RESTART = 579,
- RESTRICT = 580,
- RETURNING = 581,
- RETURNS = 582,
- REVOKE = 583,
- RIGHT = 584,
- ROLE = 585,
- ROLLBACK = 586,
- ROLLUP = 587,
- ROW = 588,
- ROWS = 589,
- RULE = 590,
- SAVEPOINT = 591,
- SCHEMA = 592,
- SCHEMAS = 593,
- SCROLL = 594,
- SEARCH = 595,
- SECOND_P = 596,
- SECURITY = 597,
- SELECT = 598,
- SEQUENCE = 599,
- SEQUENCES = 600,
- SERIALIZABLE = 601,
- SERVER = 602,
- SESSION = 603,
- SESSION_USER = 604,
- SET = 605,
- SETS = 606,
- SETOF = 607,
- SHARE = 608,
- SHOW = 609,
- SIMILAR = 610,
- SIMPLE = 611,
- SKIP = 612,
- SMALLINT = 613,
- SNAPSHOT = 614,
- SOME = 615,
- SQL_P = 616,
- STABLE = 617,
- STANDALONE_P = 618,
- START = 619,
- STATEMENT = 620,
- STATISTICS = 621,
- STDIN = 622,
- STDOUT = 623,
- STORAGE = 624,
- STRICT_P = 625,
- STRIP_P = 626,
- SUBSCRIPTION = 627,
- SUBSTRING = 628,
- SYMMETRIC = 629,
- SYSID = 630,
- SYSTEM_P = 631,
- TABLE = 632,
- TABLES = 633,
- TABLESAMPLE = 634,
- TABLESPACE = 635,
- TEMP = 636,
- TEMPLATE = 637,
- TEMPORARY = 638,
- TEXT_P = 639,
- THEN = 640,
- TIME = 641,
- TIMESTAMP = 642,
- TO = 643,
- TRAILING = 644,
- TRANSACTION = 645,
- TRANSFORM = 646,
- TREAT = 647,
- TRIGGER = 648,
- TRIM = 649,
- TRUE_P = 650,
- TRUNCATE = 651,
- TRUSTED = 652,
- TYPE_P = 653,
- TYPES_P = 654,
- UNBOUNDED = 655,
- UNCOMMITTED = 656,
- UNENCRYPTED = 657,
- UNION = 658,
- UNIQUE = 659,
- UNKNOWN = 660,
- UNLISTEN = 661,
- UNLOGGED = 662,
- UNTIL = 663,
- UPDATE = 664,
- USER = 665,
- USING = 666,
- VACUUM = 667,
- VALID = 668,
- VALIDATE = 669,
- VALIDATOR = 670,
- VALUE_P = 671,
- VALUES = 672,
- VARCHAR = 673,
- VARIADIC = 674,
- VARYING = 675,
- VERBOSE = 676,
- VERSION_P = 677,
- VIEW = 678,
- VIEWS = 679,
- VOLATILE = 680,
- WHEN = 681,
- WHERE = 682,
- WHITESPACE_P = 683,
- WINDOW = 684,
- WITH = 685,
- WITHIN = 686,
- WITHOUT = 687,
- WORK = 688,
- WRAPPER = 689,
- WRITE = 690,
- XML_P = 691,
- XMLATTRIBUTES = 692,
- XMLCONCAT = 693,
- XMLELEMENT = 694,
- XMLEXISTS = 695,
- XMLFOREST = 696,
- XMLNAMESPACES = 697,
- XMLPARSE = 698,
- XMLPI = 699,
- XMLROOT = 700,
- XMLSERIALIZE = 701,
- XMLTABLE = 702,
- YEAR_P = 703,
- YES_P = 704,
- ZONE = 705,
- NOT_LA = 706,
- NULLS_LA = 707,
- WITH_LA = 708,
- POSTFIXOP = 709,
- UMINUS = 710
+ CALL = 310,
+ CALLED = 311,
+ CASCADE = 312,
+ CASCADED = 313,
+ CASE = 314,
+ CAST = 315,
+ CATALOG_P = 316,
+ CHAIN = 317,
+ CHAR_P = 318,
+ CHARACTER = 319,
+ CHARACTERISTICS = 320,
+ CHECK = 321,
+ CHECKPOINT = 322,
+ CLASS = 323,
+ CLOSE = 324,
+ CLUSTER = 325,
+ COALESCE = 326,
+ COLLATE = 327,
+ COLLATION = 328,
+ COLUMN = 329,
+ COLUMNS = 330,
+ COMMENT = 331,
+ COMMENTS = 332,
+ COMMIT = 333,
+ COMMITTED = 334,
+ CONCURRENTLY = 335,
+ CONFIGURATION = 336,
+ CONFLICT = 337,
+ CONNECTION = 338,
+ CONSTRAINT = 339,
+ CONSTRAINTS = 340,
+ CONTENT_P = 341,
+ CONTINUE_P = 342,
+ CONVERSION_P = 343,
+ COPY = 344,
+ COST = 345,
+ CREATE = 346,
+ CROSS = 347,
+ CSV = 348,
+ CUBE = 349,
+ CURRENT_P = 350,
+ CURRENT_CATALOG = 351,
+ CURRENT_DATE = 352,
+ CURRENT_ROLE = 353,
+ CURRENT_SCHEMA = 354,
+ CURRENT_TIME = 355,
+ CURRENT_TIMESTAMP = 356,
+ CURRENT_USER = 357,
+ CURSOR = 358,
+ CYCLE = 359,
+ DATA_P = 360,
+ DATABASE = 361,
+ DAY_P = 362,
+ DEALLOCATE = 363,
+ DEC = 364,
+ DECIMAL_P = 365,
+ DECLARE = 366,
+ DEFAULT = 367,
+ DEFAULTS = 368,
+ DEFERRABLE = 369,
+ DEFERRED = 370,
+ DEFINER = 371,
+ DELETE_P = 372,
+ DELIMITER = 373,
+ DELIMITERS = 374,
+ DEPENDS = 375,
+ DESC = 376,
+ DETACH = 377,
+ DICTIONARY = 378,
+ DISABLE_P = 379,
+ DISCARD = 380,
+ DISTINCT = 381,
+ DO = 382,
+ DOCUMENT_P = 383,
+ DOMAIN_P = 384,
+ DOUBLE_P = 385,
+ DROP = 386,
+ EACH = 387,
+ ELSE = 388,
+ ENABLE_P = 389,
+ ENCODING = 390,
+ ENCRYPTED = 391,
+ END_P = 392,
+ ENUM_P = 393,
+ ESCAPE = 394,
+ EVENT = 395,
+ EXCEPT = 396,
+ EXCLUDE = 397,
+ EXCLUDING = 398,
+ EXCLUSIVE = 399,
+ EXECUTE = 400,
+ EXISTS = 401,
+ EXPLAIN = 402,
+ EXTENSION = 403,
+ EXTERNAL = 404,
+ EXTRACT = 405,
+ FALSE_P = 406,
+ FAMILY = 407,
+ FETCH = 408,
+ FILTER = 409,
+ FIRST_P = 410,
+ FLOAT_P = 411,
+ FOLLOWING = 412,
+ FOR = 413,
+ FORCE = 414,
+ FOREIGN = 415,
+ FORWARD = 416,
+ FREEZE = 417,
+ FROM = 418,
+ FULL = 419,
+ FUNCTION = 420,
+ FUNCTIONS = 421,
+ GENERATED = 422,
+ GLOBAL = 423,
+ GRANT = 424,
+ GRANTED = 425,
+ GREATEST = 426,
+ GROUP_P = 427,
+ GROUPING = 428,
+ GROUPS = 429,
+ HANDLER = 430,
+ HAVING = 431,
+ HEADER_P = 432,
+ HOLD = 433,
+ HOUR_P = 434,
+ IDENTITY_P = 435,
+ IF_P = 436,
+ ILIKE = 437,
+ IMMEDIATE = 438,
+ IMMUTABLE = 439,
+ IMPLICIT_P = 440,
+ IMPORT_P = 441,
+ IN_P = 442,
+ INCLUDE = 443,
+ INCLUDING = 444,
+ INCREMENT = 445,
+ INDEX = 446,
+ INDEXES = 447,
+ INHERIT = 448,
+ INHERITS = 449,
+ INITIALLY = 450,
+ INLINE_P = 451,
+ INNER_P = 452,
+ INOUT = 453,
+ INPUT_P = 454,
+ INSENSITIVE = 455,
+ INSERT = 456,
+ INSTEAD = 457,
+ INT_P = 458,
+ INTEGER = 459,
+ INTERSECT = 460,
+ INTERVAL = 461,
+ INTO = 462,
+ INVOKER = 463,
+ IS = 464,
+ ISNULL = 465,
+ ISOLATION = 466,
+ JOIN = 467,
+ KEY = 468,
+ LABEL = 469,
+ LANGUAGE = 470,
+ LARGE_P = 471,
+ LAST_P = 472,
+ LATERAL_P = 473,
+ LEADING = 474,
+ LEAKPROOF = 475,
+ LEAST = 476,
+ LEFT = 477,
+ LEVEL = 478,
+ LIKE = 479,
+ LIMIT = 480,
+ LISTEN = 481,
+ LOAD = 482,
+ LOCAL = 483,
+ LOCALTIME = 484,
+ LOCALTIMESTAMP = 485,
+ LOCATION = 486,
+ LOCK_P = 487,
+ LOCKED = 488,
+ LOGGED = 489,
+ MAPPING = 490,
+ MATCH = 491,
+ MATERIALIZED = 492,
+ MAXVALUE = 493,
+ METHOD = 494,
+ MINUTE_P = 495,
+ MINVALUE = 496,
+ MODE = 497,
+ MONTH_P = 498,
+ MOVE = 499,
+ NAME_P = 500,
+ NAMES = 501,
+ NATIONAL = 502,
+ NATURAL = 503,
+ NCHAR = 504,
+ NEW = 505,
+ NEXT = 506,
+ NO = 507,
+ NONE = 508,
+ NOT = 509,
+ NOTHING = 510,
+ NOTIFY = 511,
+ NOTNULL = 512,
+ NOWAIT = 513,
+ NULL_P = 514,
+ NULLIF = 515,
+ NULLS_P = 516,
+ NUMERIC = 517,
+ OBJECT_P = 518,
+ OF = 519,
+ OFF = 520,
+ OFFSET = 521,
+ OIDS = 522,
+ OLD = 523,
+ ON = 524,
+ ONLY = 525,
+ OPERATOR = 526,
+ OPTION = 527,
+ OPTIONS = 528,
+ OR = 529,
+ ORDER = 530,
+ ORDINALITY = 531,
+ OTHERS = 532,
+ OUT_P = 533,
+ OUTER_P = 534,
+ OVER = 535,
+ OVERLAPS = 536,
+ OVERLAY = 537,
+ OVERRIDING = 538,
+ OWNED = 539,
+ OWNER = 540,
+ PARALLEL = 541,
+ PARSER = 542,
+ PARTIAL = 543,
+ PARTITION = 544,
+ PASSING = 545,
+ PASSWORD = 546,
+ PGPOOL = 547,
+ PLACING = 548,
+ PLANS = 549,
+ POLICY = 550,
+ POSITION = 551,
+ PRECEDING = 552,
+ PRECISION = 553,
+ PRESERVE = 554,
+ PREPARE = 555,
+ PREPARED = 556,
+ PRIMARY = 557,
+ PRIOR = 558,
+ PRIVILEGES = 559,
+ PROCEDURAL = 560,
+ PROCEDURE = 561,
+ PROCEDURES = 562,
+ PROGRAM = 563,
+ PUBLICATION = 564,
+ QUOTE = 565,
+ RANGE = 566,
+ READ = 567,
+ REAL = 568,
+ REASSIGN = 569,
+ RECHECK = 570,
+ RECURSIVE = 571,
+ REF = 572,
+ REFERENCES = 573,
+ REFERENCING = 574,
+ REFRESH = 575,
+ REINDEX = 576,
+ RELATIVE_P = 577,
+ RELEASE = 578,
+ RENAME = 579,
+ REPEATABLE = 580,
+ REPLACE = 581,
+ REPLICA = 582,
+ RESET = 583,
+ RESTART = 584,
+ RESTRICT = 585,
+ RETURNING = 586,
+ RETURNS = 587,
+ REVOKE = 588,
+ RIGHT = 589,
+ ROLE = 590,
+ ROLLBACK = 591,
+ ROLLUP = 592,
+ ROUTINE = 593,
+ ROUTINES = 594,
+ ROW = 595,
+ ROWS = 596,
+ RULE = 597,
+ SAVEPOINT = 598,
+ SCHEMA = 599,
+ SCHEMAS = 600,
+ SCROLL = 601,
+ SEARCH = 602,
+ SECOND_P = 603,
+ SECURITY = 604,
+ SELECT = 605,
+ SEQUENCE = 606,
+ SEQUENCES = 607,
+ SERIALIZABLE = 608,
+ SERVER = 609,
+ SESSION = 610,
+ SESSION_USER = 611,
+ SET = 612,
+ SETS = 613,
+ SETOF = 614,
+ SHARE = 615,
+ SHOW = 616,
+ SIMILAR = 617,
+ SIMPLE = 618,
+ SKIP = 619,
+ SMALLINT = 620,
+ SNAPSHOT = 621,
+ SOME = 622,
+ SQL_P = 623,
+ STABLE = 624,
+ STANDALONE_P = 625,
+ START = 626,
+ STATEMENT = 627,
+ STATISTICS = 628,
+ STDIN = 629,
+ STDOUT = 630,
+ STORAGE = 631,
+ STRICT_P = 632,
+ STRIP_P = 633,
+ SUBSCRIPTION = 634,
+ SUBSTRING = 635,
+ SYMMETRIC = 636,
+ SYSID = 637,
+ SYSTEM_P = 638,
+ TABLE = 639,
+ TABLES = 640,
+ TABLESAMPLE = 641,
+ TABLESPACE = 642,
+ TEMP = 643,
+ TEMPLATE = 644,
+ TEMPORARY = 645,
+ TEXT_P = 646,
+ THEN = 647,
+ TIES = 648,
+ TIME = 649,
+ TIMESTAMP = 650,
+ TO = 651,
+ TRAILING = 652,
+ TRANSACTION = 653,
+ TRANSFORM = 654,
+ TREAT = 655,
+ TRIGGER = 656,
+ TRIM = 657,
+ TRUE_P = 658,
+ TRUNCATE = 659,
+ TRUSTED = 660,
+ TYPE_P = 661,
+ TYPES_P = 662,
+ UNBOUNDED = 663,
+ UNCOMMITTED = 664,
+ UNENCRYPTED = 665,
+ UNION = 666,
+ UNIQUE = 667,
+ UNKNOWN = 668,
+ UNLISTEN = 669,
+ UNLOGGED = 670,
+ UNTIL = 671,
+ UPDATE = 672,
+ USER = 673,
+ USING = 674,
+ VACUUM = 675,
+ VALID = 676,
+ VALIDATE = 677,
+ VALIDATOR = 678,
+ VALUE_P = 679,
+ VALUES = 680,
+ VARCHAR = 681,
+ VARIADIC = 682,
+ VARYING = 683,
+ VERBOSE = 684,
+ VERSION_P = 685,
+ VIEW = 686,
+ VIEWS = 687,
+ VOLATILE = 688,
+ WHEN = 689,
+ WHERE = 690,
+ WHITESPACE_P = 691,
+ WINDOW = 692,
+ WITH = 693,
+ WITHIN = 694,
+ WITHOUT = 695,
+ WORK = 696,
+ WRAPPER = 697,
+ WRITE = 698,
+ XML_P = 699,
+ XMLATTRIBUTES = 700,
+ XMLCONCAT = 701,
+ XMLELEMENT = 702,
+ XMLEXISTS = 703,
+ XMLFOREST = 704,
+ XMLNAMESPACES = 705,
+ XMLPARSE = 706,
+ XMLPI = 707,
+ XMLROOT = 708,
+ XMLSERIALIZE = 709,
+ XMLTABLE = 710,
+ YEAR_P = 711,
+ YES_P = 712,
+ ZONE = 713,
+ NOT_LA = 714,
+ NULLS_LA = 715,
+ WITH_LA = 716,
+ POSTFIXOP = 717,
+ UMINUS = 718
};
#endif
/* Tokens. */
#define BOTH 307
#define BY 308
#define CACHE 309
-#define CALLED 310
-#define CASCADE 311
-#define CASCADED 312
-#define CASE 313
-#define CAST 314
-#define CATALOG_P 315
-#define CHAIN 316
-#define CHAR_P 317
-#define CHARACTER 318
-#define CHARACTERISTICS 319
-#define CHECK 320
-#define CHECKPOINT 321
-#define CLASS 322
-#define CLOSE 323
-#define CLUSTER 324
-#define COALESCE 325
-#define COLLATE 326
-#define COLLATION 327
-#define COLUMN 328
-#define COLUMNS 329
-#define COMMENT 330
-#define COMMENTS 331
-#define COMMIT 332
-#define COMMITTED 333
-#define CONCURRENTLY 334
-#define CONFIGURATION 335
-#define CONFLICT 336
-#define CONNECTION 337
-#define CONSTRAINT 338
-#define CONSTRAINTS 339
-#define CONTENT_P 340
-#define CONTINUE_P 341
-#define CONVERSION_P 342
-#define COPY 343
-#define COST 344
-#define CREATE 345
-#define CROSS 346
-#define CSV 347
-#define CUBE 348
-#define CURRENT_P 349
-#define CURRENT_CATALOG 350
-#define CURRENT_DATE 351
-#define CURRENT_ROLE 352
-#define CURRENT_SCHEMA 353
-#define CURRENT_TIME 354
-#define CURRENT_TIMESTAMP 355
-#define CURRENT_USER 356
-#define CURSOR 357
-#define CYCLE 358
-#define DATA_P 359
-#define DATABASE 360
-#define DAY_P 361
-#define DEALLOCATE 362
-#define DEC 363
-#define DECIMAL_P 364
-#define DECLARE 365
-#define DEFAULT 366
-#define DEFAULTS 367
-#define DEFERRABLE 368
-#define DEFERRED 369
-#define DEFINER 370
-#define DELETE_P 371
-#define DELIMITER 372
-#define DELIMITERS 373
-#define DEPENDS 374
-#define DESC 375
-#define DETACH 376
-#define DICTIONARY 377
-#define DISABLE_P 378
-#define DISCARD 379
-#define DISTINCT 380
-#define DO 381
-#define DOCUMENT_P 382
-#define DOMAIN_P 383
-#define DOUBLE_P 384
-#define DROP 385
-#define EACH 386
-#define ELSE 387
-#define ENABLE_P 388
-#define ENCODING 389
-#define ENCRYPTED 390
-#define END_P 391
-#define ENUM_P 392
-#define ESCAPE 393
-#define EVENT 394
-#define EXCEPT 395
-#define EXCLUDE 396
-#define EXCLUDING 397
-#define EXCLUSIVE 398
-#define EXECUTE 399
-#define EXISTS 400
-#define EXPLAIN 401
-#define EXTENSION 402
-#define EXTERNAL 403
-#define EXTRACT 404
-#define FALSE_P 405
-#define FAMILY 406
-#define FETCH 407
-#define FILTER 408
-#define FIRST_P 409
-#define FLOAT_P 410
-#define FOLLOWING 411
-#define FOR 412
-#define FORCE 413
-#define FOREIGN 414
-#define FORWARD 415
-#define FREEZE 416
-#define FROM 417
-#define FULL 418
-#define FUNCTION 419
-#define FUNCTIONS 420
-#define GENERATED 421
-#define GLOBAL 422
-#define GRANT 423
-#define GRANTED 424
-#define GREATEST 425
-#define GROUP_P 426
-#define GROUPING 427
-#define HANDLER 428
-#define HAVING 429
-#define HEADER_P 430
-#define HOLD 431
-#define HOUR_P 432
-#define IDENTITY_P 433
-#define IF_P 434
-#define ILIKE 435
-#define IMMEDIATE 436
-#define IMMUTABLE 437
-#define IMPLICIT_P 438
-#define IMPORT_P 439
-#define IN_P 440
-#define INCLUDING 441
-#define INCREMENT 442
-#define INDEX 443
-#define INDEXES 444
-#define INHERIT 445
-#define INHERITS 446
-#define INITIALLY 447
-#define INLINE_P 448
-#define INNER_P 449
-#define INOUT 450
-#define INPUT_P 451
-#define INSENSITIVE 452
-#define INSERT 453
-#define INSTEAD 454
-#define INT_P 455
-#define INTEGER 456
-#define INTERSECT 457
-#define INTERVAL 458
-#define INTO 459
-#define INVOKER 460
-#define IS 461
-#define ISNULL 462
-#define ISOLATION 463
-#define JOIN 464
-#define KEY 465
-#define LABEL 466
-#define LANGUAGE 467
-#define LARGE_P 468
-#define LAST_P 469
-#define LATERAL_P 470
-#define LEADING 471
-#define LEAKPROOF 472
-#define LEAST 473
-#define LEFT 474
-#define LEVEL 475
-#define LIKE 476
-#define LIMIT 477
-#define LISTEN 478
-#define LOAD 479
-#define LOCAL 480
-#define LOCALTIME 481
-#define LOCALTIMESTAMP 482
-#define LOCATION 483
-#define LOCK_P 484
-#define LOCKED 485
-#define LOGGED 486
-#define MAPPING 487
-#define MATCH 488
-#define MATERIALIZED 489
-#define MAXVALUE 490
-#define METHOD 491
-#define MINUTE_P 492
-#define MINVALUE 493
-#define MODE 494
-#define MONTH_P 495
-#define MOVE 496
-#define NAME_P 497
-#define NAMES 498
-#define NATIONAL 499
-#define NATURAL 500
-#define NCHAR 501
-#define NEW 502
-#define NEXT 503
-#define NO 504
-#define NONE 505
-#define NOT 506
-#define NOTHING 507
-#define NOTIFY 508
-#define NOTNULL 509
-#define NOWAIT 510
-#define NULL_P 511
-#define NULLIF 512
-#define NULLS_P 513
-#define NUMERIC 514
-#define OBJECT_P 515
-#define OF 516
-#define OFF 517
-#define OFFSET 518
-#define OIDS 519
-#define OLD 520
-#define ON 521
-#define ONLY 522
-#define OPERATOR 523
-#define OPTION 524
-#define OPTIONS 525
-#define OR 526
-#define ORDER 527
-#define ORDINALITY 528
-#define OUT_P 529
-#define OUTER_P 530
-#define OVER 531
-#define OVERLAPS 532
-#define OVERLAY 533
-#define OVERRIDING 534
-#define OWNED 535
-#define OWNER 536
-#define PARALLEL 537
-#define PARSER 538
-#define PARTIAL 539
-#define PARTITION 540
-#define PASSING 541
-#define PASSWORD 542
-#define PGPOOL 543
-#define PLACING 544
-#define PLANS 545
-#define POLICY 546
-#define POSITION 547
-#define PRECEDING 548
-#define PRECISION 549
-#define PRESERVE 550
-#define PREPARE 551
-#define PREPARED 552
-#define PRIMARY 553
-#define PRIOR 554
-#define PRIVILEGES 555
-#define PROCEDURAL 556
-#define PROCEDURE 557
-#define PROGRAM 558
-#define PUBLICATION 559
-#define QUOTE 560
-#define RANGE 561
-#define READ 562
-#define REAL 563
-#define REASSIGN 564
-#define RECHECK 565
-#define RECURSIVE 566
-#define REF 567
-#define REFERENCES 568
-#define REFERENCING 569
-#define REFRESH 570
-#define REINDEX 571
-#define RELATIVE_P 572
-#define RELEASE 573
-#define RENAME 574
-#define REPEATABLE 575
-#define REPLACE 576
-#define REPLICA 577
-#define RESET 578
-#define RESTART 579
-#define RESTRICT 580
-#define RETURNING 581
-#define RETURNS 582
-#define REVOKE 583
-#define RIGHT 584
-#define ROLE 585
-#define ROLLBACK 586
-#define ROLLUP 587
-#define ROW 588
-#define ROWS 589
-#define RULE 590
-#define SAVEPOINT 591
-#define SCHEMA 592
-#define SCHEMAS 593
-#define SCROLL 594
-#define SEARCH 595
-#define SECOND_P 596
-#define SECURITY 597
-#define SELECT 598
-#define SEQUENCE 599
-#define SEQUENCES 600
-#define SERIALIZABLE 601
-#define SERVER 602
-#define SESSION 603
-#define SESSION_USER 604
-#define SET 605
-#define SETS 606
-#define SETOF 607
-#define SHARE 608
-#define SHOW 609
-#define SIMILAR 610
-#define SIMPLE 611
-#define SKIP 612
-#define SMALLINT 613
-#define SNAPSHOT 614
-#define SOME 615
-#define SQL_P 616
-#define STABLE 617
-#define STANDALONE_P 618
-#define START 619
-#define STATEMENT 620
-#define STATISTICS 621
-#define STDIN 622
-#define STDOUT 623
-#define STORAGE 624
-#define STRICT_P 625
-#define STRIP_P 626
-#define SUBSCRIPTION 627
-#define SUBSTRING 628
-#define SYMMETRIC 629
-#define SYSID 630
-#define SYSTEM_P 631
-#define TABLE 632
-#define TABLES 633
-#define TABLESAMPLE 634
-#define TABLESPACE 635
-#define TEMP 636
-#define TEMPLATE 637
-#define TEMPORARY 638
-#define TEXT_P 639
-#define THEN 640
-#define TIME 641
-#define TIMESTAMP 642
-#define TO 643
-#define TRAILING 644
-#define TRANSACTION 645
-#define TRANSFORM 646
-#define TREAT 647
-#define TRIGGER 648
-#define TRIM 649
-#define TRUE_P 650
-#define TRUNCATE 651
-#define TRUSTED 652
-#define TYPE_P 653
-#define TYPES_P 654
-#define UNBOUNDED 655
-#define UNCOMMITTED 656
-#define UNENCRYPTED 657
-#define UNION 658
-#define UNIQUE 659
-#define UNKNOWN 660
-#define UNLISTEN 661
-#define UNLOGGED 662
-#define UNTIL 663
-#define UPDATE 664
-#define USER 665
-#define USING 666
-#define VACUUM 667
-#define VALID 668
-#define VALIDATE 669
-#define VALIDATOR 670
-#define VALUE_P 671
-#define VALUES 672
-#define VARCHAR 673
-#define VARIADIC 674
-#define VARYING 675
-#define VERBOSE 676
-#define VERSION_P 677
-#define VIEW 678
-#define VIEWS 679
-#define VOLATILE 680
-#define WHEN 681
-#define WHERE 682
-#define WHITESPACE_P 683
-#define WINDOW 684
-#define WITH 685
-#define WITHIN 686
-#define WITHOUT 687
-#define WORK 688
-#define WRAPPER 689
-#define WRITE 690
-#define XML_P 691
-#define XMLATTRIBUTES 692
-#define XMLCONCAT 693
-#define XMLELEMENT 694
-#define XMLEXISTS 695
-#define XMLFOREST 696
-#define XMLNAMESPACES 697
-#define XMLPARSE 698
-#define XMLPI 699
-#define XMLROOT 700
-#define XMLSERIALIZE 701
-#define XMLTABLE 702
-#define YEAR_P 703
-#define YES_P 704
-#define ZONE 705
-#define NOT_LA 706
-#define NULLS_LA 707
-#define WITH_LA 708
-#define POSTFIXOP 709
-#define UMINUS 710
+#define CALL 310
+#define CALLED 311
+#define CASCADE 312
+#define CASCADED 313
+#define CASE 314
+#define CAST 315
+#define CATALOG_P 316
+#define CHAIN 317
+#define CHAR_P 318
+#define CHARACTER 319
+#define CHARACTERISTICS 320
+#define CHECK 321
+#define CHECKPOINT 322
+#define CLASS 323
+#define CLOSE 324
+#define CLUSTER 325
+#define COALESCE 326
+#define COLLATE 327
+#define COLLATION 328
+#define COLUMN 329
+#define COLUMNS 330
+#define COMMENT 331
+#define COMMENTS 332
+#define COMMIT 333
+#define COMMITTED 334
+#define CONCURRENTLY 335
+#define CONFIGURATION 336
+#define CONFLICT 337
+#define CONNECTION 338
+#define CONSTRAINT 339
+#define CONSTRAINTS 340
+#define CONTENT_P 341
+#define CONTINUE_P 342
+#define CONVERSION_P 343
+#define COPY 344
+#define COST 345
+#define CREATE 346
+#define CROSS 347
+#define CSV 348
+#define CUBE 349
+#define CURRENT_P 350
+#define CURRENT_CATALOG 351
+#define CURRENT_DATE 352
+#define CURRENT_ROLE 353
+#define CURRENT_SCHEMA 354
+#define CURRENT_TIME 355
+#define CURRENT_TIMESTAMP 356
+#define CURRENT_USER 357
+#define CURSOR 358
+#define CYCLE 359
+#define DATA_P 360
+#define DATABASE 361
+#define DAY_P 362
+#define DEALLOCATE 363
+#define DEC 364
+#define DECIMAL_P 365
+#define DECLARE 366
+#define DEFAULT 367
+#define DEFAULTS 368
+#define DEFERRABLE 369
+#define DEFERRED 370
+#define DEFINER 371
+#define DELETE_P 372
+#define DELIMITER 373
+#define DELIMITERS 374
+#define DEPENDS 375
+#define DESC 376
+#define DETACH 377
+#define DICTIONARY 378
+#define DISABLE_P 379
+#define DISCARD 380
+#define DISTINCT 381
+#define DO 382
+#define DOCUMENT_P 383
+#define DOMAIN_P 384
+#define DOUBLE_P 385
+#define DROP 386
+#define EACH 387
+#define ELSE 388
+#define ENABLE_P 389
+#define ENCODING 390
+#define ENCRYPTED 391
+#define END_P 392
+#define ENUM_P 393
+#define ESCAPE 394
+#define EVENT 395
+#define EXCEPT 396
+#define EXCLUDE 397
+#define EXCLUDING 398
+#define EXCLUSIVE 399
+#define EXECUTE 400
+#define EXISTS 401
+#define EXPLAIN 402
+#define EXTENSION 403
+#define EXTERNAL 404
+#define EXTRACT 405
+#define FALSE_P 406
+#define FAMILY 407
+#define FETCH 408
+#define FILTER 409
+#define FIRST_P 410
+#define FLOAT_P 411
+#define FOLLOWING 412
+#define FOR 413
+#define FORCE 414
+#define FOREIGN 415
+#define FORWARD 416
+#define FREEZE 417
+#define FROM 418
+#define FULL 419
+#define FUNCTION 420
+#define FUNCTIONS 421
+#define GENERATED 422
+#define GLOBAL 423
+#define GRANT 424
+#define GRANTED 425
+#define GREATEST 426
+#define GROUP_P 427
+#define GROUPING 428
+#define GROUPS 429
+#define HANDLER 430
+#define HAVING 431
+#define HEADER_P 432
+#define HOLD 433
+#define HOUR_P 434
+#define IDENTITY_P 435
+#define IF_P 436
+#define ILIKE 437
+#define IMMEDIATE 438
+#define IMMUTABLE 439
+#define IMPLICIT_P 440
+#define IMPORT_P 441
+#define IN_P 442
+#define INCLUDE 443
+#define INCLUDING 444
+#define INCREMENT 445
+#define INDEX 446
+#define INDEXES 447
+#define INHERIT 448
+#define INHERITS 449
+#define INITIALLY 450
+#define INLINE_P 451
+#define INNER_P 452
+#define INOUT 453
+#define INPUT_P 454
+#define INSENSITIVE 455
+#define INSERT 456
+#define INSTEAD 457
+#define INT_P 458
+#define INTEGER 459
+#define INTERSECT 460
+#define INTERVAL 461
+#define INTO 462
+#define INVOKER 463
+#define IS 464
+#define ISNULL 465
+#define ISOLATION 466
+#define JOIN 467
+#define KEY 468
+#define LABEL 469
+#define LANGUAGE 470
+#define LARGE_P 471
+#define LAST_P 472
+#define LATERAL_P 473
+#define LEADING 474
+#define LEAKPROOF 475
+#define LEAST 476
+#define LEFT 477
+#define LEVEL 478
+#define LIKE 479
+#define LIMIT 480
+#define LISTEN 481
+#define LOAD 482
+#define LOCAL 483
+#define LOCALTIME 484
+#define LOCALTIMESTAMP 485
+#define LOCATION 486
+#define LOCK_P 487
+#define LOCKED 488
+#define LOGGED 489
+#define MAPPING 490
+#define MATCH 491
+#define MATERIALIZED 492
+#define MAXVALUE 493
+#define METHOD 494
+#define MINUTE_P 495
+#define MINVALUE 496
+#define MODE 497
+#define MONTH_P 498
+#define MOVE 499
+#define NAME_P 500
+#define NAMES 501
+#define NATIONAL 502
+#define NATURAL 503
+#define NCHAR 504
+#define NEW 505
+#define NEXT 506
+#define NO 507
+#define NONE 508
+#define NOT 509
+#define NOTHING 510
+#define NOTIFY 511
+#define NOTNULL 512
+#define NOWAIT 513
+#define NULL_P 514
+#define NULLIF 515
+#define NULLS_P 516
+#define NUMERIC 517
+#define OBJECT_P 518
+#define OF 519
+#define OFF 520
+#define OFFSET 521
+#define OIDS 522
+#define OLD 523
+#define ON 524
+#define ONLY 525
+#define OPERATOR 526
+#define OPTION 527
+#define OPTIONS 528
+#define OR 529
+#define ORDER 530
+#define ORDINALITY 531
+#define OTHERS 532
+#define OUT_P 533
+#define OUTER_P 534
+#define OVER 535
+#define OVERLAPS 536
+#define OVERLAY 537
+#define OVERRIDING 538
+#define OWNED 539
+#define OWNER 540
+#define PARALLEL 541
+#define PARSER 542
+#define PARTIAL 543
+#define PARTITION 544
+#define PASSING 545
+#define PASSWORD 546
+#define PGPOOL 547
+#define PLACING 548
+#define PLANS 549
+#define POLICY 550
+#define POSITION 551
+#define PRECEDING 552
+#define PRECISION 553
+#define PRESERVE 554
+#define PREPARE 555
+#define PREPARED 556
+#define PRIMARY 557
+#define PRIOR 558
+#define PRIVILEGES 559
+#define PROCEDURAL 560
+#define PROCEDURE 561
+#define PROCEDURES 562
+#define PROGRAM 563
+#define PUBLICATION 564
+#define QUOTE 565
+#define RANGE 566
+#define READ 567
+#define REAL 568
+#define REASSIGN 569
+#define RECHECK 570
+#define RECURSIVE 571
+#define REF 572
+#define REFERENCES 573
+#define REFERENCING 574
+#define REFRESH 575
+#define REINDEX 576
+#define RELATIVE_P 577
+#define RELEASE 578
+#define RENAME 579
+#define REPEATABLE 580
+#define REPLACE 581
+#define REPLICA 582
+#define RESET 583
+#define RESTART 584
+#define RESTRICT 585
+#define RETURNING 586
+#define RETURNS 587
+#define REVOKE 588
+#define RIGHT 589
+#define ROLE 590
+#define ROLLBACK 591
+#define ROLLUP 592
+#define ROUTINE 593
+#define ROUTINES 594
+#define ROW 595
+#define ROWS 596
+#define RULE 597
+#define SAVEPOINT 598
+#define SCHEMA 599
+#define SCHEMAS 600
+#define SCROLL 601
+#define SEARCH 602
+#define SECOND_P 603
+#define SECURITY 604
+#define SELECT 605
+#define SEQUENCE 606
+#define SEQUENCES 607
+#define SERIALIZABLE 608
+#define SERVER 609
+#define SESSION 610
+#define SESSION_USER 611
+#define SET 612
+#define SETS 613
+#define SETOF 614
+#define SHARE 615
+#define SHOW 616
+#define SIMILAR 617
+#define SIMPLE 618
+#define SKIP 619
+#define SMALLINT 620
+#define SNAPSHOT 621
+#define SOME 622
+#define SQL_P 623
+#define STABLE 624
+#define STANDALONE_P 625
+#define START 626
+#define STATEMENT 627
+#define STATISTICS 628
+#define STDIN 629
+#define STDOUT 630
+#define STORAGE 631
+#define STRICT_P 632
+#define STRIP_P 633
+#define SUBSCRIPTION 634
+#define SUBSTRING 635
+#define SYMMETRIC 636
+#define SYSID 637
+#define SYSTEM_P 638
+#define TABLE 639
+#define TABLES 640
+#define TABLESAMPLE 641
+#define TABLESPACE 642
+#define TEMP 643
+#define TEMPLATE 644
+#define TEMPORARY 645
+#define TEXT_P 646
+#define THEN 647
+#define TIES 648
+#define TIME 649
+#define TIMESTAMP 650
+#define TO 651
+#define TRAILING 652
+#define TRANSACTION 653
+#define TRANSFORM 654
+#define TREAT 655
+#define TRIGGER 656
+#define TRIM 657
+#define TRUE_P 658
+#define TRUNCATE 659
+#define TRUSTED 660
+#define TYPE_P 661
+#define TYPES_P 662
+#define UNBOUNDED 663
+#define UNCOMMITTED 664
+#define UNENCRYPTED 665
+#define UNION 666
+#define UNIQUE 667
+#define UNKNOWN 668
+#define UNLISTEN 669
+#define UNLOGGED 670
+#define UNTIL 671
+#define UPDATE 672
+#define USER 673
+#define USING 674
+#define VACUUM 675
+#define VALID 676
+#define VALIDATE 677
+#define VALIDATOR 678
+#define VALUE_P 679
+#define VALUES 680
+#define VARCHAR 681
+#define VARIADIC 682
+#define VARYING 683
+#define VERBOSE 684
+#define VERSION_P 685
+#define VIEW 686
+#define VIEWS 687
+#define VOLATILE 688
+#define WHEN 689
+#define WHERE 690
+#define WHITESPACE_P 691
+#define WINDOW 692
+#define WITH 693
+#define WITHIN 694
+#define WITHOUT 695
+#define WORK 696
+#define WRAPPER 697
+#define WRITE 698
+#define XML_P 699
+#define XMLATTRIBUTES 700
+#define XMLCONCAT 701
+#define XMLELEMENT 702
+#define XMLEXISTS 703
+#define XMLFOREST 704
+#define XMLNAMESPACES 705
+#define XMLPARSE 706
+#define XMLPI 707
+#define XMLROOT 708
+#define XMLSERIALIZE 709
+#define XMLTABLE 710
+#define YEAR_P 711
+#define YES_P 712
+#define ZONE 713
+#define NOT_LA 714
+#define NULLS_LA 715
+#define WITH_LA 716
+#define POSTFIXOP 717
+#define UMINUS 718
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
PartitionBoundSpec *partboundspec;
RoleSpec *rolespec;
-#line 1008 "gram.h" /* yacc.c:1909 */
+#line 1024 "gram.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
* gram.y
* POSTGRESQL BISON rules/actions
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
typedef struct PrivTarget
{
GrantTargetType targtype;
- GrantObjectType objtype;
+ ObjectType objtype;
List *objs;
} PrivTarget;
AlterCompositeTypeStmt AlterUserMappingStmt
AlterRoleStmt AlterRoleSetStmt AlterPolicyStmt
AlterDefaultPrivilegesStmt DefACLAction
- AnalyzeStmt ClosePortalStmt ClusterStmt CommentStmt
+ AnalyzeStmt CallStmt ClosePortalStmt ClusterStmt CommentStmt
ConstraintsSetStmt CopyStmt CreateAsStmt CreateCastStmt
CreateDomainStmt CreateExtensionStmt CreateGroupStmt CreateOpClassStmt
CreateOpFamilyStmt AlterOpFamilyStmt CreatePLangStmt
%type <ival> add_drop opt_asc_desc opt_nulls_order
%type <node> alter_table_cmd alter_type_cmd opt_collate_clause
- replica_identity partition_cmd
+ replica_identity partition_cmd index_partition_cmd
%type <list> alter_table_cmds alter_type_cmds
%type <list> alter_identity_column_option_list
%type <defelt> alter_identity_column_option
%type <ival> opt_lock lock_type cast_context
%type <ival> vacuum_option_list vacuum_option_elem
+ analyze_option_list analyze_option_elem
%type <boolean> opt_or_replace
opt_grant_grant_option opt_grant_admin_option
opt_nowait opt_if_exists opt_with_data
%type <list> DefACLOptionList
%type <ival> import_qualification_type
%type <importqual> import_qualification
+%type <node> vacuum_relation
%type <list> stmtblock stmtmulti
OptTableElementList TableElementList OptInherit definition
oper_argtypes RuleActionList RuleActionMulti
opt_column_list columnList opt_name_list
sort_clause opt_sort_clause sortby_list index_params
+ opt_include opt_c_include index_including_params
name_list role_list from_clause from_list opt_array_bounds
qualified_name_list any_name any_name_list type_name_list
any_operator expr_list attrs
transform_element_list transform_type_list
TriggerTransitions TriggerReferencing
publication_name_list
+ vacuum_relation_list opt_vacuum_relation_list
%type <list> group_by_list
%type <node> group_by_item empty_grouping_set rollup_clause cube_clause
%type <boolean> opt_instead
%type <boolean> opt_unique opt_concurrently opt_verbose opt_full
-%type <boolean> opt_freeze opt_default opt_recheck
+%type <boolean> opt_freeze opt_analyze opt_default opt_recheck
%type <defelt> opt_binary opt_oids copy_delimiter
%type <boolean> copy_from opt_program
%type <node> fetch_args limit_clause select_limit_value
offset_clause select_offset_value
- select_offset_value2 opt_select_fetch_first_value
+ select_fetch_first_value I_or_F_const
%type <ival> row_or_rows first_or_next
%type <list> OptSeqOptList SeqOptList OptParenthesizedSeqOptList
%type <list> window_clause window_definition_list opt_partition_clause
%type <windef> window_definition over_clause window_specification
opt_frame_clause frame_extent frame_bound
+%type <ival> opt_window_exclusion_clause
%type <str> opt_existing_window_name
%type <boolean> opt_if_not_exists
%type <ival> generated_when override_kind
%type <str> part_strategy
%type <partelem> part_elem
%type <list> part_params
-%type <partboundspec> ForValues
+%type <partboundspec> PartitionBoundSpec
%type <node> partbound_datum PartitionRangeDatum
-%type <list> partbound_datum_list range_datum_list
+%type <list> hash_partbound partbound_datum_list range_datum_list
+%type <defelt> hash_partbound_elem
/*
* Non-keyword token types. These are hard-wired into the "flex" lexer.
BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT
BOOLEAN_P BOTH BY
- CACHE CALLED CASCADE CASCADED CASE CAST CATALOG_P CHAIN CHAR_P
+ CACHE CALL CALLED CASCADE CASCADED CASE CAST CATALOG_P CHAIN CHAR_P
CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
CLUSTER COALESCE COLLATE COLLATION COLUMN COLUMNS COMMENT COMMENTS COMMIT
COMMITTED CONCURRENTLY CONFIGURATION CONFLICT CONNECTION CONSTRAINT
FALSE_P FAMILY FETCH FILTER FIRST_P FLOAT_P FOLLOWING FOR
FORCE FOREIGN FORWARD FREEZE FROM FULL FUNCTION FUNCTIONS
- GENERATED GLOBAL GRANT GRANTED GREATEST GROUP_P GROUPING
+ GENERATED GLOBAL GRANT GRANTED GREATEST GROUP_P GROUPING GROUPS
HANDLER HAVING HEADER_P HOLD HOUR_P
- IDENTITY_P IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IMPORT_P IN_P
+ IDENTITY_P IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IMPORT_P IN_P INCLUDE
INCLUDING INCREMENT INDEX INDEXES INHERIT INHERITS INITIALLY INLINE_P
INNER_P INOUT INPUT_P INSENSITIVE INSERT INSTEAD INT_P INTEGER
INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION
NULLS_P NUMERIC
OBJECT_P OF OFF OFFSET OIDS OLD ON ONLY OPERATOR OPTION OPTIONS OR
- ORDER ORDINALITY OUT_P OUTER_P OVER OVERLAPS OVERLAY OVERRIDING OWNED OWNER
+ ORDER ORDINALITY OTHERS OUT_P OUTER_P
+ OVER OVERLAPS OVERLAY OVERRIDING OWNED OWNER
PARALLEL PARSER PARTIAL PARTITION PASSING PASSWORD PGPOOL PLACING PLANS POLICY
POSITION PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY
- PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROGRAM PUBLICATION
+ PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROCEDURES PROGRAM PUBLICATION
QUOTE
RANGE READ REAL REASSIGN RECHECK RECURSIVE REF REFERENCES REFERENCING
REFRESH REINDEX RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA
RESET RESTART RESTRICT RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK ROLLUP
- ROW ROWS RULE
+ ROUTINE ROUTINES ROW ROWS RULE
SAVEPOINT SCHEMA SCHEMAS SCROLL SEARCH SECOND_P SECURITY SELECT SEQUENCE SEQUENCES
SERIALIZABLE SERVER SESSION SESSION_USER SET SETS SETOF SHARE SHOW
SUBSCRIPTION SUBSTRING SYMMETRIC SYSID SYSTEM_P
TABLE TABLES TABLESAMPLE TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN
- TIME TIMESTAMP TO TRAILING TRANSACTION TRANSFORM TREAT TRIGGER TRIM TRUE_P
+ TIES TIME TIMESTAMP TO TRAILING TRANSACTION TRANSFORM
+ TREAT TRIGGER TRIM TRUE_P
TRUNCATE TRUSTED TYPE_P TYPES_P
UNBOUNDED UNCOMMITTED UNENCRYPTED UNION UNIQUE UNKNOWN UNLISTEN UNLOGGED
* between POSTFIXOP and Op. We can safely assign the same priority to
* various unreserved keywords as needed to resolve ambiguities (this can't
* have any bad effects since obviously the keywords will still behave the
- * same as if they weren't keywords). We need to do this for PARTITION,
- * RANGE, ROWS to support opt_existing_window_name; and for RANGE, ROWS
- * so that they can follow a_expr without creating postfix-operator problems;
+ * same as if they weren't keywords). We need to do this:
+ * for PARTITION, RANGE, ROWS, GROUPS to support opt_existing_window_name;
+ * for RANGE, ROWS, GROUPS so that they can follow a_expr without creating
+ * postfix-operator problems;
* for GENERATED so that it can follow b_expr;
* and for NULL so that it can follow b_expr in ColQualList without creating
* postfix-operator problems.
* blame any funny behavior of UNBOUNDED on the SQL standard, though.
*/
%nonassoc UNBOUNDED /* ideally should have same precedence as IDENT */
-%nonassoc IDENT GENERATED NULL_P PARTITION RANGE ROWS PRECEDING FOLLOWING CUBE ROLLUP
+%nonassoc IDENT GENERATED NULL_P PARTITION RANGE ROWS GROUPS PRECEDING FOLLOWING CUBE ROLLUP
%left Op OPERATOR /* multi-character ops and user-defined operators */
%left '+' '-'
%left '*' '/' '%'
| AlterTSDictionaryStmt
| AlterUserMappingStmt
| AnalyzeStmt
+ | CallStmt
| CheckPointStmt
| ClosePortalStmt
| ClusterStmt
{ $$ = NULL; }
;
+/*****************************************************************************
+ *
+ * CALL statement
+ *
+ *****************************************************************************/
+
+CallStmt: CALL func_application
+ {
+ CallStmt *n = makeNode(CallStmt);
+ n->funccall = castNode(FuncCall, $2);
+ $$ = (Node *)n;
+ }
+ ;
+
/*****************************************************************************
*
* Create a new Postgres DBMS role
}
| INHERIT
{
- $$ = makeDefElem("inherit", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("inherit", (Node *)makeInteger(true), @1);
}
| CONNECTION LIMIT SignedIconst
{
* size of the main parser.
*/
if (strcmp($1, "superuser") == 0)
- $$ = makeDefElem("superuser", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("superuser", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nosuperuser") == 0)
- $$ = makeDefElem("superuser", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("superuser", (Node *)makeInteger(false), @1);
else if (strcmp($1, "createrole") == 0)
- $$ = makeDefElem("createrole", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("createrole", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nocreaterole") == 0)
- $$ = makeDefElem("createrole", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("createrole", (Node *)makeInteger(false), @1);
else if (strcmp($1, "replication") == 0)
- $$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("isreplication", (Node *)makeInteger(true), @1);
else if (strcmp($1, "noreplication") == 0)
- $$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("isreplication", (Node *)makeInteger(false), @1);
else if (strcmp($1, "createdb") == 0)
- $$ = makeDefElem("createdb", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("createdb", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nocreatedb") == 0)
- $$ = makeDefElem("createdb", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("createdb", (Node *)makeInteger(false), @1);
else if (strcmp($1, "login") == 0)
- $$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("canlogin", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nologin") == 0)
- $$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("canlogin", (Node *)makeInteger(false), @1);
else if (strcmp($1, "bypassrls") == 0)
- $$ = makeDefElem("bypassrls", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("bypassrls", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nobypassrls") == 0)
- $$ = makeDefElem("bypassrls", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("bypassrls", (Node *)makeInteger(false), @1);
else if (strcmp($1, "noinherit") == 0)
{
/*
* Note that INHERIT is a keyword, so it's handled by main parser, but
* NOINHERIT is handled here.
*/
- $$ = makeDefElem("inherit", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("inherit", (Node *)makeInteger(false), @1);
}
else
ereport(ERROR,
DROP ROLE role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->roles = $3;
$$ = (Node *)n;
}
| DROP ROLE IF_P EXISTS role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->roles = $5;
$$ = (Node *)n;
}
| DROP USER role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->roles = $3;
$$ = (Node *)n;
}
{
DropRoleStmt *n = makeNode(DropRoleStmt);
n->roles = $5;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
| DROP GROUP_P role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->roles = $3;
$$ = (Node *)n;
}
| DROP GROUP_P IF_P EXISTS role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->roles = $5;
$$ = (Node *)n;
}
;
constraints_set_mode:
- DEFERRED { $$ = TRUE; }
- | IMMEDIATE { $$ = FALSE; }
+ DEFERRED { $$ = true; }
+ | IMMEDIATE { $$ = false; }
;
n->missing_ok = true;
$$ = (Node *)n;
}
+ | ALTER INDEX qualified_name index_partition_cmd
+ {
+ AlterTableStmt *n = makeNode(AlterTableStmt);
+ n->relation = $3;
+ n->cmds = list_make1($4);
+ n->relkind = OBJECT_INDEX;
+ n->missing_ok = false;
+ $$ = (Node *)n;
+ }
| ALTER INDEX ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait
{
AlterTableMoveAllStmt *n =
partition_cmd:
/* ALTER TABLE <name> ATTACH PARTITION <table_name> FOR VALUES */
- ATTACH PARTITION qualified_name ForValues
+ ATTACH PARTITION qualified_name PartitionBoundSpec
{
AlterTableCmd *n = makeNode(AlterTableCmd);
PartitionCmd *cmd = makeNode(PartitionCmd);
}
;
+index_partition_cmd:
+ /* ALTER INDEX <name> ATTACH PARTITION <index_name> */
+ ATTACH PARTITION qualified_name
+ {
+ AlterTableCmd *n = makeNode(AlterTableCmd);
+ PartitionCmd *cmd = makeNode(PartitionCmd);
+
+ n->subtype = AT_AttachPartition;
+ cmd->name = $3;
+ cmd->bound = NULL;
+ n->def = (Node *) cmd;
+
+ $$ = (Node *) n;
+ }
+ ;
+
alter_table_cmd:
/* ALTER TABLE <name> ADD <coldef> */
ADD_P columnDef
n->def = (Node *) makeInteger($6);
$$ = (Node *)n;
}
+ /* ALTER TABLE <name> ALTER [COLUMN] <colnum> SET STATISTICS <SignedIconst> */
+ | ALTER opt_column Iconst SET STATISTICS SignedIconst
+ {
+ AlterTableCmd *n = makeNode(AlterTableCmd);
+
+ if ($3 <= 0 || $3 > PG_INT16_MAX)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("column number must be in range from 1 to %d", PG_INT16_MAX),
+ parser_errposition(@3)));
+
+ n->subtype = AT_SetStatistics;
+ n->num = (int16) $3;
+ n->def = (Node *) makeInteger($6);
+ $$ = (Node *)n;
+ }
/* ALTER TABLE <name> ALTER [COLUMN] <colname> SET ( column_parameter = value [, ... ] ) */
| ALTER opt_column ColId SET reloptions
{
n->subtype = AT_DropColumn;
n->name = $5;
n->behavior = $6;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
/* ALTER TABLE <name> DROP [COLUMN] <colname> [RESTRICT|CASCADE] */
n->subtype = AT_DropColumn;
n->name = $3;
n->behavior = $4;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
$$ = (Node *)n;
}
/*
n->subtype = AT_DropConstraint;
n->name = $5;
n->behavior = $6;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
/* ALTER TABLE <name> DROP CONSTRAINT <name> [RESTRICT|CASCADE] */
n->subtype = AT_DropConstraint;
n->name = $3;
n->behavior = $4;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
$$ = (Node *)n;
}
/* ALTER TABLE <name> SET WITH OIDS */
}
;
-ForValues:
+PartitionBoundSpec:
+ /* a HASH partition*/
+ FOR VALUES WITH '(' hash_partbound ')'
+ {
+ ListCell *lc;
+ PartitionBoundSpec *n = makeNode(PartitionBoundSpec);
+
+ n->strategy = PARTITION_STRATEGY_HASH;
+ n->modulus = n->remainder = -1;
+
+ foreach (lc, $5)
+ {
+ DefElem *opt = lfirst_node(DefElem, lc);
+
+ if (strcmp(opt->defname, "modulus") == 0)
+ {
+ if (n->modulus != -1)
+ ereport(ERROR,
+ (errcode(ERRCODE_DUPLICATE_OBJECT),
+ errmsg("modulus for hash partition provided more than once"),
+ parser_errposition(opt->location)));
+ n->modulus = defGetInt32(opt);
+ }
+ else if (strcmp(opt->defname, "remainder") == 0)
+ {
+ if (n->remainder != -1)
+ ereport(ERROR,
+ (errcode(ERRCODE_DUPLICATE_OBJECT),
+ errmsg("remainder for hash partition provided more than once"),
+ parser_errposition(opt->location)));
+ n->remainder = defGetInt32(opt);
+ }
+ else
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("unrecognized hash partition bound specification \"%s\"",
+ opt->defname),
+ parser_errposition(opt->location)));
+ }
+
+ if (n->modulus == -1)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("modulus for hash partition must be specified")));
+ if (n->remainder == -1)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("remainder for hash partition must be specified")));
+
+ n->location = @3;
+
+ $$ = n;
+ }
+
/* a LIST partition */
- FOR VALUES IN_P '(' partbound_datum_list ')'
+ | FOR VALUES IN_P '(' partbound_datum_list ')'
{
PartitionBoundSpec *n = makeNode(PartitionBoundSpec);
n->strategy = PARTITION_STRATEGY_LIST;
+ n->is_default = false;
n->listdatums = $5;
n->location = @3;
PartitionBoundSpec *n = makeNode(PartitionBoundSpec);
n->strategy = PARTITION_STRATEGY_RANGE;
+ n->is_default = false;
n->lowerdatums = $5;
n->upperdatums = $9;
n->location = @3;
+ $$ = n;
+ }
+
+ /* a DEFAULT partition */
+ | DEFAULT
+ {
+ PartitionBoundSpec *n = makeNode(PartitionBoundSpec);
+
+ n->is_default = true;
+ n->location = @1;
+
$$ = n;
}
;
+hash_partbound_elem:
+ NonReservedWord Iconst
+ {
+ $$ = makeDefElem($1, (Node *)makeInteger($2), @1);
+ }
+ ;
+
+hash_partbound:
+ hash_partbound_elem
+ {
+ $$ = list_make1($1);
+ }
+ | hash_partbound ',' hash_partbound_elem
+ {
+ $$ = lappend($1, $3);
+ }
+ ;
+
partbound_datum:
Sconst { $$ = makeStringConst($1, @1); }
| NumericOnly { $$ = makeAConst($1, @1); }
+ | TRUE_P { $$ = makeStringConst(pstrdup("true"), @1); }
+ | FALSE_P { $$ = makeStringConst(pstrdup("false"), @1); }
| NULL_P { $$ = makeNullAConst(@1); }
;
n->subtype = AT_DropColumn;
n->name = $5;
n->behavior = $6;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
/* ALTER TYPE <name> DROP ATTRIBUTE <attname> [RESTRICT|CASCADE] */
n->subtype = AT_DropColumn;
n->name = $3;
n->behavior = $4;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
$$ = (Node *)n;
}
/* ALTER TYPE <name> ALTER ATTRIBUTE <attname> [SET DATA] TYPE <typename> [RESTRICT|CASCADE] */
;
copy_from:
- FROM { $$ = TRUE; }
- | TO { $$ = FALSE; }
+ FROM { $$ = true; }
+ | TO { $$ = false; }
;
opt_program:
- PROGRAM { $$ = TRUE; }
- | /* EMPTY */ { $$ = FALSE; }
+ PROGRAM { $$ = true; }
+ | /* EMPTY */ { $$ = false; }
;
/*
}
| OIDS
{
- $$ = makeDefElem("oids", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("oids", (Node *)makeInteger(true), @1);
}
| FREEZE
{
- $$ = makeDefElem("freeze", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("freeze", (Node *)makeInteger(true), @1);
}
| DELIMITER opt_as Sconst
{
}
| HEADER_P
{
- $$ = makeDefElem("header", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("header", (Node *)makeInteger(true), @1);
}
| QUOTE opt_as Sconst
{
opt_oids:
WITH OIDS
{
- $$ = makeDefElem("oids", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("oids", (Node *)makeInteger(true), @1);
}
| /*EMPTY*/ { $$ = NULL; }
;
$$ = (Node *)n;
}
| CREATE OptTemp TABLE qualified_name PARTITION OF qualified_name
- OptTypedTableElementList ForValues OptPartitionSpec OptWith
+ OptTypedTableElementList PartitionBoundSpec OptPartitionSpec OptWith
OnCommitOption OptTableSpace
{
CreateStmt *n = makeNode(CreateStmt);
$$ = (Node *)n;
}
| CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name PARTITION OF
- qualified_name OptTypedTableElementList ForValues OptPartitionSpec
+ qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec
OptWith OnCommitOption OptTableSpace
{
CreateStmt *n = makeNode(CreateStmt);
;
TableLikeOption:
- DEFAULTS { $$ = CREATE_TABLE_LIKE_DEFAULTS; }
+ COMMENTS { $$ = CREATE_TABLE_LIKE_COMMENTS; }
| CONSTRAINTS { $$ = CREATE_TABLE_LIKE_CONSTRAINTS; }
+ | DEFAULTS { $$ = CREATE_TABLE_LIKE_DEFAULTS; }
| IDENTITY_P { $$ = CREATE_TABLE_LIKE_IDENTITY; }
| INDEXES { $$ = CREATE_TABLE_LIKE_INDEXES; }
+ | STATISTICS { $$ = CREATE_TABLE_LIKE_STATISTICS; }
| STORAGE { $$ = CREATE_TABLE_LIKE_STORAGE; }
- | COMMENTS { $$ = CREATE_TABLE_LIKE_COMMENTS; }
| ALL { $$ = CREATE_TABLE_LIKE_ALL; }
;
n->initially_valid = !n->skip_validation;
$$ = (Node *)n;
}
- | UNIQUE '(' columnList ')' opt_definition OptConsTableSpace
+ | UNIQUE '(' columnList ')' opt_c_include opt_definition OptConsTableSpace
ConstraintAttributeSpec
{
Constraint *n = makeNode(Constraint);
n->contype = CONSTR_UNIQUE;
n->location = @1;
n->keys = $3;
- n->options = $5;
+ n->including = $5;
+ n->options = $6;
n->indexname = NULL;
- n->indexspace = $6;
- processCASbits($7, @7, "UNIQUE",
+ n->indexspace = $7;
+ processCASbits($8, @8, "UNIQUE",
&n->deferrable, &n->initdeferred, NULL,
NULL, yyscanner);
$$ = (Node *)n;
n->contype = CONSTR_UNIQUE;
n->location = @1;
n->keys = NIL;
+ n->including = NIL;
n->options = NIL;
n->indexname = $2;
n->indexspace = NULL;
NULL, yyscanner);
$$ = (Node *)n;
}
- | PRIMARY KEY '(' columnList ')' opt_definition OptConsTableSpace
+ | PRIMARY KEY '(' columnList ')' opt_c_include opt_definition OptConsTableSpace
ConstraintAttributeSpec
{
Constraint *n = makeNode(Constraint);
n->contype = CONSTR_PRIMARY;
n->location = @1;
n->keys = $4;
- n->options = $6;
+ n->including = $6;
+ n->options = $7;
n->indexname = NULL;
- n->indexspace = $7;
- processCASbits($8, @8, "PRIMARY KEY",
+ n->indexspace = $8;
+ processCASbits($9, @9, "PRIMARY KEY",
&n->deferrable, &n->initdeferred, NULL,
NULL, yyscanner);
$$ = (Node *)n;
n->contype = CONSTR_PRIMARY;
n->location = @1;
n->keys = NIL;
+ n->including = NIL;
n->options = NIL;
n->indexname = $3;
n->indexspace = NULL;
$$ = (Node *)n;
}
| EXCLUDE access_method_clause '(' ExclusionConstraintList ')'
- opt_definition OptConsTableSpace ExclusionWhereClause
+ opt_c_include opt_definition OptConsTableSpace ExclusionWhereClause
ConstraintAttributeSpec
{
Constraint *n = makeNode(Constraint);
n->location = @1;
n->access_method = $2;
n->exclusions = $4;
- n->options = $6;
+ n->including = $6;
+ n->options = $7;
n->indexname = NULL;
- n->indexspace = $7;
- n->where_clause = $8;
- processCASbits($9, @9, "EXCLUDE",
+ n->indexspace = $8;
+ n->where_clause = $9;
+ processCASbits($10, @10, "EXCLUDE",
&n->deferrable, &n->initdeferred, NULL,
NULL, yyscanner);
$$ = (Node *)n;
}
;
-opt_no_inherit: NO INHERIT { $$ = TRUE; }
- | /* EMPTY */ { $$ = FALSE; }
+opt_no_inherit: NO INHERIT { $$ = true; }
+ | /* EMPTY */ { $$ = false; }
;
opt_column_list:
}
;
+opt_c_include: INCLUDE '(' columnList ')' { $$ = $3; }
+ | /* EMPTY */ { $$ = NIL; }
+ ;
+
key_match: MATCH FULL
{
$$ = FKCONSTR_MATCH_FULL;
n->stat_types = $4;
n->exprs = $6;
n->relations = $8;
+ n->stxcomment = NULL;
n->if_not_exists = false;
$$ = (Node *)n;
}
n->stat_types = $7;
n->exprs = $9;
n->relations = $11;
+ n->stxcomment = NULL;
n->if_not_exists = true;
$$ = (Node *)n;
}
;
opt_with_data:
- WITH DATA_P { $$ = TRUE; }
- | WITH NO DATA_P { $$ = FALSE; }
- | /*EMPTY*/ { $$ = TRUE; }
+ WITH DATA_P { $$ = true; }
+ | WITH NO DATA_P { $$ = false; }
+ | /*EMPTY*/ { $$ = true; }
;
}
| CYCLE
{
- $$ = makeDefElem("cycle", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("cycle", (Node *)makeInteger(true), @1);
}
| NO CYCLE
{
- $$ = makeDefElem("cycle", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("cycle", (Node *)makeInteger(false), @1);
}
| INCREMENT opt_by NumericOnly
{
;
opt_trusted:
- TRUSTED { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ TRUSTED { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
/* This ought to be just func_name, but that causes reduce/reduce conflicts
}
| CASCADE
{
- $$ = makeDefElem("cascade", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("cascade", (Node *)makeInteger(true), @1);
}
;
n->object = (Node *) lcons(makeString($9), $7);
$$ = (Node *)n;
}
+ | ALTER EXTENSION name add_drop PROCEDURE function_with_argtypes
+ {
+ AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
+ n->extname = $3;
+ n->action = $4;
+ n->objtype = OBJECT_PROCEDURE;
+ n->object = (Node *) $6;
+ $$ = (Node *)n;
+ }
+ | ALTER EXTENSION name add_drop ROUTINE function_with_argtypes
+ {
+ AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
+ n->extname = $3;
+ n->action = $4;
+ n->objtype = OBJECT_ROUTINE;
+ n->object = (Node *) $6;
+ $$ = (Node *)n;
+ }
| ALTER EXTENSION name add_drop SCHEMA name
{
AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
$$ = (Node *) n;
}
| CREATE FOREIGN TABLE qualified_name
- PARTITION OF qualified_name OptTypedTableElementList ForValues
+ PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec
SERVER name create_generic_options
{
CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt);
$$ = (Node *) n;
}
| CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name
- PARTITION OF qualified_name OptTypedTableElementList ForValues
+ PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec
SERVER name create_generic_options
{
CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt);
n->columns = (List *) lsecond($5);
n->whenClause = $10;
n->transitionRels = $8;
- n->isconstraint = FALSE;
- n->deferrable = FALSE;
- n->initdeferred = FALSE;
+ n->isconstraint = false;
+ n->deferrable = false;
+ n->initdeferred = false;
n->constrrel = NULL;
$$ = (Node *)n;
}
n->relation = $8;
n->funcname = $17;
n->args = $19;
- n->row = TRUE;
+ n->row = true;
n->timing = TRIGGER_TYPE_AFTER;
n->events = intVal(linitial($6));
n->columns = (List *) lsecond($6);
n->whenClause = $14;
n->transitionRels = NIL;
- n->isconstraint = TRUE;
+ n->isconstraint = true;
processCASbits($10, @10, "TRIGGER",
&n->deferrable, &n->initdeferred, NULL,
NULL, yyscanner);
;
TransitionOldOrNew:
- NEW { $$ = TRUE; }
- | OLD { $$ = FALSE; }
+ NEW { $$ = true; }
+ | OLD { $$ = false; }
;
TransitionRowOrTable:
- TABLE { $$ = TRUE; }
+ TABLE { $$ = true; }
/*
* According to the standard, lack of a keyword here implies ROW.
* Support for that would require prohibiting ROW entirely here,
* next token. Requiring ROW seems cleanest and easiest to
* explain.
*/
- | ROW { $$ = FALSE; }
+ | ROW { $$ = false; }
;
TransitionRelName:
* If ROW/STATEMENT not specified, default to
* STATEMENT, per SQL
*/
- $$ = FALSE;
+ $$ = false;
}
;
;
TriggerForType:
- ROW { $$ = TRUE; }
- | STATEMENT { $$ = FALSE; }
+ ROW { $$ = true; }
+ | STATEMENT { $$ = false; }
;
TriggerWhen:
CreateTrigStmt *n = makeNode(CreateTrigStmt);
n->trigname = $3;
n->args = list_make1($6);
- n->isconstraint = TRUE;
+ n->isconstraint = true;
processCASbits($8, @8, "ASSERTION",
&n->deferrable, &n->initdeferred, NULL,
NULL, yyscanner);
}
;
-opt_default: DEFAULT { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_default: DEFAULT { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_opfamily: FAMILY any_name { $$ = $2; }
errmsg("RECHECK is no longer required"),
errhint("Update your data type."),
parser_errposition(@1)));
- $$ = TRUE;
+ $$ = true;
}
- | /*EMPTY*/ { $$ = FALSE; }
+ | /*EMPTY*/ { $$ = false; }
;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = $2;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $5;
n->behavior = $6;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = $2;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $3;
n->behavior = $4;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = $2;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $5;
n->behavior = $6;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = $2;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $3;
n->behavior = $4;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_TYPE;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $3;
n->behavior = $4;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_TYPE;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $5;
n->behavior = $6;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_DOMAIN;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $3;
n->behavior = $4;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_DOMAIN;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $5;
n->behavior = $6;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_INDEX;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $4;
n->behavior = $5;
n->concurrent = true;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_INDEX;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $6;
n->behavior = $7;
n->concurrent = true;
n->comment = $8;
$$ = (Node *) n;
}
+ | COMMENT ON PROCEDURE function_with_argtypes IS comment_text
+ {
+ CommentStmt *n = makeNode(CommentStmt);
+ n->objtype = OBJECT_PROCEDURE;
+ n->object = (Node *) $4;
+ n->comment = $6;
+ $$ = (Node *) n;
+ }
+ | COMMENT ON ROUTINE function_with_argtypes IS comment_text
+ {
+ CommentStmt *n = makeNode(CommentStmt);
+ n->objtype = OBJECT_ROUTINE;
+ n->object = (Node *) $4;
+ n->comment = $6;
+ $$ = (Node *) n;
+ }
| COMMENT ON RULE name ON any_name IS comment_text
{
CommentStmt *n = makeNode(CommentStmt);
n->label = $9;
$$ = (Node *) n;
}
+ | SECURITY LABEL opt_provider ON PROCEDURE function_with_argtypes
+ IS security_label
+ {
+ SecLabelStmt *n = makeNode(SecLabelStmt);
+ n->provider = $3;
+ n->objtype = OBJECT_PROCEDURE;
+ n->object = (Node *) $6;
+ n->label = $8;
+ $$ = (Node *) n;
+ }
+ | SECURITY LABEL opt_provider ON ROUTINE function_with_argtypes
+ IS security_label
+ {
+ SecLabelStmt *n = makeNode(SecLabelStmt);
+ n->provider = $3;
+ n->objtype = OBJECT_ROUTINE;
+ n->object = (Node *) $6;
+ n->label = $8;
+ $$ = (Node *) n;
+ }
;
opt_provider: FOR NonReservedWord_or_Sconst { $$ = $2; }
FetchStmt: FETCH fetch_args
{
FetchStmt *n = (FetchStmt *) $2;
- n->ismove = FALSE;
+ n->ismove = false;
$$ = (Node *)n;
}
| MOVE fetch_args
{
FetchStmt *n = (FetchStmt *) $2;
- n->ismove = TRUE;
+ n->ismove = true;
$$ = (Node *)n;
}
;
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_RELATION;
+ n->objtype = OBJECT_TABLE;
n->objs = $1;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_RELATION;
+ n->objtype = OBJECT_TABLE;
n->objs = $2;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_SEQUENCE;
+ n->objtype = OBJECT_SEQUENCE;
n->objs = $2;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_FDW;
+ n->objtype = OBJECT_FDW;
n->objs = $4;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_FOREIGN_SERVER;
+ n->objtype = OBJECT_FOREIGN_SERVER;
n->objs = $3;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_FUNCTION;
+ n->objtype = OBJECT_FUNCTION;
+ n->objs = $2;
+ $$ = n;
+ }
+ | PROCEDURE function_with_argtypes_list
+ {
+ PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
+ n->targtype = ACL_TARGET_OBJECT;
+ n->objtype = OBJECT_PROCEDURE;
+ n->objs = $2;
+ $$ = n;
+ }
+ | ROUTINE function_with_argtypes_list
+ {
+ PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
+ n->targtype = ACL_TARGET_OBJECT;
+ n->objtype = OBJECT_ROUTINE;
n->objs = $2;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_DATABASE;
+ n->objtype = OBJECT_DATABASE;
n->objs = $2;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_DOMAIN;
+ n->objtype = OBJECT_DOMAIN;
n->objs = $2;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_LANGUAGE;
+ n->objtype = OBJECT_LANGUAGE;
n->objs = $2;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_LARGEOBJECT;
+ n->objtype = OBJECT_LARGEOBJECT;
n->objs = $3;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_NAMESPACE;
+ n->objtype = OBJECT_SCHEMA;
n->objs = $2;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_TABLESPACE;
+ n->objtype = OBJECT_TABLESPACE;
n->objs = $2;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_OBJECT;
- n->objtype = ACL_OBJECT_TYPE;
+ n->objtype = OBJECT_TYPE;
n->objs = $2;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_ALL_IN_SCHEMA;
- n->objtype = ACL_OBJECT_RELATION;
+ n->objtype = OBJECT_TABLE;
n->objs = $5;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_ALL_IN_SCHEMA;
- n->objtype = ACL_OBJECT_SEQUENCE;
+ n->objtype = OBJECT_SEQUENCE;
n->objs = $5;
$$ = n;
}
{
PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
n->targtype = ACL_TARGET_ALL_IN_SCHEMA;
- n->objtype = ACL_OBJECT_FUNCTION;
+ n->objtype = OBJECT_FUNCTION;
+ n->objs = $5;
+ $$ = n;
+ }
+ | ALL PROCEDURES IN_P SCHEMA name_list
+ {
+ PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
+ n->targtype = ACL_TARGET_ALL_IN_SCHEMA;
+ n->objtype = OBJECT_PROCEDURE;
+ n->objs = $5;
+ $$ = n;
+ }
+ | ALL ROUTINES IN_P SCHEMA name_list
+ {
+ PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
+ n->targtype = ACL_TARGET_ALL_IN_SCHEMA;
+ n->objtype = OBJECT_ROUTINE;
n->objs = $5;
$$ = n;
}
opt_grant_grant_option:
- WITH GRANT OPTION { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ WITH GRANT OPTION { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
/*****************************************************************************
}
;
-opt_grant_admin_option: WITH ADMIN OPTION { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_grant_admin_option: WITH ADMIN OPTION { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_granted_by: GRANTED BY RoleSpec { $$ = $3; }
;
defacl_privilege_target:
- TABLES { $$ = ACL_OBJECT_RELATION; }
- | FUNCTIONS { $$ = ACL_OBJECT_FUNCTION; }
- | SEQUENCES { $$ = ACL_OBJECT_SEQUENCE; }
- | TYPES_P { $$ = ACL_OBJECT_TYPE; }
- | SCHEMAS { $$ = ACL_OBJECT_NAMESPACE; }
+ TABLES { $$ = OBJECT_TABLE; }
+ | FUNCTIONS { $$ = OBJECT_FUNCTION; }
+ | ROUTINES { $$ = OBJECT_FUNCTION; }
+ | SEQUENCES { $$ = OBJECT_SEQUENCE; }
+ | TYPES_P { $$ = OBJECT_TYPE; }
+ | SCHEMAS { $$ = OBJECT_SCHEMA; }
;
*****************************************************************************/
IndexStmt: CREATE opt_unique INDEX opt_concurrently opt_index_name
- ON qualified_name access_method_clause '(' index_params ')'
- opt_reloptions OptTableSpace where_clause
+ ON relation_expr access_method_clause '(' index_params ')'
+ opt_include opt_reloptions OptTableSpace where_clause
{
IndexStmt *n = makeNode(IndexStmt);
n->unique = $2;
n->concurrent = $4;
n->idxname = $5;
n->relation = $7;
+ n->relationId = InvalidOid;
n->accessMethod = $8;
n->indexParams = $10;
- n->options = $12;
- n->tableSpace = $13;
- n->whereClause = $14;
+ n->indexIncludingParams = $12;
+ n->options = $13;
+ n->tableSpace = $14;
+ n->whereClause = $15;
n->excludeOpNames = NIL;
n->idxcomment = NULL;
n->indexOid = InvalidOid;
$$ = (Node *)n;
}
| CREATE opt_unique INDEX opt_concurrently IF_P NOT EXISTS index_name
- ON qualified_name access_method_clause '(' index_params ')'
- opt_reloptions OptTableSpace where_clause
+ ON relation_expr access_method_clause '(' index_params ')'
+ opt_include opt_reloptions OptTableSpace where_clause
{
IndexStmt *n = makeNode(IndexStmt);
n->unique = $2;
n->concurrent = $4;
n->idxname = $8;
n->relation = $10;
+ n->relationId = InvalidOid;
n->accessMethod = $11;
n->indexParams = $13;
- n->options = $15;
- n->tableSpace = $16;
- n->whereClause = $17;
+ n->indexIncludingParams = $15;
+ n->options = $16;
+ n->tableSpace = $17;
+ n->whereClause = $18;
n->excludeOpNames = NIL;
n->idxcomment = NULL;
n->indexOid = InvalidOid;
;
opt_unique:
- UNIQUE { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ UNIQUE { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_concurrently:
- CONCURRENTLY { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ CONCURRENTLY { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_index_name:
}
;
+opt_include: INCLUDE '(' index_including_params ')' { $$ = $3; }
+ | /* EMPTY */ { $$ = NIL; }
+ ;
+
+index_including_params: index_elem { $$ = list_make1($1); }
+ | index_including_params ',' index_elem { $$ = lappend($1, $3); }
+ ;
+
opt_collate: COLLATE any_name { $$ = $2; }
| /*EMPTY*/ { $$ = NIL; }
;
CreateFunctionStmt:
CREATE opt_or_replace FUNCTION func_name func_args_with_defaults
- RETURNS func_return createfunc_opt_list opt_definition
+ RETURNS func_return createfunc_opt_list
{
CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
+ n->is_procedure = false;
n->replace = $2;
n->funcname = $4;
n->parameters = $5;
n->returnType = $7;
n->options = $8;
- n->withClause = $9;
$$ = (Node *)n;
}
| CREATE opt_or_replace FUNCTION func_name func_args_with_defaults
- RETURNS TABLE '(' table_func_column_list ')' createfunc_opt_list opt_definition
+ RETURNS TABLE '(' table_func_column_list ')' createfunc_opt_list
{
CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
+ n->is_procedure = false;
n->replace = $2;
n->funcname = $4;
n->parameters = mergeTableFuncParameters($5, $9);
n->returnType = TableFuncTypeName($9);
n->returnType->location = @7;
n->options = $11;
- n->withClause = $12;
$$ = (Node *)n;
}
| CREATE opt_or_replace FUNCTION func_name func_args_with_defaults
- createfunc_opt_list opt_definition
+ createfunc_opt_list
+ {
+ CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
+ n->is_procedure = false;
+ n->replace = $2;
+ n->funcname = $4;
+ n->parameters = $5;
+ n->returnType = NULL;
+ n->options = $6;
+ $$ = (Node *)n;
+ }
+ | CREATE opt_or_replace PROCEDURE func_name func_args_with_defaults
+ createfunc_opt_list
{
CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
+ n->is_procedure = true;
n->replace = $2;
n->funcname = $4;
n->parameters = $5;
n->returnType = NULL;
n->options = $6;
- n->withClause = $7;
$$ = (Node *)n;
}
;
opt_or_replace:
- OR REPLACE { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ OR REPLACE { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
func_args: '(' func_args_list ')' { $$ = $2; }
{
$$ = makeTypeNameFromNameList(lcons(makeString($2), $3));
$$->pct_type = true;
- $$->setof = TRUE;
+ $$->setof = true;
$$->location = @2;
}
;
common_func_opt_item:
CALLED ON NULL_P INPUT_P
{
- $$ = makeDefElem("strict", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("strict", (Node *)makeInteger(false), @1);
}
| RETURNS NULL_P ON NULL_P INPUT_P
{
- $$ = makeDefElem("strict", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("strict", (Node *)makeInteger(true), @1);
}
| STRICT_P
{
- $$ = makeDefElem("strict", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("strict", (Node *)makeInteger(true), @1);
}
| IMMUTABLE
{
}
| EXTERNAL SECURITY DEFINER
{
- $$ = makeDefElem("security", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("security", (Node *)makeInteger(true), @1);
}
| EXTERNAL SECURITY INVOKER
{
- $$ = makeDefElem("security", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("security", (Node *)makeInteger(false), @1);
}
| SECURITY DEFINER
{
- $$ = makeDefElem("security", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("security", (Node *)makeInteger(true), @1);
}
| SECURITY INVOKER
{
- $$ = makeDefElem("security", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("security", (Node *)makeInteger(false), @1);
}
| LEAKPROOF
{
- $$ = makeDefElem("leakproof", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("leakproof", (Node *)makeInteger(true), @1);
}
| NOT LEAKPROOF
{
- $$ = makeDefElem("leakproof", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("leakproof", (Node *)makeInteger(false), @1);
}
| COST NumericOnly
{
}
| WINDOW
{
- $$ = makeDefElem("window", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("window", (Node *)makeInteger(true), @1);
}
| common_func_opt_item
{
;
/*****************************************************************************
- * ALTER FUNCTION
+ * ALTER FUNCTION / ALTER PROCEDURE / ALTER ROUTINE
*
* RENAME and OWNER subcommands are already provided by the generic
* ALTER infrastructure, here we just specify alterations that can
ALTER FUNCTION function_with_argtypes alterfunc_opt_list opt_restrict
{
AlterFunctionStmt *n = makeNode(AlterFunctionStmt);
+ n->objtype = OBJECT_FUNCTION;
+ n->func = $3;
+ n->actions = $4;
+ $$ = (Node *) n;
+ }
+ | ALTER PROCEDURE function_with_argtypes alterfunc_opt_list opt_restrict
+ {
+ AlterFunctionStmt *n = makeNode(AlterFunctionStmt);
+ n->objtype = OBJECT_PROCEDURE;
+ n->func = $3;
+ n->actions = $4;
+ $$ = (Node *) n;
+ }
+ | ALTER ROUTINE function_with_argtypes alterfunc_opt_list opt_restrict
+ {
+ AlterFunctionStmt *n = makeNode(AlterFunctionStmt);
+ n->objtype = OBJECT_ROUTINE;
n->func = $3;
n->actions = $4;
$$ = (Node *) n;
* QUERY:
*
* DROP FUNCTION funcname (arg1, arg2, ...) [ RESTRICT | CASCADE ]
+ * DROP PROCEDURE procname (arg1, arg2, ...) [ RESTRICT | CASCADE ]
+ * DROP ROUTINE routname (arg1, arg2, ...) [ RESTRICT | CASCADE ]
* DROP AGGREGATE aggname (arg1, ...) [ RESTRICT | CASCADE ]
* DROP OPERATOR opname (leftoperand_typ, rightoperand_typ) [ RESTRICT | CASCADE ]
*
n->concurrent = false;
$$ = (Node *)n;
}
+ | DROP PROCEDURE function_with_argtypes_list opt_drop_behavior
+ {
+ DropStmt *n = makeNode(DropStmt);
+ n->removeType = OBJECT_PROCEDURE;
+ n->objects = $3;
+ n->behavior = $4;
+ n->missing_ok = false;
+ n->concurrent = false;
+ $$ = (Node *)n;
+ }
+ | DROP PROCEDURE IF_P EXISTS function_with_argtypes_list opt_drop_behavior
+ {
+ DropStmt *n = makeNode(DropStmt);
+ n->removeType = OBJECT_PROCEDURE;
+ n->objects = $5;
+ n->behavior = $6;
+ n->missing_ok = true;
+ n->concurrent = false;
+ $$ = (Node *)n;
+ }
+ | DROP ROUTINE function_with_argtypes_list opt_drop_behavior
+ {
+ DropStmt *n = makeNode(DropStmt);
+ n->removeType = OBJECT_ROUTINE;
+ n->objects = $3;
+ n->behavior = $4;
+ n->missing_ok = false;
+ n->concurrent = false;
+ $$ = (Node *)n;
+ }
+ | DROP ROUTINE IF_P EXISTS function_with_argtypes_list opt_drop_behavior
+ {
+ DropStmt *n = makeNode(DropStmt);
+ n->removeType = OBJECT_ROUTINE;
+ n->objects = $5;
+ n->behavior = $6;
+ n->missing_ok = true;
+ n->concurrent = false;
+ $$ = (Node *)n;
+ }
;
RemoveAggrStmt:
}
;
-opt_if_exists: IF_P EXISTS { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_if_exists: IF_P EXISTS { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
makeNode(AlterTableSpaceOptionsStmt);
n->tablespacename = $3;
n->options = $5;
- n->isReset = FALSE;
+ n->isReset = false;
$$ = (Node *)n;
}
| ALTER TABLESPACE name RESET reloptions
makeNode(AlterTableSpaceOptionsStmt);
n->tablespacename = $3;
n->options = $5;
- n->isReset = TRUE;
+ n->isReset = true;
$$ = (Node *)n;
}
;
n->missing_ok = true;
$$ = (Node *)n;
}
+ | ALTER PROCEDURE function_with_argtypes RENAME TO name
+ {
+ RenameStmt *n = makeNode(RenameStmt);
+ n->renameType = OBJECT_PROCEDURE;
+ n->object = (Node *) $3;
+ n->newname = $6;
+ n->missing_ok = false;
+ $$ = (Node *)n;
+ }
| ALTER PUBLICATION name RENAME TO name
{
RenameStmt *n = makeNode(RenameStmt);
n->missing_ok = false;
$$ = (Node *)n;
}
+ | ALTER ROUTINE function_with_argtypes RENAME TO name
+ {
+ RenameStmt *n = makeNode(RenameStmt);
+ n->renameType = OBJECT_ROUTINE;
+ n->object = (Node *) $3;
+ n->newname = $6;
+ n->missing_ok = false;
+ $$ = (Node *)n;
+ }
| ALTER SCHEMA name RENAME TO name
{
RenameStmt *n = makeNode(RenameStmt);
n->extname = makeString($7);
$$ = (Node *)n;
}
+ | ALTER PROCEDURE function_with_argtypes DEPENDS ON EXTENSION name
+ {
+ AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
+ n->objectType = OBJECT_PROCEDURE;
+ n->object = (Node *) $3;
+ n->extname = makeString($7);
+ $$ = (Node *)n;
+ }
+ | ALTER ROUTINE function_with_argtypes DEPENDS ON EXTENSION name
+ {
+ AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
+ n->objectType = OBJECT_ROUTINE;
+ n->object = (Node *) $3;
+ n->extname = makeString($7);
+ $$ = (Node *)n;
+ }
| ALTER TRIGGER name ON qualified_name DEPENDS ON EXTENSION name
{
AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
n->missing_ok = false;
$$ = (Node *)n;
}
+ | ALTER PROCEDURE function_with_argtypes SET SCHEMA name
+ {
+ AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
+ n->objectType = OBJECT_PROCEDURE;
+ n->object = (Node *) $3;
+ n->newschema = $6;
+ n->missing_ok = false;
+ $$ = (Node *)n;
+ }
+ | ALTER ROUTINE function_with_argtypes SET SCHEMA name
+ {
+ AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
+ n->objectType = OBJECT_ROUTINE;
+ n->object = (Node *) $3;
+ n->newschema = $6;
+ n->missing_ok = false;
+ $$ = (Node *)n;
+ }
| ALTER TABLE relation_expr SET SCHEMA name
{
AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
n->newowner = $9;
$$ = (Node *)n;
}
+ | ALTER PROCEDURE function_with_argtypes OWNER TO RoleSpec
+ {
+ AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
+ n->objectType = OBJECT_PROCEDURE;
+ n->object = (Node *) $3;
+ n->newowner = $6;
+ $$ = (Node *)n;
+ }
+ | ALTER ROUTINE function_with_argtypes OWNER TO RoleSpec
+ {
+ AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
+ n->objectType = OBJECT_ROUTINE;
+ n->object = (Node *) $3;
+ n->newowner = $6;
+ $$ = (Node *)n;
+ }
| ALTER SCHEMA name OWNER TO RoleSpec
{
AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
n->tables = (List *)$4;
/* FOR ALL TABLES */
else
- n->for_all_tables = TRUE;
+ n->for_all_tables = true;
}
$$ = (Node *)n;
}
}
| FOR ALL TABLES
{
- $$ = (Node *) makeInteger(TRUE);
+ $$ = (Node *) makeInteger(true);
}
;
n->kind = ALTER_SUBSCRIPTION_ENABLED;
n->subname = $3;
n->options = list_make1(makeDefElem("enabled",
- (Node *)makeInteger(TRUE), @1));
+ (Node *)makeInteger(true), @1));
$$ = (Node *)n;
}
| ALTER SUBSCRIPTION name DISABLE_P
n->kind = ALTER_SUBSCRIPTION_ENABLED;
n->subname = $3;
n->options = list_make1(makeDefElem("enabled",
- (Node *)makeInteger(FALSE), @1));
+ (Node *)makeInteger(false), @1));
$$ = (Node *)n;
}
;
;
opt_instead:
- INSTEAD { $$ = TRUE; }
- | ALSO { $$ = FALSE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ INSTEAD { $$ = true; }
+ | ALSO { $$ = false; }
+ | /*EMPTY*/ { $$ = false; }
;
{
TransactionStmt *n = makeNode(TransactionStmt);
n->kind = TRANS_STMT_SAVEPOINT;
- n->options = list_make1(makeDefElem("savepoint_name",
- (Node *)makeString($2), @1));
+ n->savepoint_name = $2;
$$ = (Node *)n;
}
| RELEASE SAVEPOINT ColId
{
TransactionStmt *n = makeNode(TransactionStmt);
n->kind = TRANS_STMT_RELEASE;
- n->options = list_make1(makeDefElem("savepoint_name",
- (Node *)makeString($3), @1));
+ n->savepoint_name = $3;
$$ = (Node *)n;
}
| RELEASE ColId
{
TransactionStmt *n = makeNode(TransactionStmt);
n->kind = TRANS_STMT_RELEASE;
- n->options = list_make1(makeDefElem("savepoint_name",
- (Node *)makeString($2), @1));
+ n->savepoint_name = $2;
$$ = (Node *)n;
}
| ROLLBACK opt_transaction TO SAVEPOINT ColId
{
TransactionStmt *n = makeNode(TransactionStmt);
n->kind = TRANS_STMT_ROLLBACK_TO;
- n->options = list_make1(makeDefElem("savepoint_name",
- (Node *)makeString($5), @1));
+ n->savepoint_name = $5;
$$ = (Node *)n;
}
| ROLLBACK opt_transaction TO ColId
{
TransactionStmt *n = makeNode(TransactionStmt);
n->kind = TRANS_STMT_ROLLBACK_TO;
- n->options = list_make1(makeDefElem("savepoint_name",
- (Node *)makeString($4), @1));
+ n->savepoint_name = $4;
$$ = (Node *)n;
}
| PREPARE TRANSACTION Sconst
makeStringConst($3, @3), @1); }
| READ ONLY
{ $$ = makeDefElem("transaction_read_only",
- makeIntConst(TRUE, @1), @1); }
+ makeIntConst(true, @1), @1); }
| READ WRITE
{ $$ = makeDefElem("transaction_read_only",
- makeIntConst(FALSE, @1), @1); }
+ makeIntConst(false, @1), @1); }
| DEFERRABLE
{ $$ = makeDefElem("transaction_deferrable",
- makeIntConst(TRUE, @1), @1); }
+ makeIntConst(true, @1), @1); }
| NOT DEFERRABLE
{ $$ = makeDefElem("transaction_deferrable",
- makeIntConst(FALSE, @1), @1); }
+ makeIntConst(false, @1), @1); }
;
/* Syntax with commas is SQL-spec, without commas is Postgres historical */
{
DropdbStmt *n = makeNode(DropdbStmt);
n->dbname = $3;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
$$ = (Node *)n;
}
| DROP DATABASE IF_P EXISTS database_name
{
DropdbStmt *n = makeNode(DropdbStmt);
n->dbname = $5;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
;
*
*****************************************************************************/
-VacuumStmt: VACUUM opt_full opt_freeze opt_verbose
- {
- VacuumStmt *n = makeNode(VacuumStmt);
- n->options = VACOPT_VACUUM;
- if ($2)
- n->options |= VACOPT_FULL;
- if ($3)
- n->options |= VACOPT_FREEZE;
- if ($4)
- n->options |= VACOPT_VERBOSE;
- n->relation = NULL;
- n->va_cols = NIL;
- $$ = (Node *)n;
- }
- | VACUUM opt_full opt_freeze opt_verbose qualified_name
+VacuumStmt: VACUUM opt_full opt_freeze opt_verbose opt_analyze opt_vacuum_relation_list
{
VacuumStmt *n = makeNode(VacuumStmt);
n->options = VACOPT_VACUUM;
n->options |= VACOPT_FREEZE;
if ($4)
n->options |= VACOPT_VERBOSE;
- n->relation = $5;
- n->va_cols = NIL;
- $$ = (Node *)n;
- }
- | VACUUM opt_full opt_freeze opt_verbose AnalyzeStmt
- {
- VacuumStmt *n = (VacuumStmt *) $5;
- n->options |= VACOPT_VACUUM;
- if ($2)
- n->options |= VACOPT_FULL;
- if ($3)
- n->options |= VACOPT_FREEZE;
- if ($4)
- n->options |= VACOPT_VERBOSE;
+ if ($5)
+ n->options |= VACOPT_ANALYZE;
+ n->rels = $6;
$$ = (Node *)n;
}
- | VACUUM '(' vacuum_option_list ')'
+ | VACUUM '(' vacuum_option_list ')' opt_vacuum_relation_list
{
VacuumStmt *n = makeNode(VacuumStmt);
n->options = VACOPT_VACUUM | $3;
- n->relation = NULL;
- n->va_cols = NIL;
- $$ = (Node *) n;
- }
- | VACUUM '(' vacuum_option_list ')' qualified_name opt_name_list
- {
- VacuumStmt *n = makeNode(VacuumStmt);
- n->options = VACOPT_VACUUM | $3;
- n->relation = $5;
- n->va_cols = $6;
- if (n->va_cols != NIL) /* implies analyze */
- n->options |= VACOPT_ANALYZE;
+ n->rels = $5;
$$ = (Node *) n;
}
;
}
;
-AnalyzeStmt:
- analyze_keyword opt_verbose
+AnalyzeStmt: analyze_keyword opt_verbose opt_vacuum_relation_list
{
VacuumStmt *n = makeNode(VacuumStmt);
n->options = VACOPT_ANALYZE;
if ($2)
n->options |= VACOPT_VERBOSE;
- n->relation = NULL;
- n->va_cols = NIL;
+ n->rels = $3;
$$ = (Node *)n;
}
- | analyze_keyword opt_verbose qualified_name opt_name_list
+ | analyze_keyword '(' analyze_option_list ')' opt_vacuum_relation_list
{
VacuumStmt *n = makeNode(VacuumStmt);
- n->options = VACOPT_ANALYZE;
- if ($2)
- n->options |= VACOPT_VERBOSE;
- n->relation = $3;
- n->va_cols = $4;
- $$ = (Node *)n;
+ n->options = VACOPT_ANALYZE | $3;
+ n->rels = $5;
+ $$ = (Node *) n;
}
;
+analyze_option_list:
+ analyze_option_elem { $$ = $1; }
+ | analyze_option_list ',' analyze_option_elem { $$ = $1 | $3; }
+ ;
+
+analyze_option_elem:
+ VERBOSE { $$ = VACOPT_VERBOSE; }
+ ;
+
analyze_keyword:
ANALYZE {}
| ANALYSE /* British */ {}
;
+opt_analyze:
+ analyze_keyword { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
+ ;
+
opt_verbose:
- VERBOSE { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ VERBOSE { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
-opt_full: FULL { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_full: FULL { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
-opt_freeze: FREEZE { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_freeze: FREEZE { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_name_list:
| /*EMPTY*/ { $$ = NIL; }
;
+vacuum_relation:
+ qualified_name opt_name_list
+ {
+ $$ = (Node *) makeVacuumRelation($1, InvalidOid, $2);
+ }
+ ;
+
+vacuum_relation_list:
+ vacuum_relation
+ { $$ = list_make1($1); }
+ | vacuum_relation_list ',' vacuum_relation
+ { $$ = lappend($1, $3); }
+ ;
+
+opt_vacuum_relation_list:
+ vacuum_relation_list { $$ = $1; }
+ | /*EMPTY*/ { $$ = NIL; }
+ ;
+
/*****************************************************************************
*
| ACCESS EXCLUSIVE { $$ = AccessExclusiveLock; }
;
-opt_nowait: NOWAIT { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_nowait: NOWAIT { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_nowait_or_skip:
;
all_or_distinct:
- ALL { $$ = TRUE; }
- | DISTINCT { $$ = FALSE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ ALL { $$ = true; }
+ | DISTINCT { $$ = false; }
+ | /*EMPTY*/ { $$ = false; }
;
/* We use (NIL) as a placeholder to indicate that all target expressions
parser_errposition(@1)));
}
/* SQL:2008 syntax */
- | FETCH first_or_next opt_select_fetch_first_value row_or_rows ONLY
+ /* to avoid shift/reduce conflicts, handle the optional value with
+ * a separate production rather than an opt_ expression. The fact
+ * that ONLY is fully reserved means that this way, we defer any
+ * decision about what rule reduces ROW or ROWS to the point where
+ * we can see the ONLY token in the lookahead slot.
+ */
+ | FETCH first_or_next select_fetch_first_value row_or_rows ONLY
{ $$ = $3; }
+ | FETCH first_or_next row_or_rows ONLY
+ { $$ = makeIntConst(1, -1); }
;
offset_clause:
OFFSET select_offset_value
{ $$ = $2; }
/* SQL:2008 syntax */
- | OFFSET select_offset_value2 row_or_rows
+ | OFFSET select_fetch_first_value row_or_rows
{ $$ = $2; }
;
/*
* Allowing full expressions without parentheses causes various parsing
- * problems with the trailing ROW/ROWS key words. SQL only calls for
- * constants, so we allow the rest only with parentheses. If omitted,
- * default to 1.
+ * problems with the trailing ROW/ROWS key words. SQL spec only calls for
+ * <simple value specification>, which is either a literal or a parameter (but
+ * an <SQL parameter reference> could be an identifier, bringing up conflicts
+ * with ROW/ROWS). We solve this by leveraging the presence of ONLY (see above)
+ * to determine whether the expression is missing rather than trying to make it
+ * optional in this rule.
+ *
+ * c_expr covers almost all the spec-required cases (and more), but it doesn't
+ * cover signed numeric literals, which are allowed by the spec. So we include
+ * those here explicitly. We need FCONST as well as ICONST because values that
+ * don't fit in the platform's "long", but do fit in bigint, should still be
+ * accepted here. (This is possible in 64-bit Windows as well as all 32-bit
+ * builds.)
*/
-opt_select_fetch_first_value:
- SignedIconst { $$ = makeIntConst($1, @1); }
- | '(' a_expr ')' { $$ = $2; }
- | /*EMPTY*/ { $$ = makeIntConst(1, -1); }
+select_fetch_first_value:
+ c_expr { $$ = $1; }
+ | '+' I_or_F_const
+ { $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, $2, @1); }
+ | '-' I_or_F_const
+ { $$ = doNegate($2, @1); }
;
-/*
- * Again, the trailing ROW/ROWS in this case prevent the full expression
- * syntax. c_expr is the best we can do.
- */
-select_offset_value2:
- c_expr { $$ = $1; }
+I_or_F_const:
+ Iconst { $$ = makeIntConst($1,@1); }
+ | FCONST { $$ = makeFloatConst($1,@1); }
;
/* noise words */
/* CROSS JOIN is same as unqualified inner join */
JoinExpr *n = makeNode(JoinExpr);
n->jointype = JOIN_INNER;
- n->isNatural = FALSE;
+ n->isNatural = false;
n->larg = $1;
n->rarg = $4;
n->usingClause = NIL;
{
JoinExpr *n = makeNode(JoinExpr);
n->jointype = $2;
- n->isNatural = FALSE;
+ n->isNatural = false;
n->larg = $1;
n->rarg = $4;
if ($5 != NULL && IsA($5, List))
/* letting join_type reduce to empty doesn't work */
JoinExpr *n = makeNode(JoinExpr);
n->jointype = JOIN_INNER;
- n->isNatural = FALSE;
+ n->isNatural = false;
n->larg = $1;
n->rarg = $3;
if ($4 != NULL && IsA($4, List))
{
JoinExpr *n = makeNode(JoinExpr);
n->jointype = $3;
- n->isNatural = TRUE;
+ n->isNatural = true;
n->larg = $1;
n->rarg = $5;
n->usingClause = NIL; /* figure out which columns later... */
/* letting join_type reduce to empty doesn't work */
JoinExpr *n = makeNode(JoinExpr);
n->jointype = JOIN_INNER;
- n->isNatural = TRUE;
+ n->isNatural = true;
n->larg = $1;
n->rarg = $4;
n->usingClause = NIL; /* figure out which columns later... */
{
$$ = $2;
$$->arrayBounds = $3;
- $$->setof = TRUE;
+ $$->setof = true;
}
/* SQL standard syntax, currently only one-dimensional */
| SimpleTypename ARRAY '[' Iconst ']'
{
$$ = $2;
$$->arrayBounds = list_make1(makeInteger($5));
- $$->setof = TRUE;
+ $$->setof = true;
}
| SimpleTypename ARRAY
{
{
$$ = $2;
$$->arrayBounds = list_make1(makeInteger(-1));
- $$->setof = TRUE;
+ $$->setof = true;
}
;
;
opt_varying:
- VARYING { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ VARYING { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
/*
;
opt_timezone:
- WITH_LA TIME ZONE { $$ = TRUE; }
- | WITHOUT TIME ZONE { $$ = FALSE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ WITH_LA TIME ZONE { $$ = true; }
+ | WITHOUT TIME ZONE { $$ = false; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_interval:
| func_name '(' VARIADIC func_arg_expr opt_sort_clause ')'
{
FuncCall *n = makeFuncCall($1, list_make1($4), @1);
- n->func_variadic = TRUE;
+ n->func_variadic = true;
n->agg_order = $5;
$$ = (Node *)n;
}
| func_name '(' func_arg_list ',' VARIADIC func_arg_expr opt_sort_clause ')'
{
FuncCall *n = makeFuncCall($1, lappend($3, $6), @1);
- n->func_variadic = TRUE;
+ n->func_variadic = true;
n->agg_order = $7;
$$ = (Node *)n;
}
{
FuncCall *n = makeFuncCall($1, $4, @1);
n->agg_order = $5;
- n->agg_distinct = TRUE;
+ n->agg_distinct = true;
$$ = (Node *)n;
}
| func_name '(' '*' ')'
* really was.
*/
FuncCall *n = makeFuncCall($1, NIL, @1);
- n->agg_star = TRUE;
+ n->agg_star = true;
$$ = (Node *)n;
}
;
errmsg("cannot use VARIADIC with WITHIN GROUP"),
parser_errposition(@2)));
n->agg_order = $2;
- n->agg_within_group = TRUE;
+ n->agg_within_group = true;
}
n->agg_filter = $3;
n->over = $4;
| CONTENT_P { $$ = XMLOPTION_CONTENT; }
;
-xml_whitespace_option: PRESERVE WHITESPACE_P { $$ = TRUE; }
- | STRIP_P WHITESPACE_P { $$ = FALSE; }
- | /*EMPTY*/ { $$ = FALSE; }
+xml_whitespace_option: PRESERVE WHITESPACE_P { $$ = true; }
+ | STRIP_P WHITESPACE_P { $$ = false; }
+ | /*EMPTY*/ { $$ = false; }
;
/* We allow several variants for SQL and other compatibility. */
;
/*
- * If we see PARTITION, RANGE, or ROWS as the first token after the '('
+ * If we see PARTITION, RANGE, ROWS or GROUPS as the first token after the '('
* of a window_specification, we want the assumption to be that there is
* no existing_window_name; but those keywords are unreserved and so could
* be ColIds. We fix this by making them have the same precedence as IDENT
/*
* For frame clauses, we return a WindowDef, but only some fields are used:
* frameOptions, startOffset, and endOffset.
- *
- * This is only a subset of the full SQL:2008 frame_clause grammar.
- * We don't support <window frame exclusion> yet.
*/
opt_frame_clause:
- RANGE frame_extent
+ RANGE frame_extent opt_window_exclusion_clause
{
WindowDef *n = $2;
n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_RANGE;
- if (n->frameOptions & (FRAMEOPTION_START_VALUE_PRECEDING |
- FRAMEOPTION_END_VALUE_PRECEDING))
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("RANGE PRECEDING is only supported with UNBOUNDED"),
- parser_errposition(@1)));
- if (n->frameOptions & (FRAMEOPTION_START_VALUE_FOLLOWING |
- FRAMEOPTION_END_VALUE_FOLLOWING))
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("RANGE FOLLOWING is only supported with UNBOUNDED"),
- parser_errposition(@1)));
+ n->frameOptions |= $3;
$$ = n;
}
- | ROWS frame_extent
+ | ROWS frame_extent opt_window_exclusion_clause
{
WindowDef *n = $2;
n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_ROWS;
+ n->frameOptions |= $3;
+ $$ = n;
+ }
+ | GROUPS frame_extent opt_window_exclusion_clause
+ {
+ WindowDef *n = $2;
+ n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_GROUPS;
+ n->frameOptions |= $3;
$$ = n;
}
| /*EMPTY*/
(errcode(ERRCODE_WINDOWING_ERROR),
errmsg("frame start cannot be UNBOUNDED FOLLOWING"),
parser_errposition(@1)));
- if (n->frameOptions & FRAMEOPTION_START_VALUE_FOLLOWING)
+ if (n->frameOptions & FRAMEOPTION_START_OFFSET_FOLLOWING)
ereport(ERROR,
(errcode(ERRCODE_WINDOWING_ERROR),
errmsg("frame starting from following row cannot end with current row"),
errmsg("frame end cannot be UNBOUNDED PRECEDING"),
parser_errposition(@4)));
if ((frameOptions & FRAMEOPTION_START_CURRENT_ROW) &&
- (frameOptions & FRAMEOPTION_END_VALUE_PRECEDING))
+ (frameOptions & FRAMEOPTION_END_OFFSET_PRECEDING))
ereport(ERROR,
(errcode(ERRCODE_WINDOWING_ERROR),
errmsg("frame starting from current row cannot have preceding rows"),
parser_errposition(@4)));
- if ((frameOptions & FRAMEOPTION_START_VALUE_FOLLOWING) &&
- (frameOptions & (FRAMEOPTION_END_VALUE_PRECEDING |
+ if ((frameOptions & FRAMEOPTION_START_OFFSET_FOLLOWING) &&
+ (frameOptions & (FRAMEOPTION_END_OFFSET_PRECEDING |
FRAMEOPTION_END_CURRENT_ROW)))
ereport(ERROR,
(errcode(ERRCODE_WINDOWING_ERROR),
| a_expr PRECEDING
{
WindowDef *n = makeNode(WindowDef);
- n->frameOptions = FRAMEOPTION_START_VALUE_PRECEDING;
+ n->frameOptions = FRAMEOPTION_START_OFFSET_PRECEDING;
n->startOffset = $1;
n->endOffset = NULL;
$$ = n;
| a_expr FOLLOWING
{
WindowDef *n = makeNode(WindowDef);
- n->frameOptions = FRAMEOPTION_START_VALUE_FOLLOWING;
+ n->frameOptions = FRAMEOPTION_START_OFFSET_FOLLOWING;
n->startOffset = $1;
n->endOffset = NULL;
$$ = n;
}
;
+opt_window_exclusion_clause:
+ EXCLUDE CURRENT_P ROW { $$ = FRAMEOPTION_EXCLUDE_CURRENT_ROW; }
+ | EXCLUDE GROUP_P { $$ = FRAMEOPTION_EXCLUDE_GROUP; }
+ | EXCLUDE TIES { $$ = FRAMEOPTION_EXCLUDE_TIES; }
+ | EXCLUDE NO OTHERS { $$ = 0; }
+ | /*EMPTY*/ { $$ = 0; }
+ ;
+
/*
* Supporting nonterminals for expressions.
}
| TRUE_P
{
- $$ = makeBoolAConst(TRUE, @1);
+ $$ = makeBoolAConst(true, @1);
}
| FALSE_P
{
- $$ = makeBoolAConst(FALSE, @1);
+ $$ = makeBoolAConst(false, @1);
}
| NULL_P
{
errmsg("role name \"%s\" is reserved",
"public"),
parser_errposition(@1)));
+ break;
case ROLESPEC_SESSION_USER:
ereport(ERROR,
(errcode(ERRCODE_RESERVED_NAME),
errmsg("%s cannot be used as a role name here",
"SESSION_USER"),
parser_errposition(@1)));
+ break;
case ROLESPEC_CURRENT_USER:
ereport(ERROR,
(errcode(ERRCODE_RESERVED_NAME),
errmsg("%s cannot be used as a role name here",
"CURRENT_USER"),
parser_errposition(@1)));
+ break;
}
}
;
| BEGIN_P
| BY
| CACHE
+ | CALL
| CALLED
| CASCADE
| CASCADED
| GENERATED
| GLOBAL
| GRANTED
+ | GROUPS
| HANDLER
| HEADER_P
| HOLD
| IMMUTABLE
| IMPLICIT_P
| IMPORT_P
+ | INCLUDE
| INCLUDING
| INCREMENT
| INDEX
| OPTION
| OPTIONS
| ORDINALITY
+ | OTHERS
| OVER
| OVERRIDING
| OWNED
| PRIVILEGES
| PROCEDURAL
| PROCEDURE
+ | PROCEDURES
| PROGRAM
| PUBLICATION
| QUOTE
| ROLE
| ROLLBACK
| ROLLUP
+ | ROUTINE
+ | ROUTINES
| ROWS
| RULE
| SAVEPOINT
| TEMPLATE
| TEMPORARY
| TEXT_P
+ | TIES
| TRANSACTION
| TRANSFORM
| TRIGGER
* lexical token lookup for key words in PostgreSQL
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* implementation for PostgreSQL generic linked list package
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
return newlist;
}
+/*
+ * Sort a list as though by qsort.
+ *
+ * A new list is built and returned. Like list_copy, this doesn't make
+ * fresh copies of any pointed-to data.
+ *
+ * The comparator function receives arguments of type ListCell **.
+ */
+List *
+list_qsort(const List *list, list_qsort_comparator cmp)
+{
+ int len = list_length(list);
+ ListCell **list_arr;
+ List *newlist;
+ ListCell *newlist_prev;
+ ListCell *cell;
+ int i;
+
+ /* Empty list is easy */
+ if (len == 0)
+ return NIL;
+
+ /* Flatten list cells into an array, so we can use qsort */
+ list_arr = (ListCell **) palloc(sizeof(ListCell *) * len);
+ i = 0;
+ foreach(cell, list)
+ list_arr[i++] = cell;
+
+ qsort(list_arr, len, sizeof(ListCell *), cmp);
+
+ /* Construct new list (this code is much like list_copy) */
+ newlist = new_list(list->type);
+ newlist->length = len;
+
+ /*
+ * Copy over the data in the first cell; new_list() has already allocated
+ * the head cell itself
+ */
+ newlist->head->data = list_arr[0]->data;
+
+ newlist_prev = newlist->head;
+ for (i = 1; i < len; i++)
+ {
+ ListCell *newlist_cur;
+
+ newlist_cur = (ListCell *) palloc(sizeof(*newlist_cur));
+ newlist_cur->data = list_arr[i]->data;
+ newlist_prev->next = newlist_cur;
+
+ newlist_prev = newlist_cur;
+ }
+
+ newlist_prev->next = NULL;
+ newlist->tail = newlist_prev;
+
+ /* Might as well free the workspace array */
+ pfree(list_arr);
+
+ check_list_invariants(newlist);
+ return newlist;
+}
+
/*
* Temporary compatibility functions
*
* creator functions for primitive nodes. The functions here are for
* the most frequently created nodes.
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* table entry, and varattno == 0 to signal that it references the whole
* tuple. (Use of zero here is unclean, since it could easily be confused
* with error cases, but it's not worth changing now.) The vartype indicates
- * a rowtype; either a named composite type, or RECORD. This function
- * encapsulates the logic for determining the correct rowtype OID to use.
+ * a rowtype; either a named composite type, or a domain over a named
+ * composite type (only possible if the RTE is a function returning that),
+ * or RECORD. This function encapsulates the logic for determining the
+ * correct rowtype OID to use.
*
* If allowScalar is true, then for the case where the RTE is a single function
* returning a non-composite result type, we produce a normal Var referencing
n->location = location;
return n;
}
+
+/*
+ * makeVacuumRelation -
+ * create a VacuumRelation node
+ */
+VacuumRelation *
+makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols)
+{
+ VacuumRelation *v = makeNode(VacuumRelation);
+
+ v->relation = relation;
+ v->oid = oid;
+ v->va_cols = va_cols;
+ return v;
+}
* support code for nodes (now that we have removed the home-brew
* inheritance system, our support code for nodes is much simpler)
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* outfuncs.c
* Output functions for Postgres tree nodes.
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
switch (value->type)
{
case T_Integer:
- sprintf(buf, "%ld", value->val.ival);
+ sprintf(buf, "%d", value->val.ival);
string_append_char(str, buf);
break;
switch (node->val.type)
{
case T_Integer:
- sprintf(buf, "%ld", node->val.val.ival);
+ sprintf(buf, "%d", node->val.val.ival);
string_append_char(str, buf);
break;
string_append_char(str, " UNBOUNDED FOLLOWING");
else if (node->frameOptions & FRAMEOPTION_START_CURRENT_ROW)
string_append_char(str, " UNBOUNDED CURRENT ROW");
- else if (node->frameOptions & FRAMEOPTION_START_VALUE_PRECEDING)
+ else if (node->frameOptions & FRAMEOPTION_START_OFFSET_PRECEDING)
{
string_append_char(str, " ");
_outNode(str, node->startOffset);
string_append_char(str, " PRECEDING");
}
- else if (node->frameOptions & FRAMEOPTION_START_VALUE_FOLLOWING)
+ else if (node->frameOptions & FRAMEOPTION_START_OFFSET_FOLLOWING)
{
string_append_char(str, " ");
_outNode(str, node->startOffset);
string_append_char(str, " UNBOUNDED FOLLOWING");
else if (node->frameOptions & FRAMEOPTION_END_CURRENT_ROW)
string_append_char(str, " UNBOUNDED CURRENT ROW");
- else if (node->frameOptions & FRAMEOPTION_END_VALUE_PRECEDING)
+ else if (node->frameOptions & FRAMEOPTION_END_OFFSET_PRECEDING)
{
string_append_char(str, " ");
_outNode(str, node->endOffset);
string_append_char(str, " PRECEDING");
}
- else if (node->frameOptions & FRAMEOPTION_END_VALUE_FOLLOWING)
+ else if (node->frameOptions & FRAMEOPTION_END_OFFSET_FOLLOWING)
{
string_append_char(str, " ");
_outNode(str, node->endOffset);
if (node->options & VACOPT_VACUUM && node->options & VACOPT_ANALYZE)
string_append_char(str, "ANALYZE ");
- _outNode(str, node->relation);
- if (node->va_cols)
+ ListCell *lc;
+ foreach(lc, node->rels)
{
- string_append_char(str, "(");
- _outIdList(str, node->va_cols);
- string_append_char(str, ") ");
+ VacuumRelation *vrel = lfirst_node(VacuumRelation, lc);
+
+ _outNode(str, vrel->relation);
+ if (vrel->va_cols)
+ {
+ string_append_char(str, "(");
+ _outIdList(str, vrel->va_cols);
+ string_append_char(str, ") ");
+ }
}
}
char buf[16];
string_append_char(str, " CONNECTION LIMIT ");
- snprintf(buf, 16, "%ld", value->val.ival);
+ snprintf(buf, 16, "%d", value->val.ival);
string_append_char(str, buf);
}
else if (strcmp(elem->defname, "validUntil") == 0)
char buf[16];
string_append_char(str, " SYSID ");
- snprintf(buf, 16, "%ld", value->val.ival);
+ snprintf(buf, 16, "%d", value->val.ival);
string_append_char(str, buf);
}
else if (strcmp(elem->defname, "adminmembers") == 0)
string_append_char(str, "ALTER \"");
string_append_char(str, node->name);
string_append_char(str, "\" SET STATISTICS ");
- snprintf(buf, 16, "%ld", ((Value *) node->def)->val.ival);
+ snprintf(buf, 16, "%d", ((Value *) node->def)->val.ival);
string_append_char(str, buf);
break;
string_append_char(str, v->val.str);
else
{
- snprintf(buf, 16, "%ld", v->val.ival);
+ snprintf(buf, 16, "%d", v->val.ival);
string_append_char(str, buf);
}
}
switch (node->objtype)
{
- case ACL_OBJECT_RELATION:
+ case OBJECT_TABLE:
_outNode(str, node->objects);
break;
- case ACL_OBJECT_SEQUENCE:
+ case OBJECT_SEQUENCE:
string_append_char(str, "SEQUENCE ");
_outNode(str, node->objects);
break;
- case ACL_OBJECT_FUNCTION:
+ case OBJECT_FUNCTION:
string_append_char(str, "FUNCTION ");
_outNode(str, node->objects);
break;
- case ACL_OBJECT_DATABASE:
+ case OBJECT_DATABASE:
string_append_char(str, "DATABASE ");
_outIdList(str, node->objects);
break;
- case ACL_OBJECT_LANGUAGE:
+ case OBJECT_LANGUAGE:
string_append_char(str, "LANGUAGE ");
_outIdList(str, node->objects);
break;
- case ACL_OBJECT_NAMESPACE:
+ case OBJECT_SCHEMA:
string_append_char(str, "SCHEMA ");
_outIdList(str, node->objects);
break;
- case ACL_OBJECT_TABLESPACE:
+ case OBJECT_TABLESPACE:
string_append_char(str, "TABLESPACE ");
_outIdList(str, node->objects);
break;
- case ACL_OBJECT_FDW:
+ case OBJECT_FDW:
string_append_char(str, "FOREIGN DATA WRAPPER ");
_outIdList(str, node->objects);
break;
- case ACL_OBJECT_FOREIGN_SERVER:
+ case OBJECT_FOREIGN_SERVER:
string_append_char(str, "FOREIGN SERVER ");
_outIdList(str, node->objects);
break;
- case ACL_OBJECT_COLUMN:
- case ACL_OBJECT_DOMAIN:
- case ACL_OBJECT_LARGEOBJECT:
- case ACL_OBJECT_TYPE:
+ case OBJECT_COLUMN:
+ case OBJECT_DOMAIN:
+ case OBJECT_LARGEOBJECT:
+ case OBJECT_TYPE:
+ case OBJECT_ACCESS_METHOD:
+ case OBJECT_AGGREGATE:
+ case OBJECT_AMOP:
+ case OBJECT_AMPROC:
+ case OBJECT_ATTRIBUTE:
+ case OBJECT_CAST:
+ case OBJECT_COLLATION:
+ case OBJECT_CONVERSION:
+ case OBJECT_DEFAULT:
+ case OBJECT_DEFACL:
+ case OBJECT_DOMCONSTRAINT:
+ case OBJECT_EVENT_TRIGGER:
+ case OBJECT_EXTENSION:
+ case OBJECT_FOREIGN_TABLE:
+ case OBJECT_INDEX:
+ case OBJECT_MATVIEW:
+ case OBJECT_OPCLASS:
+ case OBJECT_OPERATOR:
+ case OBJECT_OPFAMILY:
+ case OBJECT_POLICY:
+ case OBJECT_PROCEDURE:
+ case OBJECT_PUBLICATION:
+ case OBJECT_PUBLICATION_REL:
+ case OBJECT_ROLE:
+ case OBJECT_ROUTINE:
+ case OBJECT_RULE:
+ case OBJECT_SUBSCRIPTION:
+ case OBJECT_STATISTIC_EXT:
+ case OBJECT_TABCONSTRAINT:
+ case OBJECT_TRANSFORM:
+ case OBJECT_TRIGGER:
+ case OBJECT_TSCONFIGURATION:
+ case OBJECT_TSDICTIONARY:
+ case OBJECT_TSPARSER:
+ case OBJECT_TSTEMPLATE:
+ case OBJECT_USER_MAPPING:
+ case OBJECT_VIEW:
break;
}
}
_outFuncOptList(str, node->options);
-
- if (node->withClause)
- {
- string_append_char(str, " WITH ");
- _outDefinition(str, node->withClause);
- }
}
static void
{
char buf[16];
- snprintf(buf, 16, "%ld", v->val.ival);
+ snprintf(buf, 16, "%d", v->val.ival);
string_append_char(str, buf);
}
}
string_append_char(str, v->val.str);
else if (IsA(v, Integer))
{
- snprintf(buf, 16, "%ld", v->val.ival);
+ snprintf(buf, 16, "%d", v->val.ival);
string_append_char(str, buf);
}
break;
* analyze.c and related files.
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
return node;
}
+/*
+ * from src/backend/commands/define.c
+ * Extract an int32 value from a DefElem.
+ */
+int32
+defGetInt32(DefElem *def)
+{
+ if (def->arg == NULL)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("%s requires an integer value",
+ def->defname)));
+ switch (nodeTag(def->arg))
+ {
+ case T_Integer:
+ return (int32) intVal(def->arg);
+ default:
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("%s requires an integer value",
+ def->defname)));
+ }
+ return 0; /* keep compiler quiet */
+}
+
/*
* Intermediate filter between parser and core lexer (core_yylex in scan.l).
*
* Postgres 9.2, this check is made automatically by the Makefile.)
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
}
%{
+
+/* LCOV_EXCL_START */
+
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
#undef fprintf
#define fprintf(file, fmt, msg) fprintf_to_ereport(fmt, msg)
%%
+/* LCOV_EXCL_STOP */
+
/*
* Arrange access to yyextra for subroutines of the main yylex() function.
* We expect each subroutine to have a yyscanner parameter. Rather than
static int
process_integer_literal(const char *token, YYSTYPE *lval)
{
- long val;
+ int val;
+ long val_long;
char *endptr;
errno = 0;
- val = strtol(token, &endptr, 10);
+ val_long = strtol(token, &endptr, 10);
+ val = (int) val_long;
+
if (*endptr != '\0' || errno == ERANGE
#ifdef HAVE_LONG_INT_64
/* if long > 32 bits, check for overflow of int4 */
- || val != (long) ((int32) val)
+ || val != (int) val_long
#endif
)
{
* support routines for the lex/flex scanner, used by both the normal
* backend as well as the bootstrap backend
*
- * Portions Copyright (c) 1996-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
}
/*
- * scanner_isspace() --- return TRUE if flex scanner considers char whitespace
+ * scanner_isspace() --- return true if flex scanner considers char whitespace
*
* This should be used instead of the potentially locale-dependent isspace()
* function when it's important to match the lexer's behavior.
strvalue = argvalues[fmtpos].cptr;
else
strvalue = va_arg(args, char *);
+ /* Whine if someone tries to print a NULL string */
+ Assert(strvalue != NULL);
fmtstr(strvalue, leftjust, fieldwidth, precision, pointflag,
target);
break;
target->failed = true;
}
-static size_t
-pg_strnlen(const char *str, size_t maxlen)
-{
- const char *p = str;
-
- while (maxlen-- > 0 && *p)
- p++;
- return p - str;
-}
-
static void
fmtstr(char *value, int leftjust, int minlen, int maxwidth,
int pointflag, PrintfTarget *target)
* than that.
*/
if (pointflag)
- vallen = pg_strnlen(value, maxwidth);
+ vallen = strnlen(value, maxwidth);
else
vallen = strlen(value);
* It can be used to buffer either ordinary C strings (null-terminated text)
* or arbitrary binary data. All storage is allocated with palloc().
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/lib/stringinfo.c
* appendBinaryStringInfo
*
* Append arbitrary binary data to a StringInfo, allocating more space
- * if necessary.
+ * if necessary. Ensures that a trailing null byte is present.
*/
void
appendBinaryStringInfo(StringInfo str, const char *data, int datalen)
str->data[str->len] = '\0';
}
+/*
+ * appendBinaryStringInfoNT
+ *
+ * Append arbitrary binary data to a StringInfo, allocating more space
+ * if necessary. Does not ensure a trailing null-byte exists.
+ */
+void
+appendBinaryStringInfoNT(StringInfo str, const char *data, int datalen)
+{
+ Assert(str != NULL);
+
+ /* Make more room if needed */
+ enlargeStringInfo(str, datalen);
+
+ /* OK, append the data */
+ memcpy(str->data + str->len, data, datalen);
+ str->len += datalen;
+}
+
/*
* enlargeStringInfo
*
* implementation of Value nodes
*
*
- * Portions Copyright (c) 2003-2017, PgPool Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
* Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
*
* makeInteger
*/
Value *
-makeInteger(long i)
+makeInteger(int i)
{
Value *v = makeNode(Value);
pg_encoding_mblen(int encoding, const char *mbstr)
{
return (PG_VALID_ENCODING(encoding) ?
- ((*pg_wchar_table[encoding].mblen) ((const unsigned char *) mbstr)) :
- ((*pg_wchar_table[PG_SQL_ASCII].mblen) ((const unsigned char *) mbstr)));
+ pg_wchar_table[encoding].mblen((const unsigned char *) mbstr) :
+ pg_wchar_table[PG_SQL_ASCII].mblen((const unsigned char *) mbstr));
}
/*
pg_encoding_dsplen(int encoding, const char *mbstr)
{
return (PG_VALID_ENCODING(encoding) ?
- ((*pg_wchar_table[encoding].dsplen) ((const unsigned char *) mbstr)) :
- ((*pg_wchar_table[PG_SQL_ASCII].dsplen) ((const unsigned char *) mbstr)));
+ pg_wchar_table[encoding].dsplen((const unsigned char *) mbstr) :
+ pg_wchar_table[PG_SQL_ASCII].dsplen((const unsigned char *) mbstr));
}
/*
pg_encoding_verifymb(int encoding, const char *mbstr, int len)
{
return (PG_VALID_ENCODING(encoding) ?
- ((*pg_wchar_table[encoding].mbverify) ((const unsigned char *) mbstr, len)) :
- ((*pg_wchar_table[PG_SQL_ASCII].mbverify) ((const unsigned char *) mbstr, len)));
+ pg_wchar_table[encoding].mbverify((const unsigned char *) mbstr, len) :
+ pg_wchar_table[PG_SQL_ASCII].mbverify((const unsigned char *) mbstr, len));
}
/*
switch (nodeTag(&con->val))
{
case T_Integer:
- appendStringInfo(&buf, "%ld", intVal(&con->val));
+ appendStringInfo(&buf, "%d", intVal(&con->val));
break;
case T_Float:
/* represented as a string, so just copy it */