diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 1d39674..fa6612d 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -109,15 +109,12 @@ static Node *makeIntConst(int val, int location);
 static Node *makeFloatConst(char *str, int location);
 static Node *makeBitStringConst(char *str, int location);
 static Node *makeNullAConst(int location);
-static Node *makeAConst(Value *v, int location);
 static Node *makeBoolAConst(bool state, int location);
 static FuncCall *makeOverlaps(List *largs, List *rargs,
 							  int location, core_yyscan_t yyscanner);
 static void check_qualified_name(List *names, core_yyscan_t yyscanner);
 static List *check_func_name(List *names, core_yyscan_t yyscanner);
 static List *check_indirection(List *indirection, core_yyscan_t yyscanner);
-static List *extractArgTypes(List *parameters);
-static SelectStmt *findLeftmostSelect(SelectStmt *node);
 static void insertSelectOptions(SelectStmt *stmt,
 								List *sortClause, List *lockingClause,
 								Node *limitOffset, Node *limitCount,
@@ -129,12 +126,6 @@ static void doNegateFloat(Value *v);
 static Node *makeAArrayExpr(List *elements, int location);
 static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args,
 						 List *args, int location);
-static List *mergeTableFuncParameters(List *func_args, List *columns);
-static TypeName *TableFuncTypeName(List *columns);
-static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner);
-static void SplitColQualList(List *qualList,
-							 List **constraintList, CollateClause **collClause,
-							 core_yyscan_t yyscanner);
 
 %}
 
@@ -184,148 +175,48 @@ static void SplitColQualList(List *qualList,
 	VariableSetStmt		*vsetstmt;
 }
 
-%type <node>	stmt schema_stmt
-		AlterDatabaseStmt AlterDatabaseSetStmt AlterDomainStmt AlterEnumStmt
-		AlterFdwStmt AlterForeignServerStmt AlterGroupStmt
-		AlterObjectSchemaStmt AlterOwnerStmt AlterSeqStmt AlterTableStmt
-		AlterExtensionStmt AlterExtensionContentsStmt AlterForeignTableStmt
-		AlterCompositeTypeStmt AlterUserStmt AlterUserMappingStmt AlterUserSetStmt
-		AlterRoleStmt AlterRoleSetStmt
-		AlterDefaultPrivilegesStmt DefACLAction
-		AnalyzeStmt ClosePortalStmt ClusterStmt CommentStmt
-		ConstraintsSetStmt CopyStmt CreateAsStmt CreateCastStmt
-		CreateDomainStmt CreateExtensionStmt CreateGroupStmt CreateOpClassStmt
-		CreateOpFamilyStmt AlterOpFamilyStmt CreatePLangStmt
-		CreateSchemaStmt CreateSeqStmt CreateStmt CreateTableSpaceStmt
-		CreateFdwStmt CreateForeignServerStmt CreateForeignTableStmt
-		CreateAssertStmt CreateTrigStmt
-		CreateUserStmt CreateUserMappingStmt CreateRoleStmt
-		CreatedbStmt DeclareCursorStmt DefineStmt DeleteStmt DiscardStmt DoStmt
-		DropGroupStmt DropOpClassStmt DropOpFamilyStmt DropPLangStmt DropStmt
-		DropAssertStmt DropTrigStmt DropRuleStmt DropCastStmt DropRoleStmt
-		DropUserStmt DropdbStmt DropTableSpaceStmt DropFdwStmt
-		DropForeignServerStmt DropUserMappingStmt ExplainStmt FetchStmt
-		GrantStmt GrantRoleStmt IndexStmt InsertStmt ListenStmt LoadStmt
-		LockStmt NotifyStmt ExplainableStmt PreparableStmt
-		CreateFunctionStmt AlterFunctionStmt ReindexStmt RemoveAggrStmt
-		RemoveFuncStmt RemoveOperStmt RenameStmt RevokeStmt RevokeRoleStmt
-		RuleActionStmt RuleActionStmtOrEmpty RuleStmt
-		SecLabelStmt SelectStmt TransactionStmt TruncateStmt
-		UnlistenStmt UpdateStmt VacuumStmt
-		VariableResetStmt VariableSetStmt VariableShowStmt
-		ViewStmt CheckPointStmt CreateConversionStmt
-		DeallocateStmt PrepareStmt ExecuteStmt
-		DropOwnedStmt ReassignOwnedStmt
-		AlterTSConfigurationStmt AlterTSDictionaryStmt
+%type <node>	stmt
+		DeleteStmt
+		InsertStmt
+		PreparableStmt
+		SelectStmt
+		UpdateStmt
 
 %type <node>	select_no_parens select_with_parens select_clause
 				simple_select values_clause
 
-%type <node>	alter_column_default opclass_item opclass_drop alter_using
-%type <ival>	add_drop opt_asc_desc opt_nulls_order
+%type <ival>	opt_asc_desc opt_nulls_order
 
-%type <node>	alter_table_cmd alter_type_cmd opt_collate_clause
-%type <list>	alter_table_cmds alter_type_cmds
+%type <node>	opt_collate_clause
 
-%type <dbehavior>	opt_drop_behavior
+%type <boolean>	opt_nowait
 
-%type <list>	createdb_opt_list alterdb_opt_list copy_opt_list
-				transaction_mode_list
-				create_extension_opt_list alter_extension_opt_list
-%type <defelt>	createdb_opt_item alterdb_opt_item copy_opt_item
-				transaction_mode_item
-				create_extension_opt_item alter_extension_opt_item
+%type <str>		attr_name
+				name cursor_name
 
-%type <ival>	opt_lock lock_type cast_context
-%type <ival>	vacuum_option_list vacuum_option_elem
-%type <boolean>	opt_force opt_or_replace
-				opt_grant_grant_option opt_grant_admin_option
-				opt_nowait opt_if_exists opt_with_data
+%type <list>	func_name qual_Op qual_all_Op subquery_Op
 
-%type <list>	OptRoleList AlterOptRoleList
-%type <defelt>	CreateOptRoleElem AlterOptRoleElem
-
-%type <str>		opt_type
-%type <str>		foreign_server_version opt_foreign_server_version
-%type <str>		auth_ident
-%type <str>		opt_in_database
-
-%type <str>		OptSchemaName
-%type <list>	OptSchemaEltList
-
-%type <boolean> TriggerForSpec TriggerForType
-%type <ival>	TriggerActionTime
-%type <list>	TriggerEvents TriggerOneEvent
-%type <value>	TriggerFuncArg
-%type <node>	TriggerWhen
-
-%type <str>		copy_file_name
-				database_name access_method_clause access_method attr_name
-				name cursor_name file_name
-				index_name opt_index_name cluster_index_specification
-
-%type <list>	func_name handler_name qual_Op qual_all_Op subquery_Op
-				opt_class opt_inline_handler opt_validator validator_clause
-				opt_collate
-
-%type <range>	qualified_name OptConstrFromTable
+%type <range>	qualified_name
 
 %type <str>		all_Op MathOp
 
-%type <str>		iso_level opt_encoding
-%type <node>	grantee
-%type <list>	grantee_list
-%type <accesspriv> privilege
-%type <list>	privileges privilege_list
-%type <privtarget> privilege_target
-%type <funwithargs> function_with_argtypes
-%type <list>	function_with_argtypes_list
-%type <ival>	defacl_privilege_target
-%type <defelt>	DefACLOption
-%type <list>	DefACLOptionList
-
 %type <list>	stmtblock stmtmulti
-				OptTableElementList TableElementList OptInherit definition
-				OptTypedTableElementList TypedTableElementList
-				OptForeignTableElementList ForeignTableElementList
-				reloptions opt_reloptions
-				OptWith opt_distinct opt_definition func_args func_args_list
-				func_args_with_defaults func_args_with_defaults_list
-				func_as createfunc_opt_list alterfunc_opt_list
-				aggr_args old_aggr_definition old_aggr_list
-				oper_argtypes RuleActionList RuleActionMulti
-				opt_column_list columnList opt_name_list
-				sort_clause opt_sort_clause sortby_list index_params
+				opt_distinct
+				opt_name_list
+				sort_clause opt_sort_clause sortby_list
 				name_list from_clause from_list opt_array_bounds
-				qualified_name_list any_name any_name_list
+				qualified_name_list any_name
 				any_operator expr_list attrs
 				target_list insert_column_list set_target_list
 				set_clause_list set_clause multiple_set_clause
-				ctext_expr_list ctext_row def_list indirection opt_indirection
-				reloption_list group_clause TriggerFuncArgs select_limit
-				opt_select_limit opclass_item_list opclass_drop_list
-				opclass_purpose opt_opfamily transaction_mode_list_or_empty
-				OptTableFuncElementList TableFuncElementList opt_type_modifiers
-				prep_type_clause
-				execute_param_clause using_clause returning_clause
-				opt_enum_val_list enum_val_list table_func_column_list
-				create_generic_options alter_generic_options
-				relation_expr_list dostmt_opt_list
-
-%type <list>	opt_fdw_options fdw_options
-%type <defelt>	fdw_option
+				ctext_expr_list ctext_row indirection opt_indirection
+				group_clause select_limit
+				opt_select_limit
+				TableFuncElementList opt_type_modifiers
+				using_clause returning_clause
 
 %type <range>	OptTempTableName
-%type <into>	into_clause create_as_target
-
-%type <defelt>	createfunc_opt_item common_func_opt_item dostmt_opt_item
-%type <fun_param> func_arg func_arg_with_default table_func_column
-%type <fun_param_mode> arg_class
-%type <typnam>	func_return func_type
-
-%type <boolean>  opt_trusted opt_restart_seqs
-%type <ival>	 OptTemp
-%type <oncommit> OnCommitOption
+%type <into>	into_clause
 
 %type <node>	for_locking_item
 %type <list>	for_locking_clause opt_for_locking_clause for_locking_items
@@ -340,69 +231,32 @@ static void SplitColQualList(List *qualList,
 %type <list>	opt_interval interval_second
 %type <node>	overlay_placing substr_from substr_for
 
-%type <boolean> opt_instead
-%type <boolean> opt_unique opt_concurrently opt_verbose opt_full
-%type <boolean> opt_freeze opt_default opt_recheck
-%type <defelt>	opt_binary opt_oids copy_delimiter
-
-%type <boolean> copy_from
-
-%type <ival>	opt_column event cursor_options opt_hold opt_set_data
-%type <objtype>	reindex_type drop_type comment_type security_label_type
-
-%type <node>	fetch_args limit_clause select_limit_value
+%type <node>	limit_clause select_limit_value
 				offset_clause select_offset_value
 				select_offset_value2 opt_select_fetch_first_value
 %type <ival>	row_or_rows first_or_next
 
-%type <list>	OptSeqOptList SeqOptList
-%type <defelt>	SeqOptElem
-
 %type <istmt>	insert_rest
 
-%type <vsetstmt> set_rest SetResetClause
-
-%type <node>	TableElement TypedTableElement ConstraintElem TableFuncElement
-				ForeignTableElement
-%type <node>	columnDef columnOptions
-%type <defelt>	def_elem reloption_elem old_aggr_elem
-%type <node>	def_arg columnElem where_clause where_or_current_clause
+%type <node>	TableFuncElement
+%type <node>	where_clause where_or_current_clause
 				a_expr b_expr c_expr func_expr AexprConst indirection_el
 				columnref in_expr having_clause func_table array_expr
-				ExclusionWhereClause
-%type <list>	ExclusionConstraintList ExclusionConstraintElem
 %type <list>	func_arg_list
 %type <node>	func_arg_expr
 %type <list>	row type_list array_expr_list
 %type <node>	case_expr case_arg when_clause case_default
 %type <list>	when_clause_list
 %type <ival>	sub_type
-%type <list>	OptCreateAs CreateAsList
-%type <node>	CreateAsElement ctext_expr
-%type <value>	NumericOnly
-%type <list>	NumericOnly_list
+%type <node>	ctext_expr
 %type <alias>	alias_clause
 %type <sortby>	sortby
-%type <ielem>	index_elem
 %type <node>	table_ref
 %type <jexpr>	joined_table
 %type <range>	relation_expr
 %type <range>	relation_expr_opt_alias
 %type <target>	target_el single_set_clause set_target insert_column_item
 
-%type <str>		generic_option_name
-%type <node>	generic_option_arg
-%type <defelt>	generic_option_elem alter_generic_option_elem
-%type <list>	generic_option_list alter_generic_option_list
-%type <str>		explain_option_name
-%type <node>	explain_option_arg
-%type <defelt>	explain_option_elem
-%type <list>	explain_option_list
-%type <node>	copy_generic_opt_arg copy_generic_opt_arg_list_item
-%type <defelt>	copy_generic_opt_elem
-%type <list>	copy_generic_opt_list copy_generic_opt_arg_list
-%type <list>	copy_options
-
 %type <typnam>	Typename SimpleTypename ConstTypename
 				GenericType Numeric opt_float
 				Character ConstCharacter
@@ -415,31 +269,12 @@ static void SplitColQualList(List *qualList,
 %type <boolean> opt_varying opt_timezone
 
 %type <ival>	Iconst SignedIconst
-%type <str>		Sconst comment_text notify_payload
-%type <str>		RoleId opt_granted_by opt_boolean_or_string ColId_or_Sconst
-%type <list>	var_list
-%type <str>		ColId ColLabel var_name type_function_name param_name
-%type <node>	var_value zone_value
+%type <str>		Sconst
+%type <str>		ColId ColLabel type_function_name param_name
 
 %type <keyword> unreserved_keyword type_func_name_keyword
 %type <keyword> col_name_keyword reserved_keyword
 
-%type <node>	TableConstraint TableLikeClause
-%type <ival>	TableLikeOptionList TableLikeOption
-%type <list>	ColQualList
-%type <node>	ColConstraint ColConstraintElem ConstraintAttr
-%type <ival>	key_actions key_delete key_match key_update key_action
-%type <ival>	ConstraintAttributeSpec ConstraintDeferrabilitySpec
-				ConstraintTimeSpec
-%type <str>		ExistingIndex
-
-%type <list>	constraints_set_list
-%type <boolean> constraints_set_mode
-%type <str>		OptTableSpace OptConsTableSpace OptTableSpaceOwner
-%type <list>	opt_check_option
-
-%type <str>		opt_provider security_label
-
 %type <target>	xml_attribute_el
 %type <list>	xml_attribute_list xml_attributes
 %type <node>	xml_root_version opt_xml_root_standalone
@@ -478,82 +313,75 @@ static void SplitColQualList(List *qualList,
  */
 
 /* ordinary key words in alphabetical order */
-%token <keyword> ABORT_P ABSOLUTE_P ACCESS ACTION ADD_P ADMIN AFTER
-	AGGREGATE ALL ALSO ALTER ALWAYS ANALYSE ANALYZE AND ANY ARRAY AS ASC
-	ASSERTION ASSIGNMENT ASYMMETRIC AT ATTRIBUTE AUTHORIZATION
+%token <keyword>
+	ALL ANALYSE ANALYZE AND ANY ARRAY AS ASC
+	ASYMMETRIC AT AUTHORIZATION
 
-	BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT
+	BETWEEN BIGINT BINARY BIT
 	BOOLEAN_P BOTH BY
 
-	CACHE CALLED CASCADE CASCADED CASE CAST CATALOG_P CHAIN CHAR_P
-	CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
-	CLUSTER COALESCE COLLATE COLLATION COLUMN COMMENT COMMENTS COMMIT
-	COMMITTED CONCURRENTLY CONFIGURATION CONNECTION CONSTRAINT CONSTRAINTS
-	CONTENT_P CONTINUE_P CONVERSION_P COPY COST CREATE
-	CROSS CSV CURRENT_P
+	CASE CAST CHAR_P
+	CHARACTER CHECK
+	COALESCE COLLATE COLUMN
+	CONCURRENTLY CONSTRAINT
+	CONTENT_P CREATE
+	CROSS CURRENT_P
 	CURRENT_CATALOG CURRENT_DATE CURRENT_ROLE CURRENT_SCHEMA
-	CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
+	CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR
 
-	DATA_P DATABASE DAY_P DEALLOCATE DEC DECIMAL_P DECLARE DEFAULT DEFAULTS
-	DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS DESC
-	DICTIONARY DISABLE_P DISCARD DISTINCT DO DOCUMENT_P DOMAIN_P DOUBLE_P DROP
+	DAY_P DEC DECIMAL_P DEFAULT
+	DEFERRABLE DELETE_P DELIMITER DELIMITERS DESC
+	DISTINCT DO DOCUMENT_P DOUBLE_P
 
-	EACH ELSE ENABLE_P ENCODING ENCRYPTED END_P ENUM_P ESCAPE EXCEPT
-	EXCLUDE EXCLUDING EXCLUSIVE EXECUTE EXISTS EXPLAIN
-	EXTENSION EXTERNAL EXTRACT
+	ELSE END_P ESCAPE EXCEPT
+	EXISTS
+	EXTRACT
 
-	FALSE_P FAMILY FETCH FIRST_P FLOAT_P FOLLOWING FOR FORCE FOREIGN FORWARD
-	FREEZE FROM FULL FUNCTION FUNCTIONS
+	FALSE_P FETCH FIRST_P FLOAT_P FOLLOWING FOR FOREIGN
+	FREEZE FROM FULL
 
-	GLOBAL GRANT GRANTED GREATEST GROUP_P
+	GLOBAL GRANT GREATEST GROUP_P
 
-	HANDLER HAVING HEADER_P HOLD HOUR_P
+	HAVING HOUR_P
 
-	IDENTITY_P IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P
-	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
+	ILIKE IN_P
+	INITIALLY
+	INNER_P INOUT INSERT INT_P INTEGER
+	INTERSECT INTERVAL INTO IS ISNULL
 
 	JOIN
 
-	KEY
-
-	LABEL LANGUAGE LARGE_P LAST_P LC_COLLATE_P LC_CTYPE_P LEADING
-	LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP
-	LOCATION LOCK_P
+	LAST_P LEADING
+	LEAST LEFT LIKE LIMIT LISTEN LOCAL LOCALTIME LOCALTIMESTAMP
 
-	MAPPING MATCH MAXVALUE MINUTE_P MINVALUE MODE MONTH_P MOVE
+	MINUTE_P MONTH_P
 
-	NAME_P NAMES NATIONAL NATURAL NCHAR NEXT NO NONE
-	NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF
+	NAME_P NATIONAL NATURAL NCHAR NEXT NO NONE
+	NOT NOTNULL NOWAIT NULL_P NULLIF
 	NULLS_P NUMERIC
 
-	OBJECT_P OF OFF OFFSET OIDS ON ONLY OPERATOR OPTION OPTIONS OR
-	ORDER OUT_P OUTER_P OVER OVERLAPS OVERLAY OWNED OWNER
-
-	PARSER PARTIAL PARTITION PASSING PASSWORD PLACING PLANS POSITION
-	PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY
-	PRIOR PRIVILEGES PROCEDURAL PROCEDURE
+	OF OFFSET ON ONLY OPERATOR OR
+	ORDER OUT_P OUTER_P OVER OVERLAPS OVERLAY
 
-	QUOTE
+	PARTITION PASSING PLACING POSITION
+	PRECEDING PRECISION PRESERVE PRIMARY
 
-	RANGE READ REAL REASSIGN RECHECK RECURSIVE REF REFERENCES REINDEX
-	RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA
-	RESET RESTART RESTRICT RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK
-	ROW ROWS RULE
+	RANGE READ REAL RECURSIVE REF REFERENCES
+	RETURNING RIGHT
+	ROW ROWS
 
-	SAVEPOINT SCHEMA SCROLL SEARCH SECOND_P SECURITY SELECT SEQUENCE SEQUENCES
-	SERIALIZABLE SERVER SESSION SESSION_USER SET SETOF SHARE
-	SHOW SIMILAR SIMPLE SMALLINT SOME STABLE STANDALONE_P START STATEMENT
-	STATISTICS STDIN STDOUT STORAGE STRICT_P STRIP_P SUBSTRING
-	SYMMETRIC SYSID SYSTEM_P
+	SECOND_P SELECT
+	SESSION_USER SET SETOF SHARE
+	SIMILAR SMALLINT SOME STANDALONE_P
+	STRIP_P SUBSTRING
+	SYMMETRIC
 
-	TABLE TABLES TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN TIME TIMESTAMP
-	TO TRAILING TRANSACTION TREAT TRIGGER TRIM TRUE_P
-	TRUNCATE TRUSTED TYPE_P
+	TABLE TEMP TEMPORARY TEXT_P THEN TIME TIMESTAMP
+	TO TRAILING TREAT TRIM TRUE_P
+	TYPE_P
 
-	UNBOUNDED UNCOMMITTED UNENCRYPTED UNION UNIQUE UNKNOWN UNLISTEN UNLOGGED
-	UNTIL UPDATE USER USING
+	UNBOUNDED UNION UNIQUE UNKNOWN UNLOGGED
+	UPDATE USER USING
 
 	VACUUM VALID VALIDATE VALIDATOR VALUE_P VALUES VARCHAR VARIADIC VARYING
 	VERBOSE VERSION_P VIEW VOLATILE
@@ -667,1342 +495,14 @@ stmtmulti:	stmtmulti ';' stmt
 		;
 
 stmt :
-			AlterDatabaseStmt
-			| AlterDatabaseSetStmt
-			| AlterDefaultPrivilegesStmt
-			| AlterDomainStmt
-			| AlterEnumStmt
-			| AlterExtensionStmt
-			| AlterExtensionContentsStmt
-			| AlterFdwStmt
-			| AlterForeignServerStmt
-			| AlterForeignTableStmt
-			| AlterFunctionStmt
-			| AlterGroupStmt
-			| AlterObjectSchemaStmt
-			| AlterOwnerStmt
-			| AlterSeqStmt
-			| AlterTableStmt
-			| AlterCompositeTypeStmt
-			| AlterRoleSetStmt
-			| AlterRoleStmt
-			| AlterTSConfigurationStmt
-			| AlterTSDictionaryStmt
-			| AlterUserMappingStmt
-			| AlterUserSetStmt
-			| AlterUserStmt
-			| AnalyzeStmt
-			| CheckPointStmt
-			| ClosePortalStmt
-			| ClusterStmt
-			| CommentStmt
-			| ConstraintsSetStmt
-			| CopyStmt
-			| CreateAsStmt
-			| CreateAssertStmt
-			| CreateCastStmt
-			| CreateConversionStmt
-			| CreateDomainStmt
-			| CreateExtensionStmt
-			| CreateFdwStmt
-			| CreateForeignServerStmt
-			| CreateForeignTableStmt
-			| CreateFunctionStmt
-			| CreateGroupStmt
-			| CreateOpClassStmt
-			| CreateOpFamilyStmt
-			| AlterOpFamilyStmt
-			| CreatePLangStmt
-			| CreateSchemaStmt
-			| CreateSeqStmt
-			| CreateStmt
-			| CreateTableSpaceStmt
-			| CreateTrigStmt
-			| CreateRoleStmt
-			| CreateUserStmt
-			| CreateUserMappingStmt
-			| CreatedbStmt
-			| DeallocateStmt
-			| DeclareCursorStmt
-			| DefineStmt
-			| DeleteStmt
-			| DiscardStmt
-			| DoStmt
-			| DropAssertStmt
-			| DropCastStmt
-			| DropFdwStmt
-			| DropForeignServerStmt
-			| DropGroupStmt
-			| DropOpClassStmt
-			| DropOpFamilyStmt
-			| DropOwnedStmt
-			| DropPLangStmt
-			| DropRuleStmt
-			| DropStmt
-			| DropTableSpaceStmt
-			| DropTrigStmt
-			| DropRoleStmt
-			| DropUserStmt
-			| DropUserMappingStmt
-			| DropdbStmt
-			| ExecuteStmt
-			| ExplainStmt
-			| FetchStmt
-			| GrantStmt
-			| GrantRoleStmt
-			| IndexStmt
+			DeleteStmt
 			| InsertStmt
-			| ListenStmt
-			| LoadStmt
-			| LockStmt
-			| NotifyStmt
-			| PrepareStmt
-			| ReassignOwnedStmt
-			| ReindexStmt
-			| RemoveAggrStmt
-			| RemoveFuncStmt
-			| RemoveOperStmt
-			| RenameStmt
-			| RevokeStmt
-			| RevokeRoleStmt
-			| RuleStmt
-			| SecLabelStmt
 			| SelectStmt
-			| TransactionStmt
-			| TruncateStmt
-			| UnlistenStmt
 			| UpdateStmt
-			| VacuumStmt
-			| VariableResetStmt
-			| VariableSetStmt
-			| VariableShowStmt
-			| ViewStmt
 			| /*EMPTY*/
 				{ $$ = NULL; }
 		;
 
-/*****************************************************************************
- *
- * Create a new Postgres DBMS role
- *
- *****************************************************************************/
-
-CreateRoleStmt:
-			CREATE ROLE RoleId opt_with OptRoleList
-				{
-					CreateRoleStmt *n = makeNode(CreateRoleStmt);
-					n->stmt_type = ROLESTMT_ROLE;
-					n->role = $3;
-					n->options = $5;
-					$$ = (Node *)n;
-				}
-		;
-
-
-opt_with:	WITH									{}
-			| /*EMPTY*/								{}
-		;
-
-/*
- * Options for CREATE ROLE and ALTER ROLE (also used by CREATE/ALTER USER
- * for backwards compatibility).  Note: the only option required by SQL99
- * is "WITH ADMIN name".
- */
-OptRoleList:
-			OptRoleList CreateOptRoleElem			{ $$ = lappend($1, $2); }
-			| /* EMPTY */							{ $$ = NIL; }
-		;
-
-AlterOptRoleList:
-			AlterOptRoleList AlterOptRoleElem		{ $$ = lappend($1, $2); }
-			| /* EMPTY */							{ $$ = NIL; }
-		;
-
-AlterOptRoleElem:
-			PASSWORD Sconst
-				{
-					$$ = makeDefElem("password",
-									 (Node *)makeString($2));
-				}
-			| PASSWORD NULL_P
-				{
-					$$ = makeDefElem("password", NULL);
-				}
-			| ENCRYPTED PASSWORD Sconst
-				{
-					$$ = makeDefElem("encryptedPassword",
-									 (Node *)makeString($3));
-				}
-			| UNENCRYPTED PASSWORD Sconst
-				{
-					$$ = makeDefElem("unencryptedPassword",
-									 (Node *)makeString($3));
-				}
-			| INHERIT
-				{
-					$$ = makeDefElem("inherit", (Node *)makeInteger(TRUE));
-				}
-			| CONNECTION LIMIT SignedIconst
-				{
-					$$ = makeDefElem("connectionlimit", (Node *)makeInteger($3));
-				}
-			| VALID UNTIL Sconst
-				{
-					$$ = makeDefElem("validUntil", (Node *)makeString($3));
-				}
-		/*	Supported but not documented for roles, for use by ALTER GROUP. */
-			| USER name_list
-				{
-					$$ = makeDefElem("rolemembers", (Node *)$2);
-				}
-			| IDENT
-				{
-					/*
-					 * We handle identifiers that aren't parser keywords with
-					 * the following special-case codes, to avoid bloating the
-					 * size of the main parser.
-					 */
-					if (strcmp($1, "superuser") == 0)
-						$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
-					else if (strcmp($1, "nosuperuser") == 0)
-						$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
-					else if (strcmp($1, "createuser") == 0)
-					{
-						/* For backwards compatibility, synonym for SUPERUSER */
-						$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
-					}
-					else if (strcmp($1, "nocreateuser") == 0)
-					{
-						/* For backwards compatibility, synonym for SUPERUSER */
-						$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
-					}
-					else if (strcmp($1, "createrole") == 0)
-						$$ = makeDefElem("createrole", (Node *)makeInteger(TRUE));
-					else if (strcmp($1, "nocreaterole") == 0)
-						$$ = makeDefElem("createrole", (Node *)makeInteger(FALSE));
-					else if (strcmp($1, "replication") == 0)
-						$$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE));
-					else if (strcmp($1, "noreplication") == 0)
-						$$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE));
-					else if (strcmp($1, "createdb") == 0)
-						$$ = makeDefElem("createdb", (Node *)makeInteger(TRUE));
-					else if (strcmp($1, "nocreatedb") == 0)
-						$$ = makeDefElem("createdb", (Node *)makeInteger(FALSE));
-					else if (strcmp($1, "login") == 0)
-						$$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE));
-					else if (strcmp($1, "nologin") == 0)
-						$$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE));
-					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));
-					}
-					else
-						ereport(ERROR,
-								(errcode(ERRCODE_SYNTAX_ERROR),
-								 errmsg("unrecognized role option \"%s\"", $1),
-									 parser_errposition(@1)));
-				}
-		;
-
-CreateOptRoleElem:
-			AlterOptRoleElem			{ $$ = $1; }
-			/* The following are not supported by ALTER ROLE/USER/GROUP */
-			| SYSID Iconst
-				{
-					$$ = makeDefElem("sysid", (Node *)makeInteger($2));
-				}
-			| ADMIN name_list
-				{
-					$$ = makeDefElem("adminmembers", (Node *)$2);
-				}
-			| ROLE name_list
-				{
-					$$ = makeDefElem("rolemembers", (Node *)$2);
-				}
-			| IN_P ROLE name_list
-				{
-					$$ = makeDefElem("addroleto", (Node *)$3);
-				}
-			| IN_P GROUP_P name_list
-				{
-					$$ = makeDefElem("addroleto", (Node *)$3);
-				}
-		;
-
-
-/*****************************************************************************
- *
- * Create a new Postgres DBMS user (role with implied login ability)
- *
- *****************************************************************************/
-
-CreateUserStmt:
-			CREATE USER RoleId opt_with OptRoleList
-				{
-					CreateRoleStmt *n = makeNode(CreateRoleStmt);
-					n->stmt_type = ROLESTMT_USER;
-					n->role = $3;
-					n->options = $5;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- * Alter a postgresql DBMS role
- *
- *****************************************************************************/
-
-AlterRoleStmt:
-			ALTER ROLE RoleId opt_with AlterOptRoleList
-				 {
-					AlterRoleStmt *n = makeNode(AlterRoleStmt);
-					n->role = $3;
-					n->action = +1;	/* add, if there are members */
-					n->options = $5;
-					$$ = (Node *)n;
-				 }
-		;
-
-opt_in_database:
-			   /* EMPTY */					{ $$ = NULL; }
-			| IN_P DATABASE database_name	{ $$ = $3; }
-		;
-
-AlterRoleSetStmt:
-			ALTER ROLE RoleId opt_in_database SetResetClause
-				{
-					AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt);
-					n->role = $3;
-					n->database = $4;
-					n->setstmt = $5;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- * Alter a postgresql DBMS user
- *
- *****************************************************************************/
-
-AlterUserStmt:
-			ALTER USER RoleId opt_with AlterOptRoleList
-				 {
-					AlterRoleStmt *n = makeNode(AlterRoleStmt);
-					n->role = $3;
-					n->action = +1;	/* add, if there are members */
-					n->options = $5;
-					$$ = (Node *)n;
-				 }
-		;
-
-
-AlterUserSetStmt:
-			ALTER USER RoleId SetResetClause
-				{
-					AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt);
-					n->role = $3;
-					n->database = NULL;
-					n->setstmt = $4;
-					$$ = (Node *)n;
-				}
-			;
-
-
-/*****************************************************************************
- *
- * Drop a postgresql DBMS role
- *
- * XXX Ideally this would have CASCADE/RESTRICT options, but since a role
- * might own objects in multiple databases, there is presently no way to
- * implement either cascading or restricting.  Caveat DBA.
- *****************************************************************************/
-
-DropRoleStmt:
-			DROP ROLE name_list
-				{
-					DropRoleStmt *n = makeNode(DropRoleStmt);
-					n->missing_ok = FALSE;
-					n->roles = $3;
-					$$ = (Node *)n;
-				}
-			| DROP ROLE IF_P EXISTS name_list
-				{
-					DropRoleStmt *n = makeNode(DropRoleStmt);
-					n->missing_ok = TRUE;
-					n->roles = $5;
-					$$ = (Node *)n;
-				}
-			;
-
-/*****************************************************************************
- *
- * Drop a postgresql DBMS user
- *
- * XXX Ideally this would have CASCADE/RESTRICT options, but since a user
- * might own objects in multiple databases, there is presently no way to
- * implement either cascading or restricting.  Caveat DBA.
- *****************************************************************************/
-
-DropUserStmt:
-			DROP USER name_list
-				{
-					DropRoleStmt *n = makeNode(DropRoleStmt);
-					n->missing_ok = FALSE;
-					n->roles = $3;
-					$$ = (Node *)n;
-				}
-			| DROP USER IF_P EXISTS name_list
-				{
-					DropRoleStmt *n = makeNode(DropRoleStmt);
-					n->roles = $5;
-					n->missing_ok = TRUE;
-					$$ = (Node *)n;
-				}
-			;
-
-
-/*****************************************************************************
- *
- * Create a postgresql group (role without login ability)
- *
- *****************************************************************************/
-
-CreateGroupStmt:
-			CREATE GROUP_P RoleId opt_with OptRoleList
-				{
-					CreateRoleStmt *n = makeNode(CreateRoleStmt);
-					n->stmt_type = ROLESTMT_GROUP;
-					n->role = $3;
-					n->options = $5;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- * Alter a postgresql group
- *
- *****************************************************************************/
-
-AlterGroupStmt:
-			ALTER GROUP_P RoleId add_drop USER name_list
-				{
-					AlterRoleStmt *n = makeNode(AlterRoleStmt);
-					n->role = $3;
-					n->action = $4;
-					n->options = list_make1(makeDefElem("rolemembers",
-														(Node *)$6));
-					$$ = (Node *)n;
-				}
-		;
-
-add_drop:	ADD_P									{ $$ = +1; }
-			| DROP									{ $$ = -1; }
-		;
-
-
-/*****************************************************************************
- *
- * Drop a postgresql group
- *
- * XXX see above notes about cascading DROP USER; groups have same problem.
- *****************************************************************************/
-
-DropGroupStmt:
-			DROP GROUP_P name_list
-				{
-					DropRoleStmt *n = makeNode(DropRoleStmt);
-					n->missing_ok = FALSE;
-					n->roles = $3;
-					$$ = (Node *)n;
-				}
-			| DROP GROUP_P IF_P EXISTS name_list
-				{
-					DropRoleStmt *n = makeNode(DropRoleStmt);
-					n->missing_ok = TRUE;
-					n->roles = $5;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- * Manipulate a schema
- *
- *****************************************************************************/
-
-CreateSchemaStmt:
-			CREATE SCHEMA OptSchemaName AUTHORIZATION RoleId OptSchemaEltList
-				{
-					CreateSchemaStmt *n = makeNode(CreateSchemaStmt);
-					/* One can omit the schema name or the authorization id. */
-					if ($3 != NULL)
-						n->schemaname = $3;
-					else
-						n->schemaname = $5;
-					n->authid = $5;
-					n->schemaElts = $6;
-					$$ = (Node *)n;
-				}
-			| CREATE SCHEMA ColId OptSchemaEltList
-				{
-					CreateSchemaStmt *n = makeNode(CreateSchemaStmt);
-					/* ...but not both */
-					n->schemaname = $3;
-					n->authid = NULL;
-					n->schemaElts = $4;
-					$$ = (Node *)n;
-				}
-		;
-
-OptSchemaName:
-			ColId									{ $$ = $1; }
-			| /* EMPTY */							{ $$ = NULL; }
-		;
-
-OptSchemaEltList:
-			OptSchemaEltList schema_stmt			{ $$ = lappend($1, $2); }
-			| /* EMPTY */							{ $$ = NIL; }
-		;
-
-/*
- *	schema_stmt are the ones that can show up inside a CREATE SCHEMA
- *	statement (in addition to by themselves).
- */
-schema_stmt:
-			CreateStmt
-			| IndexStmt
-			| CreateSeqStmt
-			| CreateTrigStmt
-			| GrantStmt
-			| ViewStmt
-		;
-
-
-/*****************************************************************************
- *
- * Set PG internal variable
- *	  SET name TO 'var_value'
- * Include SQL92 syntax (thomas 1997-10-22):
- *	  SET TIME ZONE 'var_value'
- *
- *****************************************************************************/
-
-VariableSetStmt:
-			SET set_rest
-				{
-					VariableSetStmt *n = $2;
-					n->is_local = false;
-					$$ = (Node *) n;
-				}
-			| SET LOCAL set_rest
-				{
-					VariableSetStmt *n = $3;
-					n->is_local = true;
-					$$ = (Node *) n;
-				}
-			| SET SESSION set_rest
-				{
-					VariableSetStmt *n = $3;
-					n->is_local = false;
-					$$ = (Node *) n;
-				}
-		;
-
-set_rest:	/* Generic SET syntaxes: */
-			var_name TO var_list
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_VALUE;
-					n->name = $1;
-					n->args = $3;
-					$$ = n;
-				}
-			| var_name '=' var_list
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_VALUE;
-					n->name = $1;
-					n->args = $3;
-					$$ = n;
-				}
-			| var_name TO DEFAULT
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_DEFAULT;
-					n->name = $1;
-					$$ = n;
-				}
-			| var_name '=' DEFAULT
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_DEFAULT;
-					n->name = $1;
-					$$ = n;
-				}
-			| var_name FROM CURRENT_P
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_CURRENT;
-					n->name = $1;
-					$$ = n;
-				}
-			/* Special syntaxes mandated by SQL standard: */
-			| TIME ZONE zone_value
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_VALUE;
-					n->name = "timezone";
-					if ($3 != NULL)
-						n->args = list_make1($3);
-					else
-						n->kind = VAR_SET_DEFAULT;
-					$$ = n;
-				}
-			| TRANSACTION transaction_mode_list
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_MULTI;
-					n->name = "TRANSACTION";
-					n->args = $2;
-					$$ = n;
-				}
-			| SESSION CHARACTERISTICS AS TRANSACTION transaction_mode_list
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_MULTI;
-					n->name = "SESSION CHARACTERISTICS";
-					n->args = $5;
-					$$ = n;
-				}
-			| CATALOG_P Sconst
-				{
-					ereport(ERROR,
-							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-							 errmsg("current database cannot be changed"),
-							 parser_errposition(@2)));
-					$$ = NULL; /*not reached*/
-				}
-			| SCHEMA Sconst
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_VALUE;
-					n->name = "search_path";
-					n->args = list_make1(makeStringConst($2, @2));
-					$$ = n;
-				}
-			| NAMES opt_encoding
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_VALUE;
-					n->name = "client_encoding";
-					if ($2 != NULL)
-						n->args = list_make1(makeStringConst($2, @2));
-					else
-						n->kind = VAR_SET_DEFAULT;
-					$$ = n;
-				}
-			| ROLE ColId_or_Sconst
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_VALUE;
-					n->name = "role";
-					n->args = list_make1(makeStringConst($2, @2));
-					$$ = n;
-				}
-			| SESSION AUTHORIZATION ColId_or_Sconst
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_VALUE;
-					n->name = "session_authorization";
-					n->args = list_make1(makeStringConst($3, @3));
-					$$ = n;
-				}
-			| SESSION AUTHORIZATION DEFAULT
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_DEFAULT;
-					n->name = "session_authorization";
-					$$ = n;
-				}
-			| XML_P OPTION document_or_content
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_SET_VALUE;
-					n->name = "xmloption";
-					n->args = list_make1(makeStringConst($3 == XMLOPTION_DOCUMENT ? "DOCUMENT" : "CONTENT", @3));
-					$$ = n;
-				}
-		;
-
-var_name:	ColId								{ $$ = $1; }
-			| var_name '.' ColId
-				{
-					$$ = palloc(strlen($1) + strlen($3) + 2);
-					sprintf($$, "%s.%s", $1, $3);
-				}
-		;
-
-var_list:	var_value								{ $$ = list_make1($1); }
-			| var_list ',' var_value				{ $$ = lappend($1, $3); }
-		;
-
-var_value:	opt_boolean_or_string
-				{ $$ = makeStringConst($1, @1); }
-			| NumericOnly
-				{ $$ = makeAConst($1, @1); }
-		;
-
-iso_level:	READ UNCOMMITTED						{ $$ = "read uncommitted"; }
-			| READ COMMITTED						{ $$ = "read committed"; }
-			| REPEATABLE READ						{ $$ = "repeatable read"; }
-			| SERIALIZABLE							{ $$ = "serializable"; }
-		;
-
-opt_boolean_or_string:
-			TRUE_P									{ $$ = "true"; }
-			| FALSE_P								{ $$ = "false"; }
-			| ON									{ $$ = "on"; }
-			/*
-			 * OFF is also accepted as a boolean value, but is handled
-			 * by the ColId rule below. The action for booleans and strings
-			 * is the same, so we don't need to distinguish them here.
-			 */
-			| ColId_or_Sconst						{ $$ = $1; }
-		;
-
-/* Timezone values can be:
- * - a string such as 'pst8pdt'
- * - an identifier such as "pst8pdt"
- * - an integer or floating point number
- * - a time interval per SQL99
- * ColId gives reduce/reduce errors against ConstInterval and LOCAL,
- * so use IDENT (meaning we reject anything that is a key word).
- */
-zone_value:
-			Sconst
-				{
-					$$ = makeStringConst($1, @1);
-				}
-			| IDENT
-				{
-					$$ = makeStringConst($1, @1);
-				}
-			| ConstInterval Sconst opt_interval
-				{
-					TypeName *t = $1;
-					if ($3 != NIL)
-					{
-						A_Const *n = (A_Const *) linitial($3);
-						if ((n->val.val.ival & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0)
-							ereport(ERROR,
-									(errcode(ERRCODE_SYNTAX_ERROR),
-									 errmsg("time zone interval must be HOUR or HOUR TO MINUTE"),
-									 parser_errposition(@3)));
-					}
-					t->typmods = $3;
-					$$ = makeStringConstCast($2, @2, t);
-				}
-			| ConstInterval '(' Iconst ')' Sconst opt_interval
-				{
-					TypeName *t = $1;
-					if ($6 != NIL)
-					{
-						A_Const *n = (A_Const *) linitial($6);
-						if ((n->val.val.ival & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0)
-							ereport(ERROR,
-									(errcode(ERRCODE_SYNTAX_ERROR),
-									 errmsg("time zone interval must be HOUR or HOUR TO MINUTE"),
-									 parser_errposition(@6)));
-						if (list_length($6) != 1)
-							ereport(ERROR,
-									(errcode(ERRCODE_SYNTAX_ERROR),
-									 errmsg("interval precision specified twice"),
-									 parser_errposition(@1)));
-						t->typmods = lappend($6, makeIntConst($3, @3));
-					}
-					else
-						t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
-												makeIntConst($3, @3));
-					$$ = makeStringConstCast($5, @5, t);
-				}
-			| NumericOnly							{ $$ = makeAConst($1, @1); }
-			| DEFAULT								{ $$ = NULL; }
-			| LOCAL									{ $$ = NULL; }
-		;
-
-opt_encoding:
-			Sconst									{ $$ = $1; }
-			| DEFAULT								{ $$ = NULL; }
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-ColId_or_Sconst:
-			ColId									{ $$ = $1; }
-			| Sconst								{ $$ = $1; }
-		;
-
-VariableResetStmt:
-			RESET var_name
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_RESET;
-					n->name = $2;
-					$$ = (Node *) n;
-				}
-			| RESET TIME ZONE
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_RESET;
-					n->name = "timezone";
-					$$ = (Node *) n;
-				}
-			| RESET TRANSACTION ISOLATION LEVEL
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_RESET;
-					n->name = "transaction_isolation";
-					$$ = (Node *) n;
-				}
-			| RESET SESSION AUTHORIZATION
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_RESET;
-					n->name = "session_authorization";
-					$$ = (Node *) n;
-				}
-			| RESET ALL
-				{
-					VariableSetStmt *n = makeNode(VariableSetStmt);
-					n->kind = VAR_RESET_ALL;
-					$$ = (Node *) n;
-				}
-		;
-
-/* SetResetClause allows SET or RESET without LOCAL */
-SetResetClause:
-			SET set_rest					{ $$ = $2; }
-			| VariableResetStmt				{ $$ = (VariableSetStmt *) $1; }
-		;
-
-
-VariableShowStmt:
-			SHOW var_name
-				{
-					VariableShowStmt *n = makeNode(VariableShowStmt);
-					n->name = $2;
-					$$ = (Node *) n;
-				}
-			| SHOW TIME ZONE
-				{
-					VariableShowStmt *n = makeNode(VariableShowStmt);
-					n->name = "timezone";
-					$$ = (Node *) n;
-				}
-			| SHOW TRANSACTION ISOLATION LEVEL
-				{
-					VariableShowStmt *n = makeNode(VariableShowStmt);
-					n->name = "transaction_isolation";
-					$$ = (Node *) n;
-				}
-			| SHOW SESSION AUTHORIZATION
-				{
-					VariableShowStmt *n = makeNode(VariableShowStmt);
-					n->name = "session_authorization";
-					$$ = (Node *) n;
-				}
-			| SHOW ALL
-				{
-					VariableShowStmt *n = makeNode(VariableShowStmt);
-					n->name = "all";
-					$$ = (Node *) n;
-				}
-		;
-
-
-ConstraintsSetStmt:
-			SET CONSTRAINTS constraints_set_list constraints_set_mode
-				{
-					ConstraintsSetStmt *n = makeNode(ConstraintsSetStmt);
-					n->constraints = $3;
-					n->deferred    = $4;
-					$$ = (Node *) n;
-				}
-		;
-
-constraints_set_list:
-			ALL										{ $$ = NIL; }
-			| qualified_name_list					{ $$ = $1; }
-		;
-
-constraints_set_mode:
-			DEFERRED								{ $$ = TRUE; }
-			| IMMEDIATE								{ $$ = FALSE; }
-		;
-
-
-/*
- * Checkpoint statement
- */
-CheckPointStmt:
-			CHECKPOINT
-				{
-					CheckPointStmt *n = makeNode(CheckPointStmt);
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- * DISCARD { ALL | TEMP | PLANS }
- *
- *****************************************************************************/
-
-DiscardStmt:
-			DISCARD ALL
-				{
-					DiscardStmt *n = makeNode(DiscardStmt);
-					n->target = DISCARD_ALL;
-					$$ = (Node *) n;
-				}
-			| DISCARD TEMP
-				{
-					DiscardStmt *n = makeNode(DiscardStmt);
-					n->target = DISCARD_TEMP;
-					$$ = (Node *) n;
-				}
-			| DISCARD TEMPORARY
-				{
-					DiscardStmt *n = makeNode(DiscardStmt);
-					n->target = DISCARD_TEMP;
-					$$ = (Node *) n;
-				}
-			| DISCARD PLANS
-				{
-					DiscardStmt *n = makeNode(DiscardStmt);
-					n->target = DISCARD_PLANS;
-					$$ = (Node *) n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *	ALTER [ TABLE | INDEX | SEQUENCE | VIEW ] variations
- *
- * Note: we accept all subcommands for each of the four variants, and sort
- * out what's really legal at execution time.
- *****************************************************************************/
-
-AlterTableStmt:
-			ALTER TABLE relation_expr alter_table_cmds
-				{
-					AlterTableStmt *n = makeNode(AlterTableStmt);
-					n->relation = $3;
-					n->cmds = $4;
-					n->relkind = OBJECT_TABLE;
-					$$ = (Node *)n;
-				}
-		|	ALTER INDEX qualified_name alter_table_cmds
-				{
-					AlterTableStmt *n = makeNode(AlterTableStmt);
-					n->relation = $3;
-					n->cmds = $4;
-					n->relkind = OBJECT_INDEX;
-					$$ = (Node *)n;
-				}
-		|	ALTER SEQUENCE qualified_name alter_table_cmds
-				{
-					AlterTableStmt *n = makeNode(AlterTableStmt);
-					n->relation = $3;
-					n->cmds = $4;
-					n->relkind = OBJECT_SEQUENCE;
-					$$ = (Node *)n;
-				}
-		|	ALTER VIEW qualified_name alter_table_cmds
-				{
-					AlterTableStmt *n = makeNode(AlterTableStmt);
-					n->relation = $3;
-					n->cmds = $4;
-					n->relkind = OBJECT_VIEW;
-					$$ = (Node *)n;
-				}
-		;
-
-alter_table_cmds:
-			alter_table_cmd							{ $$ = list_make1($1); }
-			| alter_table_cmds ',' alter_table_cmd	{ $$ = lappend($1, $3); }
-		;
-
-alter_table_cmd:
-			/* ALTER TABLE <name> ADD <coldef> */
-			ADD_P columnDef
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_AddColumn;
-					n->def = $2;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ADD COLUMN <coldef> */
-			| ADD_P COLUMN columnDef
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_AddColumn;
-					n->def = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ALTER [COLUMN] <colname> {SET DEFAULT <expr>|DROP DEFAULT} */
-			| ALTER opt_column ColId alter_column_default
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_ColumnDefault;
-					n->name = $3;
-					n->def = $4;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ALTER [COLUMN] <colname> DROP NOT NULL */
-			| ALTER opt_column ColId DROP NOT NULL_P
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropNotNull;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ALTER [COLUMN] <colname> SET NOT NULL */
-			| ALTER opt_column ColId SET NOT NULL_P
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_SetNotNull;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ALTER [COLUMN] <colname> SET STATISTICS <SignedIconst> */
-			| ALTER opt_column ColId SET STATISTICS SignedIconst
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_SetStatistics;
-					n->name = $3;
-					n->def = (Node *) makeInteger($6);
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ALTER [COLUMN] <colname> SET ( column_parameter = value [, ... ] ) */
-			| ALTER opt_column ColId SET reloptions
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_SetOptions;
-					n->name = $3;
-					n->def = (Node *) $5;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ALTER [COLUMN] <colname> SET ( column_parameter = value [, ... ] ) */
-			| ALTER opt_column ColId RESET reloptions
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_ResetOptions;
-					n->name = $3;
-					n->def = (Node *) $5;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ALTER [COLUMN] <colname> SET STORAGE <storagemode> */
-			| ALTER opt_column ColId SET STORAGE ColId
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_SetStorage;
-					n->name = $3;
-					n->def = (Node *) makeString($6);
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> DROP [COLUMN] IF EXISTS <colname> [RESTRICT|CASCADE] */
-			| DROP opt_column IF_P EXISTS ColId opt_drop_behavior
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropColumn;
-					n->name = $5;
-					n->behavior = $6;
-					n->missing_ok = TRUE;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> DROP [COLUMN] <colname> [RESTRICT|CASCADE] */
-			| DROP opt_column ColId opt_drop_behavior
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropColumn;
-					n->name = $3;
-					n->behavior = $4;
-					n->missing_ok = FALSE;
-					$$ = (Node *)n;
-				}
-			/*
-			 * ALTER TABLE <name> ALTER [COLUMN] <colname> [SET DATA] TYPE <typename>
-			 *		[ USING <expression> ]
-			 */
-			| ALTER opt_column ColId opt_set_data TYPE_P Typename opt_collate_clause alter_using
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					ColumnDef *def = makeNode(ColumnDef);
-					n->subtype = AT_AlterColumnType;
-					n->name = $3;
-					n->def = (Node *) def;
-					/* We only use these three fields of the ColumnDef node */
-					def->typeName = $6;
-					def->collClause = (CollateClause *) $7;
-					def->raw_default = $8;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ADD CONSTRAINT ... */
-			| ADD_P TableConstraint
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_AddConstraint;
-					n->def = $2;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> VALIDATE CONSTRAINT ... */
-			| VALIDATE CONSTRAINT name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_ValidateConstraint;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> DROP CONSTRAINT IF EXISTS <name> [RESTRICT|CASCADE] */
-			| DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropConstraint;
-					n->name = $5;
-					n->behavior = $6;
-					n->missing_ok = TRUE;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> DROP CONSTRAINT <name> [RESTRICT|CASCADE] */
-			| DROP CONSTRAINT name opt_drop_behavior
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropConstraint;
-					n->name = $3;
-					n->behavior = $4;
-					n->missing_ok = FALSE;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> SET WITH OIDS  */
-			| SET WITH OIDS
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_AddOids;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> SET WITHOUT OIDS  */
-			| SET WITHOUT OIDS
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropOids;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> CLUSTER ON <indexname> */
-			| CLUSTER ON name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_ClusterOn;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> SET WITHOUT CLUSTER */
-			| SET WITHOUT CLUSTER
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropCluster;
-					n->name = NULL;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ENABLE TRIGGER <trig> */
-			| ENABLE_P TRIGGER name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_EnableTrig;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ENABLE ALWAYS TRIGGER <trig> */
-			| ENABLE_P ALWAYS TRIGGER name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_EnableAlwaysTrig;
-					n->name = $4;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ENABLE REPLICA TRIGGER <trig> */
-			| ENABLE_P REPLICA TRIGGER name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_EnableReplicaTrig;
-					n->name = $4;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ENABLE TRIGGER ALL */
-			| ENABLE_P TRIGGER ALL
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_EnableTrigAll;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ENABLE TRIGGER USER */
-			| ENABLE_P TRIGGER USER
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_EnableTrigUser;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> DISABLE TRIGGER <trig> */
-			| DISABLE_P TRIGGER name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DisableTrig;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> DISABLE TRIGGER ALL */
-			| DISABLE_P TRIGGER ALL
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DisableTrigAll;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> DISABLE TRIGGER USER */
-			| DISABLE_P TRIGGER USER
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DisableTrigUser;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ENABLE RULE <rule> */
-			| ENABLE_P RULE name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_EnableRule;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ENABLE ALWAYS RULE <rule> */
-			| ENABLE_P ALWAYS RULE name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_EnableAlwaysRule;
-					n->name = $4;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> ENABLE REPLICA RULE <rule> */
-			| ENABLE_P REPLICA RULE name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_EnableReplicaRule;
-					n->name = $4;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> DISABLE RULE <rule> */
-			| DISABLE_P RULE name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DisableRule;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> INHERIT <parent> */
-			| INHERIT qualified_name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_AddInherit;
-					n->def = (Node *) $2;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> NO INHERIT <parent> */
-			| NO INHERIT qualified_name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropInherit;
-					n->def = (Node *) $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> OF <type_name> */
-			| OF any_name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					TypeName *def = makeTypeNameFromNameList($2);
-					def->location = @2;
-					n->subtype = AT_AddOf;
-					n->def = (Node *) def;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> NOT OF */
-			| NOT OF
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropOf;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> OWNER TO RoleId */
-			| OWNER TO RoleId
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_ChangeOwner;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> SET TABLESPACE <tablespacename> */
-			| SET TABLESPACE name
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_SetTableSpace;
-					n->name = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> SET (...) */
-			| SET reloptions
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_SetRelOptions;
-					n->def = (Node *)$2;
-					$$ = (Node *)n;
-				}
-			/* ALTER TABLE <name> RESET (...) */
-			| RESET reloptions
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_ResetRelOptions;
-					n->def = (Node *)$2;
-					$$ = (Node *)n;
-				}
-			| alter_generic_options
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_GenericOptions;
-					n->def = (Node *)$1;
-					$$ = (Node *) n;
-				}
-		;
-
-alter_column_default:
-			SET DEFAULT a_expr			{ $$ = $3; }
-			| DROP DEFAULT				{ $$ = NULL; }
-		;
-
-opt_drop_behavior:
-			CASCADE						{ $$ = DROP_CASCADE; }
-			| RESTRICT					{ $$ = DROP_RESTRICT; }
-			| /* EMPTY */				{ $$ = DROP_RESTRICT; /* default */ }
-		;
-
 opt_collate_clause:
 			COLLATE any_name
 				{
@@ -2015,2753 +515,6 @@ opt_collate_clause:
 			| /* EMPTY */				{ $$ = NULL; }
 		;
 
-alter_using:
-			USING a_expr				{ $$ = $2; }
-			| /* EMPTY */				{ $$ = NULL; }
-		;
-
-reloptions:
-		  	'(' reloption_list ')'					{ $$ = $2; }
-		;
-
-opt_reloptions:		WITH reloptions					{ $$ = $2; }
-			 |		/* EMPTY */						{ $$ = NIL; }
-		;
-
-reloption_list:
-			reloption_elem							{ $$ = list_make1($1); }
-			| reloption_list ',' reloption_elem		{ $$ = lappend($1, $3); }
-		;
-
-/* This should match def_elem and also allow qualified names */
-reloption_elem:
-			ColLabel '=' def_arg
-				{
-					$$ = makeDefElem($1, (Node *) $3);
-				}
-			| ColLabel
-				{
-					$$ = makeDefElem($1, NULL);
-				}
-			| ColLabel '.' ColLabel '=' def_arg
-				{
-					$$ = makeDefElemExtended($1, $3, (Node *) $5,
-											 DEFELEM_UNSPEC);
-				}
-			| ColLabel '.' ColLabel
-				{
-					$$ = makeDefElemExtended($1, $3, NULL, DEFELEM_UNSPEC);
-				}
-		;
-
-
-/*****************************************************************************
- *
- *	ALTER TYPE
- *
- * really variants of the ALTER TABLE subcommands with different spellings
- *****************************************************************************/
-
-AlterCompositeTypeStmt:
-			ALTER TYPE_P any_name alter_type_cmds
-				{
-					AlterTableStmt *n = makeNode(AlterTableStmt);
-
-					/* can't use qualified_name, sigh */
-					n->relation = makeRangeVarFromAnyName($3, @3, yyscanner);
-					n->cmds = $4;
-					n->relkind = OBJECT_TYPE;
-					$$ = (Node *)n;
-				}
-			;
-
-alter_type_cmds:
-			alter_type_cmd							{ $$ = list_make1($1); }
-			| alter_type_cmds ',' alter_type_cmd	{ $$ = lappend($1, $3); }
-		;
-
-alter_type_cmd:
-			/* ALTER TYPE <name> ADD ATTRIBUTE <coldef> [RESTRICT|CASCADE] */
-			ADD_P ATTRIBUTE TableFuncElement opt_drop_behavior
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_AddColumn;
-					n->def = $3;
-					n->behavior = $4;
-					$$ = (Node *)n;
-				}
-			/* ALTER TYPE <name> DROP ATTRIBUTE IF EXISTS <attname> [RESTRICT|CASCADE] */
-			| DROP ATTRIBUTE IF_P EXISTS ColId opt_drop_behavior
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropColumn;
-					n->name = $5;
-					n->behavior = $6;
-					n->missing_ok = TRUE;
-					$$ = (Node *)n;
-				}
-			/* ALTER TYPE <name> DROP ATTRIBUTE <attname> [RESTRICT|CASCADE] */
-			| DROP ATTRIBUTE ColId opt_drop_behavior
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					n->subtype = AT_DropColumn;
-					n->name = $3;
-					n->behavior = $4;
-					n->missing_ok = FALSE;
-					$$ = (Node *)n;
-				}
-			/* ALTER TYPE <name> ALTER ATTRIBUTE <attname> [SET DATA] TYPE <typename> [RESTRICT|CASCADE] */
-			| ALTER ATTRIBUTE ColId opt_set_data TYPE_P Typename opt_collate_clause opt_drop_behavior
-				{
-					AlterTableCmd *n = makeNode(AlterTableCmd);
-					ColumnDef *def = makeNode(ColumnDef);
-					n->subtype = AT_AlterColumnType;
-					n->name = $3;
-					n->def = (Node *) def;
-					n->behavior = $8;
-					/* We only use these three fields of the ColumnDef node */
-					def->typeName = $6;
-					def->collClause = (CollateClause *) $7;
-					def->raw_default = NULL;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY :
- *				close <portalname>
- *
- *****************************************************************************/
-
-ClosePortalStmt:
-			CLOSE cursor_name
-				{
-					ClosePortalStmt *n = makeNode(ClosePortalStmt);
-					n->portalname = $2;
-					$$ = (Node *)n;
-				}
-			| CLOSE ALL
-				{
-					ClosePortalStmt *n = makeNode(ClosePortalStmt);
-					n->portalname = NULL;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY :
- *				COPY relname [(columnList)] FROM/TO file [WITH] [(options)]
- *				COPY ( SELECT ... ) TO file [WITH] [(options)]
- *
- *				In the preferred syntax the options are comma-separated
- *				and use generic identifiers instead of keywords.  The pre-9.0
- *				syntax had a hard-wired, space-separated set of options.
- *
- *				Really old syntax, from versions 7.2 and prior:
- *				COPY [ BINARY ] table [ WITH OIDS ] FROM/TO file
- *					[ [ USING ] DELIMITERS 'delimiter' ] ]
- *					[ WITH NULL AS 'null string' ]
- *				This option placement is not supported with COPY (SELECT...).
- *
- *****************************************************************************/
-
-CopyStmt:	COPY opt_binary qualified_name opt_column_list opt_oids
-			copy_from copy_file_name copy_delimiter opt_with copy_options
-				{
-					CopyStmt *n = makeNode(CopyStmt);
-					n->relation = $3;
-					n->query = NULL;
-					n->attlist = $4;
-					n->is_from = $6;
-					n->filename = $7;
-
-					n->options = NIL;
-					/* Concatenate user-supplied flags */
-					if ($2)
-						n->options = lappend(n->options, $2);
-					if ($5)
-						n->options = lappend(n->options, $5);
-					if ($8)
-						n->options = lappend(n->options, $8);
-					if ($10)
-						n->options = list_concat(n->options, $10);
-					$$ = (Node *)n;
-				}
-			| COPY select_with_parens TO copy_file_name opt_with copy_options
-				{
-					CopyStmt *n = makeNode(CopyStmt);
-					n->relation = NULL;
-					n->query = $2;
-					n->attlist = NIL;
-					n->is_from = false;
-					n->filename = $4;
-					n->options = $6;
-					$$ = (Node *)n;
-				}
-		;
-
-copy_from:
-			FROM									{ $$ = TRUE; }
-			| TO									{ $$ = FALSE; }
-		;
-
-/*
- * copy_file_name NULL indicates stdio is used. Whether stdin or stdout is
- * used depends on the direction. (It really doesn't make sense to copy from
- * stdout. We silently correct the "typo".)		 - AY 9/94
- */
-copy_file_name:
-			Sconst									{ $$ = $1; }
-			| STDIN									{ $$ = NULL; }
-			| STDOUT								{ $$ = NULL; }
-		;
-
-copy_options: copy_opt_list							{ $$ = $1; }
-			| '(' copy_generic_opt_list ')'			{ $$ = $2; }
-		;
-
-/* old COPY option syntax */
-copy_opt_list:
-			copy_opt_list copy_opt_item				{ $$ = lappend($1, $2); }
-			| /* EMPTY */							{ $$ = NIL; }
-		;
-
-copy_opt_item:
-			BINARY
-				{
-					$$ = makeDefElem("format", (Node *)makeString("binary"));
-				}
-			| OIDS
-				{
-					$$ = makeDefElem("oids", (Node *)makeInteger(TRUE));
-				}
-			| DELIMITER opt_as Sconst
-				{
-					$$ = makeDefElem("delimiter", (Node *)makeString($3));
-				}
-			| NULL_P opt_as Sconst
-				{
-					$$ = makeDefElem("null", (Node *)makeString($3));
-				}
-			| CSV
-				{
-					$$ = makeDefElem("format", (Node *)makeString("csv"));
-				}
-			| HEADER_P
-				{
-					$$ = makeDefElem("header", (Node *)makeInteger(TRUE));
-				}
-			| QUOTE opt_as Sconst
-				{
-					$$ = makeDefElem("quote", (Node *)makeString($3));
-				}
-			| ESCAPE opt_as Sconst
-				{
-					$$ = makeDefElem("escape", (Node *)makeString($3));
-				}
-			| FORCE QUOTE columnList
-				{
-					$$ = makeDefElem("force_quote", (Node *)$3);
-				}
-			| FORCE QUOTE '*'
-				{
-					$$ = makeDefElem("force_quote", (Node *)makeNode(A_Star));
-				}
-			| FORCE NOT NULL_P columnList
-				{
-					$$ = makeDefElem("force_not_null", (Node *)$4);
-				}
-			| ENCODING Sconst
-				{
-					$$ = makeDefElem("encoding", (Node *)makeString($2));
-				}
-		;
-
-/* The following exist for backward compatibility with very old versions */
-
-opt_binary:
-			BINARY
-				{
-					$$ = makeDefElem("format", (Node *)makeString("binary"));
-				}
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-opt_oids:
-			WITH OIDS
-				{
-					$$ = makeDefElem("oids", (Node *)makeInteger(TRUE));
-				}
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-copy_delimiter:
-			opt_using DELIMITERS Sconst
-				{
-					$$ = makeDefElem("delimiter", (Node *)makeString($3));
-				}
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-opt_using:
-			USING									{}
-			| /*EMPTY*/								{}
-		;
-
-/* new COPY option syntax */
-copy_generic_opt_list:
-			copy_generic_opt_elem
-				{
-					$$ = list_make1($1);
-				}
-			| copy_generic_opt_list ',' copy_generic_opt_elem
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-copy_generic_opt_elem:
-			ColLabel copy_generic_opt_arg
-				{
-					$$ = makeDefElem($1, $2);
-				}
-		;
-
-copy_generic_opt_arg:
-			opt_boolean_or_string			{ $$ = (Node *) makeString($1); }
-			| NumericOnly					{ $$ = (Node *) $1; }
-			| '*'							{ $$ = (Node *) makeNode(A_Star); }
-			| '(' copy_generic_opt_arg_list ')'		{ $$ = (Node *) $2; }
-			| /* EMPTY */					{ $$ = NULL; }
-		;
-
-copy_generic_opt_arg_list:
-			  copy_generic_opt_arg_list_item
-				{
-					$$ = list_make1($1);
-				}
-			| copy_generic_opt_arg_list ',' copy_generic_opt_arg_list_item
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-/* beware of emitting non-string list elements here; see commands/define.c */
-copy_generic_opt_arg_list_item:
-			opt_boolean_or_string	{ $$ = (Node *) makeString($1); }
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY :
- *				CREATE TABLE relname
- *
- *****************************************************************************/
-
-CreateStmt:	CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')'
-			OptInherit OptWith OnCommitOption OptTableSpace
-				{
-					CreateStmt *n = makeNode(CreateStmt);
-					$4->relpersistence = $2;
-					n->relation = $4;
-					n->tableElts = $6;
-					n->inhRelations = $8;
-					n->constraints = NIL;
-					n->options = $9;
-					n->oncommit = $10;
-					n->tablespacename = $11;
-					n->if_not_exists = false;
-					$$ = (Node *)n;
-				}
-		| CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name '('
-			OptTableElementList ')' OptInherit OptWith OnCommitOption
-			OptTableSpace
-				{
-					CreateStmt *n = makeNode(CreateStmt);
-					$7->relpersistence = $2;
-					n->relation = $7;
-					n->tableElts = $9;
-					n->inhRelations = $11;
-					n->constraints = NIL;
-					n->options = $12;
-					n->oncommit = $13;
-					n->tablespacename = $14;
-					n->if_not_exists = true;
-					$$ = (Node *)n;
-				}
-		| CREATE OptTemp TABLE qualified_name OF any_name
-			OptTypedTableElementList OptWith OnCommitOption OptTableSpace
-				{
-					CreateStmt *n = makeNode(CreateStmt);
-					$4->relpersistence = $2;
-					n->relation = $4;
-					n->tableElts = $7;
-					n->ofTypename = makeTypeNameFromNameList($6);
-					n->ofTypename->location = @6;
-					n->constraints = NIL;
-					n->options = $8;
-					n->oncommit = $9;
-					n->tablespacename = $10;
-					n->if_not_exists = false;
-					$$ = (Node *)n;
-				}
-		| CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name OF any_name
-			OptTypedTableElementList OptWith OnCommitOption OptTableSpace
-				{
-					CreateStmt *n = makeNode(CreateStmt);
-					$7->relpersistence = $2;
-					n->relation = $7;
-					n->tableElts = $10;
-					n->ofTypename = makeTypeNameFromNameList($9);
-					n->ofTypename->location = @9;
-					n->constraints = NIL;
-					n->options = $11;
-					n->oncommit = $12;
-					n->tablespacename = $13;
-					n->if_not_exists = true;
-					$$ = (Node *)n;
-				}
-		;
-
-/*
- * Redundancy here is needed to avoid shift/reduce conflicts,
- * since TEMP is not a reserved word.  See also OptTempTableName.
- *
- * NOTE: we accept both GLOBAL and LOCAL options; since we have no modules
- * the LOCAL keyword is really meaningless.
- */
-OptTemp:	TEMPORARY					{ $$ = RELPERSISTENCE_TEMP; }
-			| TEMP						{ $$ = RELPERSISTENCE_TEMP; }
-			| LOCAL TEMPORARY			{ $$ = RELPERSISTENCE_TEMP; }
-			| LOCAL TEMP				{ $$ = RELPERSISTENCE_TEMP; }
-			| GLOBAL TEMPORARY			{ $$ = RELPERSISTENCE_TEMP; }
-			| GLOBAL TEMP				{ $$ = RELPERSISTENCE_TEMP; }
-			| UNLOGGED					{ $$ = RELPERSISTENCE_UNLOGGED; }
-			| /*EMPTY*/					{ $$ = RELPERSISTENCE_PERMANENT; }
-		;
-
-OptTableElementList:
-			TableElementList					{ $$ = $1; }
-			| /*EMPTY*/							{ $$ = NIL; }
-		;
-
-OptTypedTableElementList:
-			'(' TypedTableElementList ')'		{ $$ = $2; }
-			| /*EMPTY*/							{ $$ = NIL; }
-		;
-
-TableElementList:
-			TableElement
-				{
-					$$ = list_make1($1);
-				}
-			| TableElementList ',' TableElement
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-TypedTableElementList:
-			TypedTableElement
-				{
-					$$ = list_make1($1);
-				}
-			| TypedTableElementList ',' TypedTableElement
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-TableElement:
-			columnDef							{ $$ = $1; }
-			| TableLikeClause					{ $$ = $1; }
-			| TableConstraint					{ $$ = $1; }
-		;
-
-TypedTableElement:
-			columnOptions						{ $$ = $1; }
-			| TableConstraint					{ $$ = $1; }
-		;
-
-columnDef:	ColId Typename ColQualList
-				{
-					ColumnDef *n = makeNode(ColumnDef);
-					n->colname = $1;
-					n->typeName = $2;
-					n->inhcount = 0;
-					n->is_local = true;
-					n->is_not_null = false;
-					n->is_from_type = false;
-					n->storage = 0;
-					n->raw_default = NULL;
-					n->cooked_default = NULL;
-					n->collOid = InvalidOid;
-					SplitColQualList($3, &n->constraints, &n->collClause,
-									 yyscanner);
-					$$ = (Node *)n;
-				}
-		;
-
-columnOptions:	ColId WITH OPTIONS ColQualList
-				{
-					ColumnDef *n = makeNode(ColumnDef);
-					n->colname = $1;
-					n->typeName = NULL;
-					n->inhcount = 0;
-					n->is_local = true;
-					n->is_not_null = false;
-					n->is_from_type = false;
-					n->storage = 0;
-					n->raw_default = NULL;
-					n->cooked_default = NULL;
-					n->collOid = InvalidOid;
-					SplitColQualList($4, &n->constraints, &n->collClause,
-									 yyscanner);
-					$$ = (Node *)n;
-				}
-		;
-
-ColQualList:
-			ColQualList ColConstraint				{ $$ = lappend($1, $2); }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-ColConstraint:
-			CONSTRAINT name ColConstraintElem
-				{
-					Constraint *n = (Constraint *) $3;
-					Assert(IsA(n, Constraint));
-					n->conname = $2;
-					n->location = @1;
-					$$ = (Node *) n;
-				}
-			| ColConstraintElem						{ $$ = $1; }
-			| ConstraintAttr						{ $$ = $1; }
-			| COLLATE any_name
-				{
-					/*
-					 * Note: the CollateClause is momentarily included in
-					 * the list built by ColQualList, but we split it out
-					 * again in SplitColQualList.
-					 */
-					CollateClause *n = makeNode(CollateClause);
-					n->arg = NULL;
-					n->collname = $2;
-					n->location = @1;
-					$$ = (Node *) n;
-				}
-		;
-
-/* DEFAULT NULL is already the default for Postgres.
- * But define it here and carry it forward into the system
- * to make it explicit.
- * - thomas 1998-09-13
- *
- * WITH NULL and NULL are not SQL92-standard syntax elements,
- * so leave them out. Use DEFAULT NULL to explicitly indicate
- * that a column may have that value. WITH NULL leads to
- * shift/reduce conflicts with WITH TIME ZONE anyway.
- * - thomas 1999-01-08
- *
- * DEFAULT expression must be b_expr not a_expr to prevent shift/reduce
- * conflict on NOT (since NOT might start a subsequent NOT NULL constraint,
- * or be part of a_expr NOT LIKE or similar constructs).
- */
-ColConstraintElem:
-			NOT NULL_P
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_NOTNULL;
-					n->location = @1;
-					$$ = (Node *)n;
-				}
-			| NULL_P
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_NULL;
-					n->location = @1;
-					$$ = (Node *)n;
-				}
-			| UNIQUE opt_definition OptConsTableSpace
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_UNIQUE;
-					n->location = @1;
-					n->keys = NULL;
-					n->options = $2;
-					n->indexname = NULL;
-					n->indexspace = $3;
-					$$ = (Node *)n;
-				}
-			| PRIMARY KEY opt_definition OptConsTableSpace
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_PRIMARY;
-					n->location = @1;
-					n->keys = NULL;
-					n->options = $3;
-					n->indexname = NULL;
-					n->indexspace = $4;
-					$$ = (Node *)n;
-				}
-			| CHECK '(' a_expr ')'
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_CHECK;
-					n->location = @1;
-					n->raw_expr = $3;
-					n->cooked_expr = NULL;
-					$$ = (Node *)n;
-				}
-			| DEFAULT b_expr
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_DEFAULT;
-					n->location = @1;
-					n->raw_expr = $2;
-					n->cooked_expr = NULL;
-					$$ = (Node *)n;
-				}
-			| REFERENCES qualified_name opt_column_list key_match key_actions
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_FOREIGN;
-					n->location = @1;
-					n->pktable			= $2;
-					n->fk_attrs			= NIL;
-					n->pk_attrs			= $3;
-					n->fk_matchtype		= $4;
-					n->fk_upd_action	= (char) ($5 >> 8);
-					n->fk_del_action	= (char) ($5 & 0xFF);
-					n->skip_validation  = FALSE;
-					n->initially_valid  = true;
-					$$ = (Node *)n;
-				}
-		;
-
-/*
- * ConstraintAttr represents constraint attributes, which we parse as if
- * they were independent constraint clauses, in order to avoid shift/reduce
- * conflicts (since NOT might start either an independent NOT NULL clause
- * or an attribute).  parse_utilcmd.c is responsible for attaching the
- * attribute information to the preceding "real" constraint node, and for
- * complaining if attribute clauses appear in the wrong place or wrong
- * combinations.
- *
- * See also ConstraintAttributeSpec, which can be used in places where
- * there is no parsing conflict.
- */
-ConstraintAttr:
-			DEFERRABLE
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_ATTR_DEFERRABLE;
-					n->location = @1;
-					$$ = (Node *)n;
-				}
-			| NOT DEFERRABLE
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_ATTR_NOT_DEFERRABLE;
-					n->location = @1;
-					$$ = (Node *)n;
-				}
-			| INITIALLY DEFERRED
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_ATTR_DEFERRED;
-					n->location = @1;
-					$$ = (Node *)n;
-				}
-			| INITIALLY IMMEDIATE
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_ATTR_IMMEDIATE;
-					n->location = @1;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*
- * SQL99 supports wholesale borrowing of a table definition via the LIKE clause.
- * This seems to be a poor man's inheritance capability, with the resulting
- * tables completely decoupled except for the original commonality in definitions.
- *
- * This is very similar to CREATE TABLE AS except for the INCLUDING DEFAULTS extension
- * which is a part of SQL:2003.
- */
-TableLikeClause:
-			LIKE qualified_name TableLikeOptionList
-				{
-					InhRelation *n = makeNode(InhRelation);
-					n->relation = $2;
-					n->options = $3;
-					$$ = (Node *)n;
-				}
-		;
-
-TableLikeOptionList:
-				TableLikeOptionList INCLUDING TableLikeOption	{ $$ = $1 | $3; }
-				| TableLikeOptionList EXCLUDING TableLikeOption	{ $$ = $1 & ~$3; }
-				| /* EMPTY */						{ $$ = 0; }
-		;
-
-TableLikeOption:
-				DEFAULTS			{ $$ = CREATE_TABLE_LIKE_DEFAULTS; }
-				| CONSTRAINTS		{ $$ = CREATE_TABLE_LIKE_CONSTRAINTS; }
-				| INDEXES			{ $$ = CREATE_TABLE_LIKE_INDEXES; }
-				| STORAGE			{ $$ = CREATE_TABLE_LIKE_STORAGE; }
-				| COMMENTS			{ $$ = CREATE_TABLE_LIKE_COMMENTS; }
-				| ALL				{ $$ = CREATE_TABLE_LIKE_ALL; }
-		;
-
-
-/* ConstraintElem specifies constraint syntax which is not embedded into
- *	a column definition. ColConstraintElem specifies the embedded form.
- * - thomas 1997-12-03
- */
-TableConstraint:
-			CONSTRAINT name ConstraintElem
-				{
-					Constraint *n = (Constraint *) $3;
-					Assert(IsA(n, Constraint));
-					n->conname = $2;
-					n->location = @1;
-					$$ = (Node *) n;
-				}
-			| ConstraintElem						{ $$ = $1; }
-		;
-
-ConstraintElem:
-			CHECK '(' a_expr ')' ConstraintAttributeSpec
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_CHECK;
-					n->location = @1;
-					n->raw_expr = $3;
-					n->cooked_expr = NULL;
-					if ($5 != 0)
-						ereport(ERROR,
-								(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-								 errmsg("CHECK constraints cannot be deferred"),
-								 parser_errposition(@5)));
-					$$ = (Node *)n;
-				}
-			| UNIQUE '(' columnList ')' opt_definition OptConsTableSpace
-				ConstraintAttributeSpec
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_UNIQUE;
-					n->location = @1;
-					n->keys = $3;
-					n->options = $5;
-					n->indexname = NULL;
-					n->indexspace = $6;
-					n->deferrable = ($7 & 1) != 0;
-					n->initdeferred = ($7 & 2) != 0;
-					$$ = (Node *)n;
-				}
-			| UNIQUE ExistingIndex ConstraintAttributeSpec
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_UNIQUE;
-					n->location = @1;
-					n->keys = NIL;
-					n->options = NIL;
-					n->indexname = $2;
-					n->indexspace = NULL;
-					n->deferrable = ($3 & 1) != 0;
-					n->initdeferred = ($3 & 2) != 0;
-					$$ = (Node *)n;
-				}
-			| PRIMARY KEY '(' columnList ')' opt_definition OptConsTableSpace
-				ConstraintAttributeSpec
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_PRIMARY;
-					n->location = @1;
-					n->keys = $4;
-					n->options = $6;
-					n->indexname = NULL;
-					n->indexspace = $7;
-					n->deferrable = ($8 & 1) != 0;
-					n->initdeferred = ($8 & 2) != 0;
-					$$ = (Node *)n;
-				}
-			| PRIMARY KEY ExistingIndex ConstraintAttributeSpec
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_PRIMARY;
-					n->location = @1;
-					n->keys = NIL;
-					n->options = NIL;
-					n->indexname = $3;
-					n->indexspace = NULL;
-					n->deferrable = ($4 & 1) != 0;
-					n->initdeferred = ($4 & 2) != 0;
-					$$ = (Node *)n;
-				}
-			| EXCLUDE access_method_clause '(' ExclusionConstraintList ')'
-				opt_definition OptConsTableSpace ExclusionWhereClause
-				ConstraintAttributeSpec
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_EXCLUSION;
-					n->location = @1;
-					n->access_method	= $2;
-					n->exclusions		= $4;
-					n->options			= $6;
-					n->indexname		= NULL;
-					n->indexspace		= $7;
-					n->where_clause		= $8;
-					n->deferrable		= ($9 & 1) != 0;
-					n->initdeferred		= ($9 & 2) != 0;
-					$$ = (Node *)n;
-				}
-			| FOREIGN KEY '(' columnList ')' REFERENCES qualified_name
-				opt_column_list key_match key_actions ConstraintAttributeSpec
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_FOREIGN;
-					n->location = @1;
-					n->pktable			= $7;
-					n->fk_attrs			= $4;
-					n->pk_attrs			= $8;
-					n->fk_matchtype		= $9;
-					n->fk_upd_action	= (char) ($10 >> 8);
-					n->fk_del_action	= (char) ($10 & 0xFF);
-					n->deferrable		= ($11 & 1) != 0;
-					n->initdeferred		= ($11 & 2) != 0;
-					n->skip_validation  = false;
-					n->initially_valid  = true;
-					$$ = (Node *)n;
-				}
-			| FOREIGN KEY '(' columnList ')' REFERENCES qualified_name
-				opt_column_list key_match key_actions
-				NOT VALID
-				{
-					Constraint *n = makeNode(Constraint);
-					n->contype = CONSTR_FOREIGN;
-					n->location = @1;
-					n->pktable			= $7;
-					n->fk_attrs			= $4;
-					n->pk_attrs			= $8;
-					n->fk_matchtype		= $9;
-					n->fk_upd_action	= (char) ($10 >> 8);
-					n->fk_del_action	= (char) ($10 & 0xFF);
-					n->skip_validation  = true;
-					n->initially_valid  = false;
-					$$ = (Node *)n;
-				}
-		;
-
-opt_column_list:
-			'(' columnList ')'						{ $$ = $2; }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-columnList:
-			columnElem								{ $$ = list_make1($1); }
-			| columnList ',' columnElem				{ $$ = lappend($1, $3); }
-		;
-
-columnElem: ColId
-				{
-					$$ = (Node *) makeString($1);
-				}
-		;
-
-key_match:  MATCH FULL
-			{
-				$$ = FKCONSTR_MATCH_FULL;
-			}
-		| MATCH PARTIAL
-			{
-				ereport(ERROR,
-						(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-						 errmsg("MATCH PARTIAL not yet implemented"),
-						 parser_errposition(@1)));
-				$$ = FKCONSTR_MATCH_PARTIAL;
-			}
-		| MATCH SIMPLE
-			{
-				$$ = FKCONSTR_MATCH_UNSPECIFIED;
-			}
-		| /*EMPTY*/
-			{
-				$$ = FKCONSTR_MATCH_UNSPECIFIED;
-			}
-		;
-
-ExclusionConstraintList:
-			ExclusionConstraintElem					{ $$ = list_make1($1); }
-			| ExclusionConstraintList ',' ExclusionConstraintElem
-													{ $$ = lappend($1, $3); }
-		;
-
-ExclusionConstraintElem: index_elem WITH any_operator
-			{
-				$$ = list_make2($1, $3);
-			}
-			/* allow OPERATOR() decoration for the benefit of ruleutils.c */
-			| index_elem WITH OPERATOR '(' any_operator ')'
-			{
-				$$ = list_make2($1, $5);
-			}
-		;
-
-ExclusionWhereClause:
-			WHERE '(' a_expr ')'					{ $$ = $3; }
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-/*
- * We combine the update and delete actions into one value temporarily
- * for simplicity of parsing, and then break them down again in the
- * calling production.  update is in the left 8 bits, delete in the right.
- * Note that NOACTION is the default.
- */
-key_actions:
-			key_update
-				{ $$ = ($1 << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); }
-			| key_delete
-				{ $$ = (FKCONSTR_ACTION_NOACTION << 8) | ($1 & 0xFF); }
-			| key_update key_delete
-				{ $$ = ($1 << 8) | ($2 & 0xFF); }
-			| key_delete key_update
-				{ $$ = ($2 << 8) | ($1 & 0xFF); }
-			| /*EMPTY*/
-				{ $$ = (FKCONSTR_ACTION_NOACTION << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); }
-		;
-
-key_update: ON UPDATE key_action		{ $$ = $3; }
-		;
-
-key_delete: ON DELETE_P key_action		{ $$ = $3; }
-		;
-
-key_action:
-			NO ACTION					{ $$ = FKCONSTR_ACTION_NOACTION; }
-			| RESTRICT					{ $$ = FKCONSTR_ACTION_RESTRICT; }
-			| CASCADE					{ $$ = FKCONSTR_ACTION_CASCADE; }
-			| SET NULL_P				{ $$ = FKCONSTR_ACTION_SETNULL; }
-			| SET DEFAULT				{ $$ = FKCONSTR_ACTION_SETDEFAULT; }
-		;
-
-OptInherit: INHERITS '(' qualified_name_list ')'	{ $$ = $3; }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-/* WITH (options) is preferred, WITH OIDS and WITHOUT OIDS are legacy forms */
-OptWith:
-			WITH reloptions				{ $$ = $2; }
-			| WITH OIDS					{ $$ = list_make1(defWithOids(true)); }
-			| WITHOUT OIDS				{ $$ = list_make1(defWithOids(false)); }
-			| /*EMPTY*/					{ $$ = NIL; }
-		;
-
-OnCommitOption:  ON COMMIT DROP				{ $$ = ONCOMMIT_DROP; }
-			| ON COMMIT DELETE_P ROWS		{ $$ = ONCOMMIT_DELETE_ROWS; }
-			| ON COMMIT PRESERVE ROWS		{ $$ = ONCOMMIT_PRESERVE_ROWS; }
-			| /*EMPTY*/						{ $$ = ONCOMMIT_NOOP; }
-		;
-
-OptTableSpace:   TABLESPACE name					{ $$ = $2; }
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-OptConsTableSpace:   USING INDEX TABLESPACE name	{ $$ = $4; }
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-ExistingIndex:   USING INDEX index_name				{ $$ = $3; }
-		;
-
-
-/*
- * Note: CREATE TABLE ... AS SELECT ... is just another spelling for
- * SELECT ... INTO.
- */
-
-CreateAsStmt:
-		CREATE OptTemp TABLE create_as_target AS SelectStmt opt_with_data
-				{
-					/*
-					 * When the SelectStmt is a set-operation tree, we must
-					 * stuff the INTO information into the leftmost component
-					 * Select, because that's where analyze.c will expect
-					 * to find it.	Similarly, the output column names must
-					 * be attached to that Select's target list.
-					 */
-					SelectStmt *n = findLeftmostSelect((SelectStmt *) $6);
-					if (n->intoClause != NULL)
-						ereport(ERROR,
-								(errcode(ERRCODE_SYNTAX_ERROR),
-								 errmsg("CREATE TABLE AS cannot specify INTO"),
-								 parser_errposition(exprLocation((Node *) n->intoClause))));
-					$4->rel->relpersistence = $2;
-					n->intoClause = $4;
-					/* Implement WITH NO DATA by forcing top-level LIMIT 0 */
-					if (!$7)
-						((SelectStmt *) $6)->limitCount = makeIntConst(0, -1);
-					$$ = $6;
-				}
-		;
-
-create_as_target:
-			qualified_name OptCreateAs OptWith OnCommitOption OptTableSpace
-				{
-					$$ = makeNode(IntoClause);
-					$$->rel = $1;
-					$$->colNames = $2;
-					$$->options = $3;
-					$$->onCommit = $4;
-					$$->tableSpaceName = $5;
-				}
-		;
-
-OptCreateAs:
-			'(' CreateAsList ')'					{ $$ = $2; }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-CreateAsList:
-			CreateAsElement							{ $$ = list_make1($1); }
-			| CreateAsList ',' CreateAsElement		{ $$ = lappend($1, $3); }
-		;
-
-CreateAsElement:
-			ColId
-				{
-					ColumnDef *n = makeNode(ColumnDef);
-					n->colname = $1;
-					n->typeName = NULL;
-					n->inhcount = 0;
-					n->is_local = true;
-					n->is_not_null = false;
-					n->is_from_type = false;
-					n->storage = 0;
-					n->raw_default = NULL;
-					n->cooked_default = NULL;
-					n->collClause = NULL;
-					n->collOid = InvalidOid;
-					n->constraints = NIL;
-					$$ = (Node *)n;
-				}
-		;
-
-opt_with_data:
-			WITH DATA_P								{ $$ = TRUE; }
-			| WITH NO DATA_P						{ $$ = FALSE; }
-			| /*EMPTY*/								{ $$ = TRUE; }
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY :
- *				CREATE SEQUENCE seqname
- *				ALTER SEQUENCE seqname
- *
- *****************************************************************************/
-
-CreateSeqStmt:
-			CREATE OptTemp SEQUENCE qualified_name OptSeqOptList
-				{
-					CreateSeqStmt *n = makeNode(CreateSeqStmt);
-					$4->relpersistence = $2;
-					n->sequence = $4;
-					n->options = $5;
-					n->ownerId = InvalidOid;
-					$$ = (Node *)n;
-				}
-		;
-
-AlterSeqStmt:
-			ALTER SEQUENCE qualified_name SeqOptList
-				{
-					AlterSeqStmt *n = makeNode(AlterSeqStmt);
-					n->sequence = $3;
-					n->options = $4;
-					$$ = (Node *)n;
-				}
-		;
-
-OptSeqOptList: SeqOptList							{ $$ = $1; }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-SeqOptList: SeqOptElem								{ $$ = list_make1($1); }
-			| SeqOptList SeqOptElem					{ $$ = lappend($1, $2); }
-		;
-
-SeqOptElem: CACHE NumericOnly
-				{
-					$$ = makeDefElem("cache", (Node *)$2);
-				}
-			| CYCLE
-				{
-					$$ = makeDefElem("cycle", (Node *)makeInteger(TRUE));
-				}
-			| NO CYCLE
-				{
-					$$ = makeDefElem("cycle", (Node *)makeInteger(FALSE));
-				}
-			| INCREMENT opt_by NumericOnly
-				{
-					$$ = makeDefElem("increment", (Node *)$3);
-				}
-			| MAXVALUE NumericOnly
-				{
-					$$ = makeDefElem("maxvalue", (Node *)$2);
-				}
-			| MINVALUE NumericOnly
-				{
-					$$ = makeDefElem("minvalue", (Node *)$2);
-				}
-			| NO MAXVALUE
-				{
-					$$ = makeDefElem("maxvalue", NULL);
-				}
-			| NO MINVALUE
-				{
-					$$ = makeDefElem("minvalue", NULL);
-				}
-			| OWNED BY any_name
-				{
-					$$ = makeDefElem("owned_by", (Node *)$3);
-				}
-			| START opt_with NumericOnly
-				{
-					$$ = makeDefElem("start", (Node *)$3);
-				}
-			| RESTART
-				{
-					$$ = makeDefElem("restart", NULL);
-				}
-			| RESTART opt_with NumericOnly
-				{
-					$$ = makeDefElem("restart", (Node *)$3);
-				}
-		;
-
-opt_by:		BY				{}
-			| /* empty */	{}
-	  ;
-
-NumericOnly:
-			FCONST								{ $$ = makeFloat($1); }
-			| '-' FCONST
-				{
-					$$ = makeFloat($2);
-					doNegateFloat($$);
-				}
-			| SignedIconst						{ $$ = makeInteger($1); }
-		;
-
-NumericOnly_list:	NumericOnly						{ $$ = list_make1($1); }
-				| NumericOnly_list ',' NumericOnly	{ $$ = lappend($1, $3); }
-		;
-
-/*****************************************************************************
- *
- *		QUERIES :
- *				CREATE [OR REPLACE] [TRUSTED] [PROCEDURAL] LANGUAGE ...
- *				DROP [PROCEDURAL] LANGUAGE ...
- *
- *****************************************************************************/
-
-CreatePLangStmt:
-			CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE ColId_or_Sconst
-			{
-				CreatePLangStmt *n = makeNode(CreatePLangStmt);
-				n->replace = $2;
-				n->plname = $6;
-				/* parameters are all to be supplied by system */
-				n->plhandler = NIL;
-				n->plinline = NIL;
-				n->plvalidator = NIL;
-				n->pltrusted = false;
-				$$ = (Node *)n;
-			}
-			| CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE ColId_or_Sconst
-			  HANDLER handler_name opt_inline_handler opt_validator
-			{
-				CreatePLangStmt *n = makeNode(CreatePLangStmt);
-				n->replace = $2;
-				n->plname = $6;
-				n->plhandler = $8;
-				n->plinline = $9;
-				n->plvalidator = $10;
-				n->pltrusted = $3;
-				$$ = (Node *)n;
-			}
-		;
-
-opt_trusted:
-			TRUSTED									{ $$ = TRUE; }
-			| /*EMPTY*/								{ $$ = FALSE; }
-		;
-
-/* This ought to be just func_name, but that causes reduce/reduce conflicts
- * (CREATE LANGUAGE is the only place where func_name isn't followed by '(').
- * Work around by using simple names, instead.
- */
-handler_name:
-			name						{ $$ = list_make1(makeString($1)); }
-			| name attrs				{ $$ = lcons(makeString($1), $2); }
-		;
-
-opt_inline_handler:
-			INLINE_P handler_name					{ $$ = $2; }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-validator_clause:
-			VALIDATOR handler_name					{ $$ = $2; }
-			| NO VALIDATOR							{ $$ = NIL; }
-		;
-
-opt_validator:
-			validator_clause						{ $$ = $1; }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-DropPLangStmt:
-			DROP opt_procedural LANGUAGE ColId_or_Sconst opt_drop_behavior
-				{
-					DropPLangStmt *n = makeNode(DropPLangStmt);
-					n->plname = $4;
-					n->behavior = $5;
-					n->missing_ok = false;
-					$$ = (Node *)n;
-				}
-			| DROP opt_procedural LANGUAGE IF_P EXISTS ColId_or_Sconst opt_drop_behavior
-				{
-					DropPLangStmt *n = makeNode(DropPLangStmt);
-					n->plname = $6;
-					n->behavior = $7;
-					n->missing_ok = true;
-					$$ = (Node *)n;
-				}
-		;
-
-opt_procedural:
-			PROCEDURAL								{}
-			| /*EMPTY*/								{}
-		;
-
-/*****************************************************************************
- *
- * 		QUERY:
- *             CREATE TABLESPACE tablespace LOCATION '/path/to/tablespace/'
- *
- *****************************************************************************/
-
-CreateTableSpaceStmt: CREATE TABLESPACE name OptTableSpaceOwner LOCATION Sconst
-				{
-					CreateTableSpaceStmt *n = makeNode(CreateTableSpaceStmt);
-					n->tablespacename = $3;
-					n->owner = $4;
-					n->location = $6;
-					$$ = (Node *) n;
-				}
-		;
-
-OptTableSpaceOwner: OWNER name			{ $$ = $2; }
-			| /*EMPTY */				{ $$ = NULL; }
-		;
-
-/*****************************************************************************
- *
- * 		QUERY :
- *				DROP TABLESPACE <tablespace>
- *
- *		No need for drop behaviour as we cannot implement dependencies for
- *		objects in other databases; we can only support RESTRICT.
- *
- ****************************************************************************/
-
-DropTableSpaceStmt: DROP TABLESPACE name
-				{
-					DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt);
-					n->tablespacename = $3;
-					n->missing_ok = false;
-					$$ = (Node *) n;
-				}
-				|  DROP TABLESPACE IF_P EXISTS name
-                {
-					DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt);
-					n->tablespacename = $5;
-					n->missing_ok = true;
-					$$ = (Node *) n;
-				}
-		;
-
-/*****************************************************************************
- *
- * 		QUERY:
- *             CREATE EXTENSION extension
- *             [ WITH ] [ SCHEMA schema ] [ VERSION version ] [ FROM oldversion ]
- *
- *****************************************************************************/
-
-CreateExtensionStmt: CREATE EXTENSION name opt_with create_extension_opt_list
-				{
-					CreateExtensionStmt *n = makeNode(CreateExtensionStmt);
-					n->extname = $3;
-					n->if_not_exists = false;
-					n->options = $5;
-					$$ = (Node *) n;
-				}
-				| CREATE EXTENSION IF_P NOT EXISTS name opt_with create_extension_opt_list
-				{
-					CreateExtensionStmt *n = makeNode(CreateExtensionStmt);
-					n->extname = $6;
-					n->if_not_exists = true;
-					n->options = $8;
-					$$ = (Node *) n;
-				}
-		;
-
-create_extension_opt_list:
-			create_extension_opt_list create_extension_opt_item
-				{ $$ = lappend($1, $2); }
-			| /* EMPTY */
-				{ $$ = NIL; }
-		;
-
-create_extension_opt_item:
-			SCHEMA name
-				{
-					$$ = makeDefElem("schema", (Node *)makeString($2));
-				}
-			| VERSION_P ColId_or_Sconst
-				{
-					$$ = makeDefElem("new_version", (Node *)makeString($2));
-				}
-			| FROM ColId_or_Sconst
-				{
-					$$ = makeDefElem("old_version", (Node *)makeString($2));
-				}
-		;
-
-/*****************************************************************************
- *
- * ALTER EXTENSION name UPDATE [ TO version ]
- *
- *****************************************************************************/
-
-AlterExtensionStmt: ALTER EXTENSION name UPDATE alter_extension_opt_list
-				{
-					AlterExtensionStmt *n = makeNode(AlterExtensionStmt);
-					n->extname = $3;
-					n->options = $5;
-					$$ = (Node *) n;
-				}
-		;
-
-alter_extension_opt_list:
-			alter_extension_opt_list alter_extension_opt_item
-				{ $$ = lappend($1, $2); }
-			| /* EMPTY */
-				{ $$ = NIL; }
-		;
-
-alter_extension_opt_item:
-			TO ColId_or_Sconst
-				{
-					$$ = makeDefElem("new_version", (Node *)makeString($2));
-				}
-		;
-
-/*****************************************************************************
- *
- * ALTER EXTENSION name ADD/DROP object-identifier
- *
- *****************************************************************************/
-
-AlterExtensionContentsStmt:
-			ALTER EXTENSION name add_drop AGGREGATE func_name aggr_args
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $6;
-					n->objargs = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop CAST '(' Typename AS Typename ')'
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_CAST;
-					n->objname = list_make1($7);
-					n->objargs = list_make1($9);
-					$$ = (Node *) n;
-				}
-			| ALTER EXTENSION name add_drop COLLATION any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_COLLATION;
-					n->objname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop CONVERSION_P any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_CONVERSION;
-					n->objname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop DOMAIN_P any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_DOMAIN;
-					n->objname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop FUNCTION function_with_argtypes
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_FUNCTION;
-					n->objname = $6->funcname;
-					n->objargs = $6->funcargs;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop opt_procedural LANGUAGE name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_LANGUAGE;
-					n->objname = list_make1(makeString($7));
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop OPERATOR any_operator oper_argtypes
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_OPERATOR;
-					n->objname = $6;
-					n->objargs = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop OPERATOR CLASS any_name USING access_method
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_OPCLASS;
-					n->objname = $7;
-					n->objargs = list_make1(makeString($9));
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop OPERATOR FAMILY any_name USING access_method
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_OPFAMILY;
-					n->objname = $7;
-					n->objargs = list_make1(makeString($9));
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop SCHEMA name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_SCHEMA;
-					n->objname = list_make1(makeString($6));
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop TABLE any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_TABLE;
-					n->objname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop TEXT_P SEARCH PARSER any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_TSPARSER;
-					n->objname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop TEXT_P SEARCH DICTIONARY any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_TSDICTIONARY;
-					n->objname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop TEXT_P SEARCH TEMPLATE any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_TSTEMPLATE;
-					n->objname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop TEXT_P SEARCH CONFIGURATION any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_TSCONFIGURATION;
-					n->objname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop SEQUENCE any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_SEQUENCE;
-					n->objname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop VIEW any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_VIEW;
-					n->objname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop FOREIGN TABLE any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_FOREIGN_TABLE;
-					n->objname = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop FOREIGN DATA_P WRAPPER name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_FDW;
-					n->objname = list_make1(makeString($8));
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop SERVER name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_FOREIGN_SERVER;
-					n->objname = list_make1(makeString($6));
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop TYPE_P any_name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_TYPE;
-					n->objname = $6;
-					$$ = (Node *)n;
-				}
-		;
-
-/*****************************************************************************
- *
- * 		QUERY:
- *             CREATE FOREIGN DATA WRAPPER name options
- *
- *****************************************************************************/
-
-CreateFdwStmt: CREATE FOREIGN DATA_P WRAPPER name opt_fdw_options create_generic_options
-				{
-					CreateFdwStmt *n = makeNode(CreateFdwStmt);
-					n->fdwname = $5;
-					n->func_options = $6;
-					n->options = $7;
-					$$ = (Node *) n;
-				}
-		;
-
-fdw_option:
-			HANDLER handler_name				{ $$ = makeDefElem("handler", (Node *)$2); }
-			| NO HANDLER						{ $$ = makeDefElem("handler", NULL); }
-			| VALIDATOR handler_name			{ $$ = makeDefElem("validator", (Node *)$2); }
-			| NO VALIDATOR						{ $$ = makeDefElem("validator", NULL); }
-		;
-
-fdw_options:
-			fdw_option							{ $$ = list_make1($1); }
-			| fdw_options fdw_option			{ $$ = lappend($1, $2); }
-		;
-
-opt_fdw_options:
-			fdw_options							{ $$ = $1; }
-			| /*EMPTY*/							{ $$ = NIL; }
-		;
-
-/*****************************************************************************
- *
- * 		QUERY :
- *				DROP FOREIGN DATA WRAPPER name
- *
- ****************************************************************************/
-
-DropFdwStmt: DROP FOREIGN DATA_P WRAPPER name opt_drop_behavior
-				{
-					DropFdwStmt *n = makeNode(DropFdwStmt);
-					n->fdwname = $5;
-					n->missing_ok = false;
-					n->behavior = $6;
-					$$ = (Node *) n;
-				}
-				|  DROP FOREIGN DATA_P WRAPPER IF_P EXISTS name opt_drop_behavior
-                {
-					DropFdwStmt *n = makeNode(DropFdwStmt);
-					n->fdwname = $7;
-					n->missing_ok = true;
-					n->behavior = $8;
-					$$ = (Node *) n;
-				}
-		;
-
-/*****************************************************************************
- *
- * 		QUERY :
- *				ALTER FOREIGN DATA WRAPPER name options
- *
- ****************************************************************************/
-
-AlterFdwStmt: ALTER FOREIGN DATA_P WRAPPER name opt_fdw_options alter_generic_options
-				{
-					AlterFdwStmt *n = makeNode(AlterFdwStmt);
-					n->fdwname = $5;
-					n->func_options = $6;
-					n->options = $7;
-					$$ = (Node *) n;
-				}
-			| ALTER FOREIGN DATA_P WRAPPER name fdw_options
-				{
-					AlterFdwStmt *n = makeNode(AlterFdwStmt);
-					n->fdwname = $5;
-					n->func_options = $6;
-					n->options = NIL;
-					$$ = (Node *) n;
-				}
-		;
-
-/* Options definition for CREATE FDW, SERVER and USER MAPPING */
-create_generic_options:
-			OPTIONS '(' generic_option_list ')'			{ $$ = $3; }
-			| /*EMPTY*/									{ $$ = NIL; }
-		;
-
-generic_option_list:
-			generic_option_elem
-				{
-					$$ = list_make1($1);
-				}
-			| generic_option_list ',' generic_option_elem
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-/* Options definition for ALTER FDW, SERVER and USER MAPPING */
-alter_generic_options:
-			OPTIONS	'(' alter_generic_option_list ')'		{ $$ = $3; }
-		;
-
-alter_generic_option_list:
-			alter_generic_option_elem
-				{
-					$$ = list_make1($1);
-				}
-			| alter_generic_option_list ',' alter_generic_option_elem
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-alter_generic_option_elem:
-			generic_option_elem
-				{
-					$$ = $1;
-				}
-			| SET generic_option_elem
-				{
-					$$ = $2;
-					$$->defaction = DEFELEM_SET;
-				}
-			| ADD_P generic_option_elem
-				{
-					$$ = $2;
-					$$->defaction = DEFELEM_ADD;
-				}
-			| DROP generic_option_name
-				{
-					$$ = makeDefElemExtended(NULL, $2, NULL, DEFELEM_DROP);
-				}
-		;
-
-generic_option_elem:
-			generic_option_name generic_option_arg
-				{
-					$$ = makeDefElem($1, $2);
-				}
-		;
-
-generic_option_name:
-				ColLabel			{ $$ = $1; }
-		;
-
-/* We could use def_arg here, but the spec only requires string literals */
-generic_option_arg:
-				Sconst				{ $$ = (Node *) makeString($1); }
-		;
-
-/*****************************************************************************
- *
- * 		QUERY:
- *             CREATE SERVER name [TYPE] [VERSION] [OPTIONS]
- *
- *****************************************************************************/
-
-CreateForeignServerStmt: CREATE SERVER name opt_type opt_foreign_server_version
-						 FOREIGN DATA_P WRAPPER name create_generic_options
-				{
-					CreateForeignServerStmt *n = makeNode(CreateForeignServerStmt);
-					n->servername = $3;
-					n->servertype = $4;
-					n->version = $5;
-					n->fdwname = $9;
-					n->options = $10;
-					$$ = (Node *) n;
-				}
-		;
-
-opt_type:
-			TYPE_P Sconst			{ $$ = $2; }
-			| /*EMPTY*/				{ $$ = NULL; }
-		;
-
-
-foreign_server_version:
-			VERSION_P Sconst		{ $$ = $2; }
-		|	VERSION_P NULL_P		{ $$ = NULL; }
-		;
-
-opt_foreign_server_version:
-			foreign_server_version 	{ $$ = $1; }
-			| /*EMPTY*/				{ $$ = NULL; }
-		;
-
-/*****************************************************************************
- *
- * 		QUERY :
- *				DROP SERVER name
- *
- ****************************************************************************/
-
-DropForeignServerStmt: DROP SERVER name opt_drop_behavior
-				{
-					DropForeignServerStmt *n = makeNode(DropForeignServerStmt);
-					n->servername = $3;
-					n->missing_ok = false;
-					n->behavior = $4;
-					$$ = (Node *) n;
-				}
-				|  DROP SERVER IF_P EXISTS name opt_drop_behavior
-                {
-					DropForeignServerStmt *n = makeNode(DropForeignServerStmt);
-					n->servername = $5;
-					n->missing_ok = true;
-					n->behavior = $6;
-					$$ = (Node *) n;
-				}
-		;
-
-/*****************************************************************************
- *
- * 		QUERY :
- *				ALTER SERVER name [VERSION] [OPTIONS]
- *
- ****************************************************************************/
-
-AlterForeignServerStmt: ALTER SERVER name foreign_server_version alter_generic_options
-				{
-					AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt);
-					n->servername = $3;
-					n->version = $4;
-					n->options = $5;
-					n->has_version = true;
-					$$ = (Node *) n;
-				}
-			| ALTER SERVER name foreign_server_version
-				{
-					AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt);
-					n->servername = $3;
-					n->version = $4;
-					n->has_version = true;
-					$$ = (Node *) n;
-				}
-			| ALTER SERVER name alter_generic_options
-				{
-					AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt);
-					n->servername = $3;
-					n->options = $4;
-					$$ = (Node *) n;
-				}
-		;
-
-/*****************************************************************************
- *
- * 		QUERY:
- *             CREATE FOREIGN TABLE relname (...) SERVER name (...)
- *
- *****************************************************************************/
-
-CreateForeignTableStmt:
-		CREATE FOREIGN TABLE qualified_name
-			OptForeignTableElementList
-			SERVER name create_generic_options
-				{
-					CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt);
-					$4->relpersistence = RELPERSISTENCE_PERMANENT;
-					n->base.relation = $4;
-					n->base.tableElts = $5;
-					n->base.inhRelations = NIL;
-					n->base.if_not_exists = false;
-					/* FDW-specific data */
-					n->servername = $7;
-					n->options = $8;
-					$$ = (Node *) n;
-				}
-		| CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name
-			OptForeignTableElementList
-			SERVER name create_generic_options
-				{
-					CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt);
-					$7->relpersistence = RELPERSISTENCE_PERMANENT;
-					n->base.relation = $7;
-					n->base.tableElts = $8;
-					n->base.inhRelations = NIL;
-					n->base.if_not_exists = true;
-					/* FDW-specific data */
-					n->servername = $10;
-					n->options = $11;
-					$$ = (Node *) n;
-				}
-		;
-
-OptForeignTableElementList:
-			'(' ForeignTableElementList ')'			{ $$ = $2; }
-			| '(' ')'								{ $$ = NIL; }
-		;
-
-ForeignTableElementList:
-			ForeignTableElement
-				{
-					$$ = list_make1($1);
-				}
-			| ForeignTableElementList ',' ForeignTableElement
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-ForeignTableElement:
-			columnDef					{ $$ = $1; }
-		;
-
-/*****************************************************************************
- *
- * 		QUERY:
- *             ALTER FOREIGN TABLE relname [...]
- *
- *****************************************************************************/
-
-AlterForeignTableStmt:
-			ALTER FOREIGN TABLE relation_expr alter_table_cmds
-				{
-					AlterTableStmt *n = makeNode(AlterTableStmt);
-					n->relation = $4;
-					n->cmds = $5;
-					n->relkind = OBJECT_FOREIGN_TABLE;
-					$$ = (Node *)n;
-				}
-		;
-
-/*****************************************************************************
- *
- * 		QUERY:
- *             CREATE USER MAPPING FOR auth_ident SERVER name [OPTIONS]
- *
- *****************************************************************************/
-
-CreateUserMappingStmt: CREATE USER MAPPING FOR auth_ident SERVER name create_generic_options
-				{
-					CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt);
-					n->username = $5;
-					n->servername = $7;
-					n->options = $8;
-					$$ = (Node *) n;
-				}
-		;
-
-/* User mapping authorization identifier */
-auth_ident:
-			CURRENT_USER 	{ $$ = "current_user"; }
-		|	USER			{ $$ = "current_user"; }
-		|	RoleId 			{ $$ = (strcmp($1, "public") == 0) ? NULL : $1; }
-		;
-
-/*****************************************************************************
- *
- * 		QUERY :
- *				DROP USER MAPPING FOR auth_ident SERVER name
- *
- ****************************************************************************/
-
-DropUserMappingStmt: DROP USER MAPPING FOR auth_ident SERVER name
-				{
-					DropUserMappingStmt *n = makeNode(DropUserMappingStmt);
-					n->username = $5;
-					n->servername = $7;
-					n->missing_ok = false;
-					$$ = (Node *) n;
-				}
-				|  DROP USER MAPPING IF_P EXISTS FOR auth_ident SERVER name
-                {
-					DropUserMappingStmt *n = makeNode(DropUserMappingStmt);
-					n->username = $7;
-					n->servername = $9;
-					n->missing_ok = true;
-					$$ = (Node *) n;
-				}
-		;
-
-/*****************************************************************************
- *
- * 		QUERY :
- *				ALTER USER MAPPING FOR auth_ident SERVER name OPTIONS
- *
- ****************************************************************************/
-
-AlterUserMappingStmt: ALTER USER MAPPING FOR auth_ident SERVER name alter_generic_options
-				{
-					AlterUserMappingStmt *n = makeNode(AlterUserMappingStmt);
-					n->username = $5;
-					n->servername = $7;
-					n->options = $8;
-					$$ = (Node *) n;
-				}
-		;
-
-/*****************************************************************************
- *
- *		QUERIES :
- *				CREATE TRIGGER ...
- *				DROP TRIGGER ...
- *
- *****************************************************************************/
-
-CreateTrigStmt:
-			CREATE TRIGGER name TriggerActionTime TriggerEvents ON
-			qualified_name TriggerForSpec TriggerWhen
-			EXECUTE PROCEDURE func_name '(' TriggerFuncArgs ')'
-				{
-					CreateTrigStmt *n = makeNode(CreateTrigStmt);
-					n->trigname = $3;
-					n->relation = $7;
-					n->funcname = $12;
-					n->args = $14;
-					n->row = $8;
-					n->timing = $4;
-					n->events = intVal(linitial($5));
-					n->columns = (List *) lsecond($5);
-					n->whenClause = $9;
-					n->isconstraint  = FALSE;
-					n->deferrable	 = FALSE;
-					n->initdeferred  = FALSE;
-					n->constrrel = NULL;
-					$$ = (Node *)n;
-				}
-			| CREATE CONSTRAINT TRIGGER name AFTER TriggerEvents ON
-			qualified_name OptConstrFromTable ConstraintAttributeSpec
-			FOR EACH ROW TriggerWhen
-			EXECUTE PROCEDURE func_name '(' TriggerFuncArgs ')'
-				{
-					CreateTrigStmt *n = makeNode(CreateTrigStmt);
-					n->trigname = $4;
-					n->relation = $8;
-					n->funcname = $17;
-					n->args = $19;
-					n->row = TRUE;
-					n->timing = TRIGGER_TYPE_AFTER;
-					n->events = intVal(linitial($6));
-					n->columns = (List *) lsecond($6);
-					n->whenClause = $14;
-					n->isconstraint  = TRUE;
-					n->deferrable = ($10 & 1) != 0;
-					n->initdeferred = ($10 & 2) != 0;
-					n->constrrel = $9;
-					$$ = (Node *)n;
-				}
-		;
-
-TriggerActionTime:
-			BEFORE								{ $$ = TRIGGER_TYPE_BEFORE; }
-			| AFTER								{ $$ = TRIGGER_TYPE_AFTER; }
-			| INSTEAD OF						{ $$ = TRIGGER_TYPE_INSTEAD; }
-		;
-
-TriggerEvents:
-			TriggerOneEvent
-				{ $$ = $1; }
-			| TriggerEvents OR TriggerOneEvent
-				{
-					int		events1 = intVal(linitial($1));
-					int		events2 = intVal(linitial($3));
-					List   *columns1 = (List *) lsecond($1);
-					List   *columns2 = (List *) lsecond($3);
-
-					if (events1 & events2)
-						parser_yyerror("duplicate trigger events specified");
-					/*
-					 * concat'ing the columns lists loses information about
-					 * which columns went with which event, but so long as
-					 * only UPDATE carries columns and we disallow multiple
-					 * UPDATE items, it doesn't matter.  Command execution
-					 * should just ignore the columns for non-UPDATE events.
-					 */
-					$$ = list_make2(makeInteger(events1 | events2),
-									list_concat(columns1, columns2));
-				}
-		;
-
-TriggerOneEvent:
-			INSERT
-				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); }
-			| DELETE_P
-				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }
-			| UPDATE
-				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }
-			| UPDATE OF columnList
-				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }
-			| TRUNCATE
-				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); }
-		;
-
-TriggerForSpec:
-			FOR TriggerForOptEach TriggerForType
-				{
-					$$ = $3;
-				}
-			| /* EMPTY */
-				{
-					/*
-					 * If ROW/STATEMENT not specified, default to
-					 * STATEMENT, per SQL
-					 */
-					$$ = FALSE;
-				}
-		;
-
-TriggerForOptEach:
-			EACH									{}
-			| /*EMPTY*/								{}
-		;
-
-TriggerForType:
-			ROW										{ $$ = TRUE; }
-			| STATEMENT								{ $$ = FALSE; }
-		;
-
-TriggerWhen:
-			WHEN '(' a_expr ')'						{ $$ = $3; }
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-TriggerFuncArgs:
-			TriggerFuncArg							{ $$ = list_make1($1); }
-			| TriggerFuncArgs ',' TriggerFuncArg	{ $$ = lappend($1, $3); }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-TriggerFuncArg:
-			Iconst
-				{
-					char buf[64];
-					snprintf(buf, sizeof(buf), "%d", $1);
-					$$ = makeString(pstrdup(buf));
-				}
-			| FCONST								{ $$ = makeString($1); }
-			| Sconst								{ $$ = makeString($1); }
-			| ColLabel								{ $$ = makeString($1); }
-		;
-
-OptConstrFromTable:
-			FROM qualified_name						{ $$ = $2; }
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-ConstraintAttributeSpec:
-			ConstraintDeferrabilitySpec
-				{ $$ = $1; }
-			| ConstraintDeferrabilitySpec ConstraintTimeSpec
-				{
-					if ($1 == 0 && $2 != 0)
-						ereport(ERROR,
-								(errcode(ERRCODE_SYNTAX_ERROR),
-								 errmsg("constraint declared INITIALLY DEFERRED must be DEFERRABLE"),
-								 parser_errposition(@1)));
-					$$ = $1 | $2;
-				}
-			| ConstraintTimeSpec
-				{
-					if ($1 != 0)
-						$$ = 3;
-					else
-						$$ = 0;
-				}
-			| ConstraintTimeSpec ConstraintDeferrabilitySpec
-				{
-					if ($2 == 0 && $1 != 0)
-						ereport(ERROR,
-								(errcode(ERRCODE_SYNTAX_ERROR),
-								 errmsg("constraint declared INITIALLY DEFERRED must be DEFERRABLE"),
-								 parser_errposition(@1)));
-					$$ = $1 | $2;
-				}
-			| /*EMPTY*/
-				{ $$ = 0; }
-		;
-
-ConstraintDeferrabilitySpec:
-			NOT DEFERRABLE							{ $$ = 0; }
-			| DEFERRABLE							{ $$ = 1; }
-		;
-
-ConstraintTimeSpec:
-			INITIALLY IMMEDIATE						{ $$ = 0; }
-			| INITIALLY DEFERRED					{ $$ = 2; }
-		;
-
-
-DropTrigStmt:
-			DROP TRIGGER name ON qualified_name opt_drop_behavior
-				{
-					DropPropertyStmt *n = makeNode(DropPropertyStmt);
-					n->relation = $5;
-					n->property = $3;
-					n->behavior = $6;
-					n->removeType = OBJECT_TRIGGER;
-					n->missing_ok = false;
-					$$ = (Node *) n;
-				}
-			| DROP TRIGGER IF_P EXISTS name ON qualified_name opt_drop_behavior
-				{
-					DropPropertyStmt *n = makeNode(DropPropertyStmt);
-					n->relation = $7;
-					n->property = $5;
-					n->behavior = $8;
-					n->removeType = OBJECT_TRIGGER;
-					n->missing_ok = true;
-					$$ = (Node *) n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		QUERIES :
- *				CREATE ASSERTION ...
- *				DROP ASSERTION ...
- *
- *****************************************************************************/
-
-CreateAssertStmt:
-			CREATE ASSERTION name CHECK '(' a_expr ')'
-			ConstraintAttributeSpec
-				{
-					CreateTrigStmt *n = makeNode(CreateTrigStmt);
-					n->trigname = $3;
-					n->args = list_make1($6);
-					n->isconstraint  = TRUE;
-					n->deferrable = ($8 & 1) != 0;
-					n->initdeferred = ($8 & 2) != 0;
-
-					ereport(ERROR,
-							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-							 errmsg("CREATE ASSERTION is not yet implemented")));
-
-					$$ = (Node *)n;
-				}
-		;
-
-DropAssertStmt:
-			DROP ASSERTION name opt_drop_behavior
-				{
-					DropPropertyStmt *n = makeNode(DropPropertyStmt);
-					n->relation = NULL;
-					n->property = $3;
-					n->behavior = $4;
-					n->removeType = OBJECT_TRIGGER; /* XXX */
-					ereport(ERROR,
-							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-							 errmsg("DROP ASSERTION is not yet implemented")));
-					$$ = (Node *) n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY :
- *				define (aggregate,operator,type)
- *
- *****************************************************************************/
-
-DefineStmt:
-			CREATE AGGREGATE func_name aggr_args definition
-				{
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_AGGREGATE;
-					n->oldstyle = false;
-					n->defnames = $3;
-					n->args = $4;
-					n->definition = $5;
-					$$ = (Node *)n;
-				}
-			| CREATE AGGREGATE func_name old_aggr_definition
-				{
-					/* old-style (pre-8.2) syntax for CREATE AGGREGATE */
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_AGGREGATE;
-					n->oldstyle = true;
-					n->defnames = $3;
-					n->args = NIL;
-					n->definition = $4;
-					$$ = (Node *)n;
-				}
-			| CREATE OPERATOR any_operator definition
-				{
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_OPERATOR;
-					n->oldstyle = false;
-					n->defnames = $3;
-					n->args = NIL;
-					n->definition = $4;
-					$$ = (Node *)n;
-				}
-			| CREATE TYPE_P any_name definition
-				{
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_TYPE;
-					n->oldstyle = false;
-					n->defnames = $3;
-					n->args = NIL;
-					n->definition = $4;
-					$$ = (Node *)n;
-				}
-			| CREATE TYPE_P any_name
-				{
-					/* Shell type (identified by lack of definition) */
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_TYPE;
-					n->oldstyle = false;
-					n->defnames = $3;
-					n->args = NIL;
-					n->definition = NIL;
-					$$ = (Node *)n;
-				}
-			| CREATE TYPE_P any_name AS '(' OptTableFuncElementList ')'
-				{
-					CompositeTypeStmt *n = makeNode(CompositeTypeStmt);
-
-					/* can't use qualified_name, sigh */
-					n->typevar = makeRangeVarFromAnyName($3, @3, yyscanner);
-					n->coldeflist = $6;
-					$$ = (Node *)n;
-				}
-			| CREATE TYPE_P any_name AS ENUM_P '(' opt_enum_val_list ')'
-				{
-					CreateEnumStmt *n = makeNode(CreateEnumStmt);
-					n->typeName = $3;
-					n->vals = $7;
-					$$ = (Node *)n;
-				}
-			| CREATE TEXT_P SEARCH PARSER any_name definition
-				{
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_TSPARSER;
-					n->args = NIL;
-					n->defnames = $5;
-					n->definition = $6;
-					$$ = (Node *)n;
-				}
-			| CREATE TEXT_P SEARCH DICTIONARY any_name definition
-				{
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_TSDICTIONARY;
-					n->args = NIL;
-					n->defnames = $5;
-					n->definition = $6;
-					$$ = (Node *)n;
-				}
-			| CREATE TEXT_P SEARCH TEMPLATE any_name definition
-				{
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_TSTEMPLATE;
-					n->args = NIL;
-					n->defnames = $5;
-					n->definition = $6;
-					$$ = (Node *)n;
-				}
-			| CREATE TEXT_P SEARCH CONFIGURATION any_name definition
-				{
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_TSCONFIGURATION;
-					n->args = NIL;
-					n->defnames = $5;
-					n->definition = $6;
-					$$ = (Node *)n;
-				}
-			| CREATE COLLATION any_name definition
-				{
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_COLLATION;
-					n->args = NIL;
-					n->defnames = $3;
-					n->definition = $4;
-					$$ = (Node *)n;
-				}
-			| CREATE COLLATION any_name FROM any_name
-				{
-					DefineStmt *n = makeNode(DefineStmt);
-					n->kind = OBJECT_COLLATION;
-					n->args = NIL;
-					n->defnames = $3;
-					n->definition = list_make1(makeDefElem("from", (Node *) $5));
-					$$ = (Node *)n;
-				}
-		;
-
-definition: '(' def_list ')'						{ $$ = $2; }
-		;
-
-def_list:  	def_elem								{ $$ = list_make1($1); }
-			| def_list ',' def_elem					{ $$ = lappend($1, $3); }
-		;
-
-def_elem:	ColLabel '=' def_arg
-				{
-					$$ = makeDefElem($1, (Node *) $3);
-				}
-			| ColLabel
-				{
-					$$ = makeDefElem($1, NULL);
-				}
-		;
-
-/* Note: any simple identifier will be returned as a type name! */
-def_arg:	func_type						{ $$ = (Node *)$1; }
-			| reserved_keyword				{ $$ = (Node *)makeString(pstrdup($1)); }
-			| qual_all_Op					{ $$ = (Node *)$1; }
-			| NumericOnly					{ $$ = (Node *)$1; }
-			| Sconst						{ $$ = (Node *)makeString($1); }
-		;
-
-aggr_args:	'(' type_list ')'						{ $$ = $2; }
-			| '(' '*' ')'							{ $$ = NIL; }
-		;
-
-old_aggr_definition: '(' old_aggr_list ')'			{ $$ = $2; }
-		;
-
-old_aggr_list: old_aggr_elem						{ $$ = list_make1($1); }
-			| old_aggr_list ',' old_aggr_elem		{ $$ = lappend($1, $3); }
-		;
-
-/*
- * Must use IDENT here to avoid reduce/reduce conflicts; fortunately none of
- * the item names needed in old aggregate definitions are likely to become
- * SQL keywords.
- */
-old_aggr_elem:  IDENT '=' def_arg
-				{
-					$$ = makeDefElem($1, (Node *)$3);
-				}
-		;
-
-opt_enum_val_list:
-		enum_val_list							{ $$ = $1; }
-		| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-enum_val_list:	Sconst
-				{ $$ = list_make1(makeString($1)); }
-			| enum_val_list ',' Sconst
-				{ $$ = lappend($1, makeString($3)); }
-		;
-
-/*****************************************************************************
- *
- *	ALTER TYPE enumtype ADD ...
- *
- *****************************************************************************/
-
-AlterEnumStmt:
-         ALTER TYPE_P any_name ADD_P VALUE_P Sconst
-			 {
-				 AlterEnumStmt *n = makeNode(AlterEnumStmt);
-				 n->typeName = $3;
-				 n->newVal = $6;
-				 n->newValNeighbor = NULL;
-				 n->newValIsAfter = true;
-				 $$ = (Node *) n;
-			 }
-		 | ALTER TYPE_P any_name ADD_P VALUE_P Sconst BEFORE Sconst
-			 {
-				 AlterEnumStmt *n = makeNode(AlterEnumStmt);
-				 n->typeName = $3;
-				 n->newVal = $6;
-				 n->newValNeighbor = $8;
-				 n->newValIsAfter = false;
-				 $$ = (Node *) n;
-			 }
-		 | ALTER TYPE_P any_name ADD_P VALUE_P Sconst AFTER Sconst
-			 {
-				 AlterEnumStmt *n = makeNode(AlterEnumStmt);
-				 n->typeName = $3;
-				 n->newVal = $6;
-				 n->newValNeighbor = $8;
-				 n->newValIsAfter = true;
-				 $$ = (Node *) n;
-			 }
-		 ;
-
-
-/*****************************************************************************
- *
- *		QUERIES :
- *				CREATE OPERATOR CLASS ...
- *				CREATE OPERATOR FAMILY ...
- *				ALTER OPERATOR FAMILY ...
- *				DROP OPERATOR CLASS ...
- *				DROP OPERATOR FAMILY ...
- *
- *****************************************************************************/
-
-CreateOpClassStmt:
-			CREATE OPERATOR CLASS any_name opt_default FOR TYPE_P Typename
-			USING access_method opt_opfamily AS opclass_item_list
-				{
-					CreateOpClassStmt *n = makeNode(CreateOpClassStmt);
-					n->opclassname = $4;
-					n->isDefault = $5;
-					n->datatype = $8;
-					n->amname = $10;
-					n->opfamilyname = $11;
-					n->items = $13;
-					$$ = (Node *) n;
-				}
-		;
-
-opclass_item_list:
-			opclass_item							{ $$ = list_make1($1); }
-			| opclass_item_list ',' opclass_item	{ $$ = lappend($1, $3); }
-		;
-
-opclass_item:
-			OPERATOR Iconst any_operator opclass_purpose opt_recheck
-				{
-					CreateOpClassItem *n = makeNode(CreateOpClassItem);
-					n->itemtype = OPCLASS_ITEM_OPERATOR;
-					n->name = $3;
-					n->args = NIL;
-					n->number = $2;
-					n->order_family = $4;
-					$$ = (Node *) n;
-				}
-			| OPERATOR Iconst any_operator oper_argtypes opclass_purpose
-			  opt_recheck
-				{
-					CreateOpClassItem *n = makeNode(CreateOpClassItem);
-					n->itemtype = OPCLASS_ITEM_OPERATOR;
-					n->name = $3;
-					n->args = $4;
-					n->number = $2;
-					n->order_family = $5;
-					$$ = (Node *) n;
-				}
-			| FUNCTION Iconst func_name func_args
-				{
-					CreateOpClassItem *n = makeNode(CreateOpClassItem);
-					n->itemtype = OPCLASS_ITEM_FUNCTION;
-					n->name = $3;
-					n->args = extractArgTypes($4);
-					n->number = $2;
-					$$ = (Node *) n;
-				}
-			| FUNCTION Iconst '(' type_list ')' func_name func_args
-				{
-					CreateOpClassItem *n = makeNode(CreateOpClassItem);
-					n->itemtype = OPCLASS_ITEM_FUNCTION;
-					n->name = $6;
-					n->args = extractArgTypes($7);
-					n->number = $2;
-					n->class_args = $4;
-					$$ = (Node *) n;
-				}
-			| STORAGE Typename
-				{
-					CreateOpClassItem *n = makeNode(CreateOpClassItem);
-					n->itemtype = OPCLASS_ITEM_STORAGETYPE;
-					n->storedtype = $2;
-					$$ = (Node *) n;
-				}
-		;
-
-opt_default:	DEFAULT						{ $$ = TRUE; }
-			| /*EMPTY*/						{ $$ = FALSE; }
-		;
-
-opt_opfamily:	FAMILY any_name				{ $$ = $2; }
-			| /*EMPTY*/						{ $$ = NIL; }
-		;
-
-opclass_purpose: FOR SEARCH					{ $$ = NIL; }
-			| FOR ORDER BY any_name			{ $$ = $4; }
-			| /*EMPTY*/						{ $$ = NIL; }
-		;
-
-opt_recheck:	RECHECK
-				{
-					/*
-					 * RECHECK no longer does anything in opclass definitions,
-					 * but we still accept it to ease porting of old database
-					 * dumps.
-					 */
-					ereport(NOTICE,
-							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-							 errmsg("RECHECK is no longer required"),
-							 errhint("Update your data type."),
-							 parser_errposition(@1)));
-					$$ = TRUE;
-				}
-			| /*EMPTY*/						{ $$ = FALSE; }
-		;
-
-
-CreateOpFamilyStmt:
-			CREATE OPERATOR FAMILY any_name USING access_method
-				{
-					CreateOpFamilyStmt *n = makeNode(CreateOpFamilyStmt);
-					n->opfamilyname = $4;
-					n->amname = $6;
-					$$ = (Node *) n;
-				}
-		;
-
-AlterOpFamilyStmt:
-			ALTER OPERATOR FAMILY any_name USING access_method ADD_P opclass_item_list
-				{
-					AlterOpFamilyStmt *n = makeNode(AlterOpFamilyStmt);
-					n->opfamilyname = $4;
-					n->amname = $6;
-					n->isDrop = false;
-					n->items = $8;
-					$$ = (Node *) n;
-				}
-			| ALTER OPERATOR FAMILY any_name USING access_method DROP opclass_drop_list
-				{
-					AlterOpFamilyStmt *n = makeNode(AlterOpFamilyStmt);
-					n->opfamilyname = $4;
-					n->amname = $6;
-					n->isDrop = true;
-					n->items = $8;
-					$$ = (Node *) n;
-				}
-		;
-
-opclass_drop_list:
-			opclass_drop							{ $$ = list_make1($1); }
-			| opclass_drop_list ',' opclass_drop	{ $$ = lappend($1, $3); }
-		;
-
-opclass_drop:
-			OPERATOR Iconst '(' type_list ')'
-				{
-					CreateOpClassItem *n = makeNode(CreateOpClassItem);
-					n->itemtype = OPCLASS_ITEM_OPERATOR;
-					n->number = $2;
-					n->args = $4;
-					$$ = (Node *) n;
-				}
-			| FUNCTION Iconst '(' type_list ')'
-				{
-					CreateOpClassItem *n = makeNode(CreateOpClassItem);
-					n->itemtype = OPCLASS_ITEM_FUNCTION;
-					n->number = $2;
-					n->args = $4;
-					$$ = (Node *) n;
-				}
-		;
-
-
-DropOpClassStmt:
-			DROP OPERATOR CLASS any_name USING access_method opt_drop_behavior
-				{
-					RemoveOpClassStmt *n = makeNode(RemoveOpClassStmt);
-					n->opclassname = $4;
-					n->amname = $6;
-					n->behavior = $7;
-					n->missing_ok = false;
-					$$ = (Node *) n;
-				}
-			| DROP OPERATOR CLASS IF_P EXISTS any_name USING access_method opt_drop_behavior
-				{
-					RemoveOpClassStmt *n = makeNode(RemoveOpClassStmt);
-					n->opclassname = $6;
-					n->amname = $8;
-					n->behavior = $9;
-					n->missing_ok = true;
-					$$ = (Node *) n;
-				}
-		;
-
-DropOpFamilyStmt:
-			DROP OPERATOR FAMILY any_name USING access_method opt_drop_behavior
-				{
-					RemoveOpFamilyStmt *n = makeNode(RemoveOpFamilyStmt);
-					n->opfamilyname = $4;
-					n->amname = $6;
-					n->behavior = $7;
-					n->missing_ok = false;
-					$$ = (Node *) n;
-				}
-			| DROP OPERATOR FAMILY IF_P EXISTS any_name USING access_method opt_drop_behavior
-				{
-					RemoveOpFamilyStmt *n = makeNode(RemoveOpFamilyStmt);
-					n->opfamilyname = $6;
-					n->amname = $8;
-					n->behavior = $9;
-					n->missing_ok = true;
-					$$ = (Node *) n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY:
- *
- *		DROP OWNED BY username [, username ...] [ RESTRICT | CASCADE ]
- *		REASSIGN OWNED BY username [, username ...] TO username
- *
- *****************************************************************************/
-DropOwnedStmt:
-			DROP OWNED BY name_list opt_drop_behavior
-			 	{
-					DropOwnedStmt *n = makeNode(DropOwnedStmt);
-					n->roles = $4;
-					n->behavior = $5;
-					$$ = (Node *)n;
-				}
-		;
-
-ReassignOwnedStmt:
-			REASSIGN OWNED BY name_list TO name
-				{
-					ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt);
-					n->roles = $4;
-					n->newrole = $6;
-					$$ = (Node *)n;
-				}
-		;
-
-/*****************************************************************************
- *
- *		QUERY:
- *
- *		DROP itemtype [ IF EXISTS ] itemname [, itemname ...]
- *           [ RESTRICT | CASCADE ]
- *
- *****************************************************************************/
-
-DropStmt:	DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior
-				{
-					DropStmt *n = makeNode(DropStmt);
-					n->removeType = $2;
-					n->missing_ok = TRUE;
-					n->objects = $5;
-					n->behavior = $6;
-					$$ = (Node *)n;
-				}
-			| DROP drop_type any_name_list opt_drop_behavior
-				{
-					DropStmt *n = makeNode(DropStmt);
-					n->removeType = $2;
-					n->missing_ok = FALSE;
-					n->objects = $3;
-					n->behavior = $4;
-					$$ = (Node *)n;
-				}
-		;
-
-
-drop_type:	TABLE									{ $$ = OBJECT_TABLE; }
-			| SEQUENCE								{ $$ = OBJECT_SEQUENCE; }
-			| VIEW									{ $$ = OBJECT_VIEW; }
-			| INDEX									{ $$ = OBJECT_INDEX; }
-			| FOREIGN TABLE							{ $$ = OBJECT_FOREIGN_TABLE; }
-			| TYPE_P								{ $$ = OBJECT_TYPE; }
-			| DOMAIN_P								{ $$ = OBJECT_DOMAIN; }
-			| COLLATION								{ $$ = OBJECT_COLLATION; }
-			| CONVERSION_P							{ $$ = OBJECT_CONVERSION; }
-			| SCHEMA								{ $$ = OBJECT_SCHEMA; }
-			| EXTENSION								{ $$ = OBJECT_EXTENSION; }
-			| TEXT_P SEARCH PARSER					{ $$ = OBJECT_TSPARSER; }
-			| TEXT_P SEARCH DICTIONARY				{ $$ = OBJECT_TSDICTIONARY; }
-			| TEXT_P SEARCH TEMPLATE				{ $$ = OBJECT_TSTEMPLATE; }
-			| TEXT_P SEARCH CONFIGURATION			{ $$ = OBJECT_TSCONFIGURATION; }
-		;
-
-any_name_list:
-			any_name								{ $$ = list_make1($1); }
-			| any_name_list ',' any_name			{ $$ = lappend($1, $3); }
-		;
-
 any_name:	ColId						{ $$ = list_make1(makeString($1)); }
 			| ColId attrs				{ $$ = lcons(makeString($1), $2); }
 		;
@@ -4772,1006 +525,6 @@ attrs:		'.' attr_name
 					{ $$ = lappend($1, makeString($3)); }
 		;
 
-
-/*****************************************************************************
- *
- *		QUERY:
- *				truncate table relname1, relname2, ...
- *
- *****************************************************************************/
-
-TruncateStmt:
-			TRUNCATE opt_table relation_expr_list opt_restart_seqs opt_drop_behavior
-				{
-					TruncateStmt *n = makeNode(TruncateStmt);
-					n->relations = $3;
-					n->restart_seqs = $4;
-					n->behavior = $5;
-					$$ = (Node *)n;
-				}
-		;
-
-opt_restart_seqs:
-			CONTINUE_P IDENTITY_P		{ $$ = false; }
-			| RESTART IDENTITY_P		{ $$ = true; }
-			| /* EMPTY */				{ $$ = false; }
-		;
-
-/*****************************************************************************
- *
- *	The COMMENT ON statement can take different forms based upon the type of
- *	the object associated with the comment. The form of the statement is:
- *
- *	COMMENT ON [ [ DATABASE | DOMAIN | INDEX | SEQUENCE | TABLE | TYPE | VIEW |
- *				   COLLATION | CONVERSION | LANGUAGE | OPERATOR CLASS |
- *				   LARGE OBJECT | CAST | COLUMN | SCHEMA | TABLESPACE |
- *				   EXTENSION | ROLE | TEXT SEARCH PARSER |
- *				   TEXT SEARCH DICTIONARY | TEXT SEARCH TEMPLATE |
- *				   TEXT SEARCH CONFIGURATION | FOREIGN TABLE |
- *				   FOREIGN DATA WRAPPER | SERVER ] <objname> |
- *				 AGGREGATE <aggname> (arg1, ...) |
- *				 FUNCTION <funcname> (arg1, arg2, ...) |
- *				 OPERATOR <op> (leftoperand_typ, rightoperand_typ) |
- *				 TRIGGER <triggername> ON <relname> |
- *				 CONSTRAINT <constraintname> ON <relname> |
- *				 RULE <rulename> ON <relname> ]
- *			   IS 'text'
- *
- *****************************************************************************/
-
-CommentStmt:
-			COMMENT ON comment_type any_name IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = $3;
-					n->objname = $4;
-					n->objargs = NIL;
-					n->comment = $6;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON AGGREGATE func_name aggr_args IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $4;
-					n->objargs = $5;
-					n->comment = $7;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON FUNCTION func_name func_args IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_FUNCTION;
-					n->objname = $4;
-					n->objargs = extractArgTypes($5);
-					n->comment = $7;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON OPERATOR any_operator oper_argtypes IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_OPERATOR;
-					n->objname = $4;
-					n->objargs = $5;
-					n->comment = $7;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON CONSTRAINT name ON any_name IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_CONSTRAINT;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
-					n->comment = $8;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON RULE name ON any_name IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_RULE;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
-					n->comment = $8;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON RULE name IS comment_text
-				{
-					/* Obsolete syntax supported for awhile for compatibility */
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_RULE;
-					n->objname = list_make1(makeString($4));
-					n->objargs = NIL;
-					n->comment = $6;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON TRIGGER name ON any_name IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_TRIGGER;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
-					n->comment = $8;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON OPERATOR CLASS any_name USING access_method IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_OPCLASS;
-					n->objname = $5;
-					n->objargs = list_make1(makeString($7));
-					n->comment = $9;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON OPERATOR FAMILY any_name USING access_method IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_OPFAMILY;
-					n->objname = $5;
-					n->objargs = list_make1(makeString($7));
-					n->comment = $9;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON LARGE_P OBJECT_P NumericOnly IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_LARGEOBJECT;
-					n->objname = list_make1($5);
-					n->objargs = NIL;
-					n->comment = $7;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON CAST '(' Typename AS Typename ')' IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_CAST;
-					n->objname = list_make1($5);
-					n->objargs = list_make1($7);
-					n->comment = $10;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON opt_procedural LANGUAGE any_name IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_LANGUAGE;
-					n->objname = $5;
-					n->objargs = NIL;
-					n->comment = $7;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON TEXT_P SEARCH PARSER any_name IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_TSPARSER;
-					n->objname = $6;
-					n->comment = $8;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON TEXT_P SEARCH DICTIONARY any_name IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_TSDICTIONARY;
-					n->objname = $6;
-					n->comment = $8;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON TEXT_P SEARCH TEMPLATE any_name IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_TSTEMPLATE;
-					n->objname = $6;
-					n->comment = $8;
-					$$ = (Node *) n;
-				}
-			| COMMENT ON TEXT_P SEARCH CONFIGURATION any_name IS comment_text
-				{
-					CommentStmt *n = makeNode(CommentStmt);
-					n->objtype = OBJECT_TSCONFIGURATION;
-					n->objname = $6;
-					n->comment = $8;
-					$$ = (Node *) n;
-				}
-		;
-
-comment_type:
-			COLUMN								{ $$ = OBJECT_COLUMN; }
-			| DATABASE							{ $$ = OBJECT_DATABASE; }
-			| SCHEMA							{ $$ = OBJECT_SCHEMA; }
-			| INDEX								{ $$ = OBJECT_INDEX; }
-			| SEQUENCE							{ $$ = OBJECT_SEQUENCE; }
-			| TABLE								{ $$ = OBJECT_TABLE; }
-			| DOMAIN_P							{ $$ = OBJECT_DOMAIN; }
-			| TYPE_P							{ $$ = OBJECT_TYPE; }
-			| VIEW								{ $$ = OBJECT_VIEW; }
-			| COLLATION							{ $$ = OBJECT_COLLATION; }
-			| CONVERSION_P						{ $$ = OBJECT_CONVERSION; }
-			| TABLESPACE						{ $$ = OBJECT_TABLESPACE; }
-			| EXTENSION 						{ $$ = OBJECT_EXTENSION; }
-			| ROLE								{ $$ = OBJECT_ROLE; }
-			| FOREIGN TABLE						{ $$ = OBJECT_FOREIGN_TABLE; }
-			| SERVER							{ $$ = OBJECT_FOREIGN_SERVER; }
-			| FOREIGN DATA_P WRAPPER			{ $$ = OBJECT_FDW; }
-		;
-
-comment_text:
-			Sconst								{ $$ = $1; }
-			| NULL_P							{ $$ = NULL; }
-		;
-
-
-/*****************************************************************************
- *
- *  SECURITY LABEL [FOR <provider>] ON <object> IS <label>
- *
- *  As with COMMENT ON, <object> can refer to various types of database
- *  objects (e.g. TABLE, COLUMN, etc.).
- *
- *****************************************************************************/
-
-SecLabelStmt:
-			SECURITY LABEL opt_provider ON security_label_type any_name
-			IS security_label
-				{
-					SecLabelStmt *n = makeNode(SecLabelStmt);
-					n->provider = $3;
-					n->objtype = $5;
-					n->objname = $6;
-					n->objargs = NIL;
-					n->label = $8;
-					$$ = (Node *) n;
-				}
-			| SECURITY LABEL opt_provider ON AGGREGATE func_name aggr_args
-			  IS security_label
-				{
-					SecLabelStmt *n = makeNode(SecLabelStmt);
-					n->provider = $3;
-					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $6;
-					n->objargs = $7;
-					n->label = $9;
-					$$ = (Node *) n;
-				}
-			| SECURITY LABEL opt_provider ON FUNCTION func_name func_args
-			  IS security_label
-				{
-					SecLabelStmt *n = makeNode(SecLabelStmt);
-					n->provider = $3;
-					n->objtype = OBJECT_FUNCTION;
-					n->objname = $6;
-					n->objargs = extractArgTypes($7);
-					n->label = $9;
-					$$ = (Node *) n;
-				}
-			| SECURITY LABEL opt_provider ON LARGE_P OBJECT_P NumericOnly
-			  IS security_label
-				{
-					SecLabelStmt *n = makeNode(SecLabelStmt);
-					n->provider = $3;
-					n->objtype = OBJECT_LARGEOBJECT;
-					n->objname = list_make1($7);
-					n->objargs = NIL;
-					n->label = $9;
-					$$ = (Node *) n;
-				}
-			| SECURITY LABEL opt_provider ON opt_procedural LANGUAGE any_name
-			  IS security_label
-				{
-					SecLabelStmt *n = makeNode(SecLabelStmt);
-					n->provider = $3;
-					n->objtype = OBJECT_LANGUAGE;
-					n->objname = $7;
-					n->objargs = NIL;
-					n->label = $9;
-					$$ = (Node *) n;
-				}
-		;
-
-opt_provider:	FOR ColId_or_Sconst	{ $$ = $2; }
-				| /* empty */		{ $$ = NULL; }
-		;
-
-security_label_type:
-			COLUMN								{ $$ = OBJECT_COLUMN; }
-			| FOREIGN TABLE						{ $$ = OBJECT_FOREIGN_TABLE; }
-			| SCHEMA							{ $$ = OBJECT_SCHEMA; }
-			| SEQUENCE							{ $$ = OBJECT_SEQUENCE; }
-			| TABLE								{ $$ = OBJECT_TABLE; }
-			| DOMAIN_P							{ $$ = OBJECT_TYPE; }
-			| TYPE_P							{ $$ = OBJECT_TYPE; }
-			| VIEW								{ $$ = OBJECT_VIEW; }
-		;
-
-security_label:	Sconst				{ $$ = $1; }
-				| NULL_P			{ $$ = NULL; }
-		;
-
-/*****************************************************************************
- *
- *		QUERY:
- *			fetch/move
- *
- *****************************************************************************/
-
-FetchStmt:	FETCH fetch_args
-				{
-					FetchStmt *n = (FetchStmt *) $2;
-					n->ismove = FALSE;
-					$$ = (Node *)n;
-				}
-			| MOVE fetch_args
-				{
-					FetchStmt *n = (FetchStmt *) $2;
-					n->ismove = TRUE;
-					$$ = (Node *)n;
-				}
-		;
-
-fetch_args:	cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $1;
-					n->direction = FETCH_FORWARD;
-					n->howMany = 1;
-					$$ = (Node *)n;
-				}
-			| from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $2;
-					n->direction = FETCH_FORWARD;
-					n->howMany = 1;
-					$$ = (Node *)n;
-				}
-			| NEXT opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $3;
-					n->direction = FETCH_FORWARD;
-					n->howMany = 1;
-					$$ = (Node *)n;
-				}
-			| PRIOR opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $3;
-					n->direction = FETCH_BACKWARD;
-					n->howMany = 1;
-					$$ = (Node *)n;
-				}
-			| FIRST_P opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $3;
-					n->direction = FETCH_ABSOLUTE;
-					n->howMany = 1;
-					$$ = (Node *)n;
-				}
-			| LAST_P opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $3;
-					n->direction = FETCH_ABSOLUTE;
-					n->howMany = -1;
-					$$ = (Node *)n;
-				}
-			| ABSOLUTE_P SignedIconst opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $4;
-					n->direction = FETCH_ABSOLUTE;
-					n->howMany = $2;
-					$$ = (Node *)n;
-				}
-			| RELATIVE_P SignedIconst opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $4;
-					n->direction = FETCH_RELATIVE;
-					n->howMany = $2;
-					$$ = (Node *)n;
-				}
-			| SignedIconst opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $3;
-					n->direction = FETCH_FORWARD;
-					n->howMany = $1;
-					$$ = (Node *)n;
-				}
-			| ALL opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $3;
-					n->direction = FETCH_FORWARD;
-					n->howMany = FETCH_ALL;
-					$$ = (Node *)n;
-				}
-			| FORWARD opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $3;
-					n->direction = FETCH_FORWARD;
-					n->howMany = 1;
-					$$ = (Node *)n;
-				}
-			| FORWARD SignedIconst opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $4;
-					n->direction = FETCH_FORWARD;
-					n->howMany = $2;
-					$$ = (Node *)n;
-				}
-			| FORWARD ALL opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $4;
-					n->direction = FETCH_FORWARD;
-					n->howMany = FETCH_ALL;
-					$$ = (Node *)n;
-				}
-			| BACKWARD opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $3;
-					n->direction = FETCH_BACKWARD;
-					n->howMany = 1;
-					$$ = (Node *)n;
-				}
-			| BACKWARD SignedIconst opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $4;
-					n->direction = FETCH_BACKWARD;
-					n->howMany = $2;
-					$$ = (Node *)n;
-				}
-			| BACKWARD ALL opt_from_in cursor_name
-				{
-					FetchStmt *n = makeNode(FetchStmt);
-					n->portalname = $4;
-					n->direction = FETCH_BACKWARD;
-					n->howMany = FETCH_ALL;
-					$$ = (Node *)n;
-				}
-		;
-
-from_in:	FROM									{}
-			| IN_P									{}
-		;
-
-opt_from_in:	from_in								{}
-			| /* EMPTY */							{}
-		;
-
-
-/*****************************************************************************
- *
- * GRANT and REVOKE statements
- *
- *****************************************************************************/
-
-GrantStmt:	GRANT privileges ON privilege_target TO grantee_list
-			opt_grant_grant_option
-				{
-					GrantStmt *n = makeNode(GrantStmt);
-					n->is_grant = true;
-					n->privileges = $2;
-					n->targtype = ($4)->targtype;
-					n->objtype = ($4)->objtype;
-					n->objects = ($4)->objs;
-					n->grantees = $6;
-					n->grant_option = $7;
-					$$ = (Node*)n;
-				}
-		;
-
-RevokeStmt:
-			REVOKE privileges ON privilege_target
-			FROM grantee_list opt_drop_behavior
-				{
-					GrantStmt *n = makeNode(GrantStmt);
-					n->is_grant = false;
-					n->grant_option = false;
-					n->privileges = $2;
-					n->targtype = ($4)->targtype;
-					n->objtype = ($4)->objtype;
-					n->objects = ($4)->objs;
-					n->grantees = $6;
-					n->behavior = $7;
-					$$ = (Node *)n;
-				}
-			| REVOKE GRANT OPTION FOR privileges ON privilege_target
-			FROM grantee_list opt_drop_behavior
-				{
-					GrantStmt *n = makeNode(GrantStmt);
-					n->is_grant = false;
-					n->grant_option = true;
-					n->privileges = $5;
-					n->targtype = ($7)->targtype;
-					n->objtype = ($7)->objtype;
-					n->objects = ($7)->objs;
-					n->grantees = $9;
-					n->behavior = $10;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*
- * Privilege names are represented as strings; the validity of the privilege
- * names gets checked at execution.  This is a bit annoying but we have little
- * choice because of the syntactic conflict with lists of role names in
- * GRANT/REVOKE.  What's more, we have to call out in the "privilege"
- * production any reserved keywords that need to be usable as privilege names.
- */
-
-/* either ALL [PRIVILEGES] or a list of individual privileges */
-privileges: privilege_list
-				{ $$ = $1; }
-			| ALL
-				{ $$ = NIL; }
-			| ALL PRIVILEGES
-				{ $$ = NIL; }
-			| ALL '(' columnList ')'
-				{
-					AccessPriv *n = makeNode(AccessPriv);
-					n->priv_name = NULL;
-					n->cols = $3;
-					$$ = list_make1(n);
-				}
-			| ALL PRIVILEGES '(' columnList ')'
-				{
-					AccessPriv *n = makeNode(AccessPriv);
-					n->priv_name = NULL;
-					n->cols = $4;
-					$$ = list_make1(n);
-				}
-		;
-
-privilege_list:	privilege							{ $$ = list_make1($1); }
-			| privilege_list ',' privilege			{ $$ = lappend($1, $3); }
-		;
-
-privilege:	SELECT opt_column_list
-			{
-				AccessPriv *n = makeNode(AccessPriv);
-				n->priv_name = pstrdup($1);
-				n->cols = $2;
-				$$ = n;
-			}
-		| REFERENCES opt_column_list
-			{
-				AccessPriv *n = makeNode(AccessPriv);
-				n->priv_name = pstrdup($1);
-				n->cols = $2;
-				$$ = n;
-			}
-		| CREATE opt_column_list
-			{
-				AccessPriv *n = makeNode(AccessPriv);
-				n->priv_name = pstrdup($1);
-				n->cols = $2;
-				$$ = n;
-			}
-		| ColId opt_column_list
-			{
-				AccessPriv *n = makeNode(AccessPriv);
-				n->priv_name = $1;
-				n->cols = $2;
-				$$ = n;
-			}
-		;
-
-
-/* Don't bother trying to fold the first two rules into one using
- * opt_table.  You're going to get conflicts.
- */
-privilege_target:
-			qualified_name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_RELATION;
-					n->objs = $1;
-					$$ = n;
-				}
-			| TABLE qualified_name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_RELATION;
-					n->objs = $2;
-					$$ = n;
-				}
-			| SEQUENCE qualified_name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_SEQUENCE;
-					n->objs = $2;
-					$$ = n;
-				}
-			| FOREIGN DATA_P WRAPPER name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_FDW;
-					n->objs = $4;
-					$$ = n;
-				}
-			| FOREIGN SERVER name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_FOREIGN_SERVER;
-					n->objs = $3;
-					$$ = n;
-				}
-			| FUNCTION function_with_argtypes_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_FUNCTION;
-					n->objs = $2;
-					$$ = n;
-				}
-			| DATABASE name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_DATABASE;
-					n->objs = $2;
-					$$ = n;
-				}
-			| LANGUAGE name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_LANGUAGE;
-					n->objs = $2;
-					$$ = n;
-				}
-			| LARGE_P OBJECT_P NumericOnly_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_LARGEOBJECT;
-					n->objs = $3;
-					$$ = n;
-				}
-			| SCHEMA name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_NAMESPACE;
-					n->objs = $2;
-					$$ = n;
-				}
-			| TABLESPACE name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_OBJECT;
-					n->objtype = ACL_OBJECT_TABLESPACE;
-					n->objs = $2;
-					$$ = n;
-				}
-			| ALL TABLES IN_P SCHEMA name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_ALL_IN_SCHEMA;
-					n->objtype = ACL_OBJECT_RELATION;
-					n->objs = $5;
-					$$ = n;
-				}
-			| ALL SEQUENCES IN_P SCHEMA name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_ALL_IN_SCHEMA;
-					n->objtype = ACL_OBJECT_SEQUENCE;
-					n->objs = $5;
-					$$ = n;
-				}
-			| ALL FUNCTIONS IN_P SCHEMA name_list
-				{
-					PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget));
-					n->targtype = ACL_TARGET_ALL_IN_SCHEMA;
-					n->objtype = ACL_OBJECT_FUNCTION;
-					n->objs = $5;
-					$$ = n;
-				}
-		;
-
-
-grantee_list:
-			grantee									{ $$ = list_make1($1); }
-			| grantee_list ',' grantee				{ $$ = lappend($1, $3); }
-		;
-
-grantee:	RoleId
-				{
-					PrivGrantee *n = makeNode(PrivGrantee);
-					/* This hack lets us avoid reserving PUBLIC as a keyword*/
-					if (strcmp($1, "public") == 0)
-						n->rolname = NULL;
-					else
-						n->rolname = $1;
-					$$ = (Node *)n;
-				}
-			| GROUP_P RoleId
-				{
-					PrivGrantee *n = makeNode(PrivGrantee);
-					/* Treat GROUP PUBLIC as a synonym for PUBLIC */
-					if (strcmp($2, "public") == 0)
-						n->rolname = NULL;
-					else
-						n->rolname = $2;
-					$$ = (Node *)n;
-				}
-		;
-
-
-opt_grant_grant_option:
-			WITH GRANT OPTION { $$ = TRUE; }
-			| /*EMPTY*/ { $$ = FALSE; }
-		;
-
-function_with_argtypes_list:
-			function_with_argtypes					{ $$ = list_make1($1); }
-			| function_with_argtypes_list ',' function_with_argtypes
-													{ $$ = lappend($1, $3); }
-		;
-
-function_with_argtypes:
-			func_name func_args
-				{
-					FuncWithArgs *n = makeNode(FuncWithArgs);
-					n->funcname = $1;
-					n->funcargs = extractArgTypes($2);
-					$$ = n;
-				}
-		;
-
-/*****************************************************************************
- *
- * GRANT and REVOKE ROLE statements
- *
- *****************************************************************************/
-
-GrantRoleStmt:
-			GRANT privilege_list TO name_list opt_grant_admin_option opt_granted_by
-				{
-					GrantRoleStmt *n = makeNode(GrantRoleStmt);
-					n->is_grant = true;
-					n->granted_roles = $2;
-					n->grantee_roles = $4;
-					n->admin_opt = $5;
-					n->grantor = $6;
-					$$ = (Node*)n;
-				}
-		;
-
-RevokeRoleStmt:
-			REVOKE privilege_list FROM name_list opt_granted_by opt_drop_behavior
-				{
-					GrantRoleStmt *n = makeNode(GrantRoleStmt);
-					n->is_grant = false;
-					n->admin_opt = false;
-					n->granted_roles = $2;
-					n->grantee_roles = $4;
-					n->behavior = $6;
-					$$ = (Node*)n;
-				}
-			| REVOKE ADMIN OPTION FOR privilege_list FROM name_list opt_granted_by opt_drop_behavior
-				{
-					GrantRoleStmt *n = makeNode(GrantRoleStmt);
-					n->is_grant = false;
-					n->admin_opt = true;
-					n->granted_roles = $5;
-					n->grantee_roles = $7;
-					n->behavior = $9;
-					$$ = (Node*)n;
-				}
-		;
-
-opt_grant_admin_option: WITH ADMIN OPTION				{ $$ = TRUE; }
-			| /*EMPTY*/									{ $$ = FALSE; }
-		;
-
-opt_granted_by: GRANTED BY RoleId						{ $$ = $3; }
-			| /*EMPTY*/									{ $$ = NULL; }
-		;
-
-/*****************************************************************************
- *
- * ALTER DEFAULT PRIVILEGES statement
- *
- *****************************************************************************/
-
-AlterDefaultPrivilegesStmt:
-			ALTER DEFAULT PRIVILEGES DefACLOptionList DefACLAction
-				{
-					AlterDefaultPrivilegesStmt *n = makeNode(AlterDefaultPrivilegesStmt);
-					n->options = $4;
-					n->action = (GrantStmt *) $5;
-					$$ = (Node*)n;
-				}
-		;
-
-DefACLOptionList:
-			DefACLOptionList DefACLOption			{ $$ = lappend($1, $2); }
-			| /* EMPTY */							{ $$ = NIL; }
-		;
-
-DefACLOption:
-			IN_P SCHEMA name_list
-				{
-					$$ = makeDefElem("schemas", (Node *)$3);
-				}
-			| FOR ROLE name_list
-				{
-					$$ = makeDefElem("roles", (Node *)$3);
-				}
-			| FOR USER name_list
-				{
-					$$ = makeDefElem("roles", (Node *)$3);
-				}
-		;
-
-/*
- * This should match GRANT/REVOKE, except that individual target objects
- * are not mentioned and we only allow a subset of object types.
- */
-DefACLAction:
-			GRANT privileges ON defacl_privilege_target TO grantee_list
-			opt_grant_grant_option
-				{
-					GrantStmt *n = makeNode(GrantStmt);
-					n->is_grant = true;
-					n->privileges = $2;
-					n->targtype = ACL_TARGET_DEFAULTS;
-					n->objtype = $4;
-					n->objects = NIL;
-					n->grantees = $6;
-					n->grant_option = $7;
-					$$ = (Node*)n;
-				}
-			| REVOKE privileges ON defacl_privilege_target
-			FROM grantee_list opt_drop_behavior
-				{
-					GrantStmt *n = makeNode(GrantStmt);
-					n->is_grant = false;
-					n->grant_option = false;
-					n->privileges = $2;
-					n->targtype = ACL_TARGET_DEFAULTS;
-					n->objtype = $4;
-					n->objects = NIL;
-					n->grantees = $6;
-					n->behavior = $7;
-					$$ = (Node *)n;
-				}
-			| REVOKE GRANT OPTION FOR privileges ON defacl_privilege_target
-			FROM grantee_list opt_drop_behavior
-				{
-					GrantStmt *n = makeNode(GrantStmt);
-					n->is_grant = false;
-					n->grant_option = true;
-					n->privileges = $5;
-					n->targtype = ACL_TARGET_DEFAULTS;
-					n->objtype = $7;
-					n->objects = NIL;
-					n->grantees = $9;
-					n->behavior = $10;
-					$$ = (Node *)n;
-				}
-		;
-
-defacl_privilege_target:
-			TABLES			{ $$ = ACL_OBJECT_RELATION; }
-			| FUNCTIONS		{ $$ = ACL_OBJECT_FUNCTION; }
-			| SEQUENCES		{ $$ = ACL_OBJECT_SEQUENCE; }
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY: CREATE INDEX
- *
- * Note: we cannot put TABLESPACE clause after WHERE clause unless we are
- * willing to make TABLESPACE a fully reserved word.
- *****************************************************************************/
-
-IndexStmt:	CREATE opt_unique INDEX opt_concurrently opt_index_name
-			ON qualified_name access_method_clause '(' index_params ')'
-			opt_reloptions OptTableSpace where_clause
-				{
-					IndexStmt *n = makeNode(IndexStmt);
-					n->unique = $2;
-					n->concurrent = $4;
-					n->idxname = $5;
-					n->relation = $7;
-					n->accessMethod = $8;
-					n->indexParams = $10;
-					n->options = $12;
-					n->tableSpace = $13;
-					n->whereClause = $14;
-					n->indexOid = InvalidOid;
-					$$ = (Node *)n;
-				}
-		;
-
-opt_unique:
-			UNIQUE									{ $$ = TRUE; }
-			| /*EMPTY*/								{ $$ = FALSE; }
-		;
-
-opt_concurrently:
-			CONCURRENTLY							{ $$ = TRUE; }
-			| /*EMPTY*/								{ $$ = FALSE; }
-		;
-
-opt_index_name:
-			index_name								{ $$ = $1; }
-			| /*EMPTY*/								{ $$ = NULL; }
-		;
-
-access_method_clause:
-			USING access_method						{ $$ = $2; }
-			| /*EMPTY*/								{ $$ = DEFAULT_INDEX_TYPE; }
-		;
-
-index_params:	index_elem							{ $$ = list_make1($1); }
-			| index_params ',' index_elem			{ $$ = lappend($1, $3); }
-		;
-
-/*
- * Index attributes can be either simple column references, or arbitrary
- * expressions in parens.  For backwards-compatibility reasons, we allow
- * an expression that's just a function call to be written without parens.
- */
-index_elem:	ColId opt_collate opt_class opt_asc_desc opt_nulls_order
-				{
-					$$ = makeNode(IndexElem);
-					$$->name = $1;
-					$$->expr = NULL;
-					$$->indexcolname = NULL;
-					$$->collation = $2;
-					$$->opclass = $3;
-					$$->ordering = $4;
-					$$->nulls_ordering = $5;
-				}
-			| func_expr opt_collate opt_class opt_asc_desc opt_nulls_order
-				{
-					$$ = makeNode(IndexElem);
-					$$->name = NULL;
-					$$->expr = $1;
-					$$->indexcolname = NULL;
-					$$->collation = $2;
-					$$->opclass = $3;
-					$$->ordering = $4;
-					$$->nulls_ordering = $5;
-				}
-			| '(' a_expr ')' opt_collate opt_class opt_asc_desc opt_nulls_order
-				{
-					$$ = makeNode(IndexElem);
-					$$->name = NULL;
-					$$->expr = $2;
-					$$->indexcolname = NULL;
-					$$->collation = $4;
-					$$->opclass = $5;
-					$$->ordering = $6;
-					$$->nulls_ordering = $7;
-				}
-		;
-
-opt_collate: COLLATE any_name						{ $$ = $2; }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-opt_class:	any_name								{ $$ = $1; }
-			| USING any_name						{ $$ = $2; }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
 opt_asc_desc: ASC							{ $$ = SORTBY_ASC; }
 			| DESC							{ $$ = SORTBY_DESC; }
 			| /*EMPTY*/						{ $$ = SORTBY_DEFAULT; }
@@ -5782,454 +535,12 @@ opt_nulls_order: NULLS_FIRST				{ $$ = SORTBY_NULLS_FIRST; }
 			| /*EMPTY*/						{ $$ = SORTBY_NULLS_DEFAULT; }
 		;
 
-
-/*****************************************************************************
- *
- *		QUERY:
- *				create [or replace] function <fname>
- *						[(<type-1> { , <type-n>})]
- *						returns <type-r>
- *						as <filename or code in language as appropriate>
- *						language <lang> [with parameters]
- *
- *****************************************************************************/
-
-CreateFunctionStmt:
-			CREATE opt_or_replace FUNCTION func_name func_args_with_defaults
-			RETURNS func_return createfunc_opt_list opt_definition
-				{
-					CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
-					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
-				{
-					CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
-					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
-				{
-					CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
-					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; }
-		;
-
-func_args:	'(' func_args_list ')'					{ $$ = $2; }
-			| '(' ')'								{ $$ = NIL; }
-		;
-
-func_args_list:
-			func_arg								{ $$ = list_make1($1); }
-			| func_args_list ',' func_arg			{ $$ = lappend($1, $3); }
-		;
-
-/*
- * func_args_with_defaults is separate because we only want to accept
- * defaults in CREATE FUNCTION, not in ALTER etc.
- */
-func_args_with_defaults:
-		'(' func_args_with_defaults_list ')'		{ $$ = $2; }
-		| '(' ')'									{ $$ = NIL; }
-		;
-
-func_args_with_defaults_list:
-		func_arg_with_default						{ $$ = list_make1($1); }
-		| func_args_with_defaults_list ',' func_arg_with_default
-													{ $$ = lappend($1, $3); }
-		;
-
-/*
- * The style with arg_class first is SQL99 standard, but Oracle puts
- * param_name first; accept both since it's likely people will try both
- * anyway.  Don't bother trying to save productions by letting arg_class
- * have an empty alternative ... you'll get shift/reduce conflicts.
- *
- * We can catch over-specified arguments here if we want to,
- * but for now better to silently swallow typmod, etc.
- * - thomas 2000-03-22
- */
-func_arg:
-			arg_class param_name func_type
-				{
-					FunctionParameter *n = makeNode(FunctionParameter);
-					n->name = $2;
-					n->argType = $3;
-					n->mode = $1;
-					n->defexpr = NULL;
-					$$ = n;
-				}
-			| param_name arg_class func_type
-				{
-					FunctionParameter *n = makeNode(FunctionParameter);
-					n->name = $1;
-					n->argType = $3;
-					n->mode = $2;
-					n->defexpr = NULL;
-					$$ = n;
-				}
-			| param_name func_type
-				{
-					FunctionParameter *n = makeNode(FunctionParameter);
-					n->name = $1;
-					n->argType = $2;
-					n->mode = FUNC_PARAM_IN;
-					n->defexpr = NULL;
-					$$ = n;
-				}
-			| arg_class func_type
-				{
-					FunctionParameter *n = makeNode(FunctionParameter);
-					n->name = NULL;
-					n->argType = $2;
-					n->mode = $1;
-					n->defexpr = NULL;
-					$$ = n;
-				}
-			| func_type
-				{
-					FunctionParameter *n = makeNode(FunctionParameter);
-					n->name = NULL;
-					n->argType = $1;
-					n->mode = FUNC_PARAM_IN;
-					n->defexpr = NULL;
-					$$ = n;
-				}
-		;
-
-/* INOUT is SQL99 standard, IN OUT is for Oracle compatibility */
-arg_class:	IN_P								{ $$ = FUNC_PARAM_IN; }
-			| OUT_P								{ $$ = FUNC_PARAM_OUT; }
-			| INOUT								{ $$ = FUNC_PARAM_INOUT; }
-			| IN_P OUT_P						{ $$ = FUNC_PARAM_INOUT; }
-			| VARIADIC							{ $$ = FUNC_PARAM_VARIADIC; }
-		;
-
 /*
  * Ideally param_name should be ColId, but that causes too many conflicts.
  */
 param_name:	type_function_name
 		;
 
-func_return:
-			func_type
-				{
-					/* We can catch over-specified results here if we want to,
-					 * but for now better to silently swallow typmod, etc.
-					 * - thomas 2000-03-22
-					 */
-					$$ = $1;
-				}
-		;
-
-/*
- * We would like to make the %TYPE productions here be ColId attrs etc,
- * but that causes reduce/reduce conflicts.  type_function_name
- * is next best choice.
- */
-func_type:	Typename								{ $$ = $1; }
-			| type_function_name attrs '%' TYPE_P
-				{
-					$$ = makeTypeNameFromNameList(lcons(makeString($1), $2));
-					$$->pct_type = true;
-					$$->location = @1;
-				}
-			| SETOF type_function_name attrs '%' TYPE_P
-				{
-					$$ = makeTypeNameFromNameList(lcons(makeString($2), $3));
-					$$->pct_type = true;
-					$$->setof = TRUE;
-					$$->location = @2;
-				}
-		;
-
-func_arg_with_default:
-		func_arg
-			    {
-				    $$ = $1;
-			    }
-		| func_arg DEFAULT a_expr
-			    {
-				    $$ = $1;
-				    $$->defexpr = $3;
-			    }
-		| func_arg '=' a_expr
-			    {
-				    $$ = $1;
-				    $$->defexpr = $3;
-			    }
-		;
-
-
-createfunc_opt_list:
-			/* Must be at least one to prevent conflict */
-			createfunc_opt_item                     { $$ = list_make1($1); }
-			| createfunc_opt_list createfunc_opt_item { $$ = lappend($1, $2); }
-	;
-
-/*
- * Options common to both CREATE FUNCTION and ALTER FUNCTION
- */
-common_func_opt_item:
-			CALLED ON NULL_P INPUT_P
-				{
-					$$ = makeDefElem("strict", (Node *)makeInteger(FALSE));
-				}
-			| RETURNS NULL_P ON NULL_P INPUT_P
-				{
-					$$ = makeDefElem("strict", (Node *)makeInteger(TRUE));
-				}
-			| STRICT_P
-				{
-					$$ = makeDefElem("strict", (Node *)makeInteger(TRUE));
-				}
-			| IMMUTABLE
-				{
-					$$ = makeDefElem("volatility", (Node *)makeString("immutable"));
-				}
-			| STABLE
-				{
-					$$ = makeDefElem("volatility", (Node *)makeString("stable"));
-				}
-			| VOLATILE
-				{
-					$$ = makeDefElem("volatility", (Node *)makeString("volatile"));
-				}
-			| EXTERNAL SECURITY DEFINER
-				{
-					$$ = makeDefElem("security", (Node *)makeInteger(TRUE));
-				}
-			| EXTERNAL SECURITY INVOKER
-				{
-					$$ = makeDefElem("security", (Node *)makeInteger(FALSE));
-				}
-			| SECURITY DEFINER
-				{
-					$$ = makeDefElem("security", (Node *)makeInteger(TRUE));
-				}
-			| SECURITY INVOKER
-				{
-					$$ = makeDefElem("security", (Node *)makeInteger(FALSE));
-				}
-			| COST NumericOnly
-				{
-					$$ = makeDefElem("cost", (Node *)$2);
-				}
-			| ROWS NumericOnly
-				{
-					$$ = makeDefElem("rows", (Node *)$2);
-				}
-			| SetResetClause
-				{
-					/* we abuse the normal content of a DefElem here */
-					$$ = makeDefElem("set", (Node *)$1);
-				}
-		;
-
-createfunc_opt_item:
-			AS func_as
-				{
-					$$ = makeDefElem("as", (Node *)$2);
-				}
-			| LANGUAGE ColId_or_Sconst
-				{
-					$$ = makeDefElem("language", (Node *)makeString($2));
-				}
-			| WINDOW
-				{
-					$$ = makeDefElem("window", (Node *)makeInteger(TRUE));
-				}
-			| common_func_opt_item
-				{
-					$$ = $1;
-				}
-		;
-
-func_as:	Sconst						{ $$ = list_make1(makeString($1)); }
-			| Sconst ',' Sconst
-				{
-					$$ = list_make2(makeString($1), makeString($3));
-				}
-		;
-
-opt_definition:
-			WITH definition							{ $$ = $2; }
-			| /*EMPTY*/								{ $$ = NIL; }
-		;
-
-table_func_column:	param_name func_type
-				{
-					FunctionParameter *n = makeNode(FunctionParameter);
-					n->name = $1;
-					n->argType = $2;
-					n->mode = FUNC_PARAM_TABLE;
-					n->defexpr = NULL;
-					$$ = n;
-				}
-		;
-
-table_func_column_list:
-			table_func_column
-				{
-					$$ = list_make1($1);
-				}
-			| table_func_column_list ',' table_func_column
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-/*****************************************************************************
- * ALTER FUNCTION
- *
- * RENAME and OWNER subcommands are already provided by the generic
- * ALTER infrastructure, here we just specify alterations that can
- * only be applied to functions.
- *
- *****************************************************************************/
-AlterFunctionStmt:
-			ALTER FUNCTION function_with_argtypes alterfunc_opt_list opt_restrict
-				{
-					AlterFunctionStmt *n = makeNode(AlterFunctionStmt);
-					n->func = $3;
-					n->actions = $4;
-					$$ = (Node *) n;
-				}
-		;
-
-alterfunc_opt_list:
-			/* At least one option must be specified */
-			common_func_opt_item					{ $$ = list_make1($1); }
-			| alterfunc_opt_list common_func_opt_item { $$ = lappend($1, $2); }
-		;
-
-/* Ignored, merely for SQL compliance */
-opt_restrict:
-			RESTRICT
-			| /* EMPTY */
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY:
- *
- *		DROP FUNCTION funcname (arg1, arg2, ...) [ RESTRICT | CASCADE ]
- *		DROP AGGREGATE aggname (arg1, ...) [ RESTRICT | CASCADE ]
- *		DROP OPERATOR opname (leftoperand_typ, rightoperand_typ) [ RESTRICT | CASCADE ]
- *
- *****************************************************************************/
-
-RemoveFuncStmt:
-			DROP FUNCTION func_name func_args opt_drop_behavior
-				{
-					RemoveFuncStmt *n = makeNode(RemoveFuncStmt);
-					n->kind = OBJECT_FUNCTION;
-					n->name = $3;
-					n->args = extractArgTypes($4);
-					n->behavior = $5;
-					n->missing_ok = false;
-					$$ = (Node *)n;
-				}
-			| DROP FUNCTION IF_P EXISTS func_name func_args opt_drop_behavior
-				{
-					RemoveFuncStmt *n = makeNode(RemoveFuncStmt);
-					n->kind = OBJECT_FUNCTION;
-					n->name = $5;
-					n->args = extractArgTypes($6);
-					n->behavior = $7;
-					n->missing_ok = true;
-					$$ = (Node *)n;
-				}
-		;
-
-RemoveAggrStmt:
-			DROP AGGREGATE func_name aggr_args opt_drop_behavior
-				{
-					RemoveFuncStmt *n = makeNode(RemoveFuncStmt);
-					n->kind = OBJECT_AGGREGATE;
-					n->name = $3;
-					n->args = $4;
-					n->behavior = $5;
-					n->missing_ok = false;
-					$$ = (Node *)n;
-				}
-			| DROP AGGREGATE IF_P EXISTS func_name aggr_args opt_drop_behavior
-				{
-					RemoveFuncStmt *n = makeNode(RemoveFuncStmt);
-					n->kind = OBJECT_AGGREGATE;
-					n->name = $5;
-					n->args = $6;
-					n->behavior = $7;
-					n->missing_ok = true;
-					$$ = (Node *)n;
-				}
-		;
-
-RemoveOperStmt:
-			DROP OPERATOR any_operator oper_argtypes opt_drop_behavior
-				{
-					RemoveFuncStmt *n = makeNode(RemoveFuncStmt);
-					n->kind = OBJECT_OPERATOR;
-					n->name = $3;
-					n->args = $4;
-					n->behavior = $5;
-					n->missing_ok = false;
-					$$ = (Node *)n;
-				}
-			| DROP OPERATOR IF_P EXISTS any_operator oper_argtypes opt_drop_behavior
-				{
-					RemoveFuncStmt *n = makeNode(RemoveFuncStmt);
-					n->kind = OBJECT_OPERATOR;
-					n->name = $5;
-					n->args = $6;
-					n->behavior = $7;
-					n->missing_ok = true;
-					$$ = (Node *)n;
-				}
-		;
-
-oper_argtypes:
-			'(' Typename ')'
-				{
-				   ereport(ERROR,
-						   (errcode(ERRCODE_SYNTAX_ERROR),
-							errmsg("missing argument"),
-							errhint("Use NONE to denote the missing argument of a unary operator."),
-							parser_errposition(@3)));
-				}
-			| '(' Typename ',' Typename ')'
-					{ $$ = list_make2($2, $4); }
-			| '(' NONE ',' Typename ')'					/* left unary */
-					{ $$ = list_make2(NULL, $4); }
-			| '(' Typename ',' NONE ')'					/* right unary */
-					{ $$ = list_make2($2, NULL); }
-		;
-
 any_operator:
 			all_Op
 					{ $$ = list_make1(makeString($1)); }
@@ -6237,1723 +548,11 @@ any_operator:
 					{ $$ = lcons(makeString($1), $3); }
 		;
 
-/*****************************************************************************
- *
- *		DO <anonymous code block> [ LANGUAGE language ]
- *
- * We use a DefElem list for future extensibility, and to allow flexibility
- * in the clause order.
- *
- *****************************************************************************/
-
-DoStmt: DO dostmt_opt_list
-				{
-					DoStmt *n = makeNode(DoStmt);
-					n->args = $2;
-					$$ = (Node *)n;
-				}
-		;
-
-dostmt_opt_list:
-			dostmt_opt_item						{ $$ = list_make1($1); }
-			| dostmt_opt_list dostmt_opt_item	{ $$ = lappend($1, $2); }
-		;
-
-dostmt_opt_item:
-			Sconst
-				{
-					$$ = makeDefElem("as", (Node *)makeString($1));
-				}
-			| LANGUAGE ColId_or_Sconst
-				{
-					$$ = makeDefElem("language", (Node *)makeString($2));
-				}
-		;
-
-/*****************************************************************************
- *
- *		CREATE CAST / DROP CAST
- *
- *****************************************************************************/
-
-CreateCastStmt: CREATE CAST '(' Typename AS Typename ')'
-					WITH FUNCTION function_with_argtypes cast_context
-				{
-					CreateCastStmt *n = makeNode(CreateCastStmt);
-					n->sourcetype = $4;
-					n->targettype = $6;
-					n->func = $10;
-					n->context = (CoercionContext) $11;
-					n->inout = false;
-					$$ = (Node *)n;
-				}
-			| CREATE CAST '(' Typename AS Typename ')'
-					WITHOUT FUNCTION cast_context
-				{
-					CreateCastStmt *n = makeNode(CreateCastStmt);
-					n->sourcetype = $4;
-					n->targettype = $6;
-					n->func = NULL;
-					n->context = (CoercionContext) $10;
-					n->inout = false;
-					$$ = (Node *)n;
-				}
-			| CREATE CAST '(' Typename AS Typename ')'
-					WITH INOUT cast_context
-				{
-					CreateCastStmt *n = makeNode(CreateCastStmt);
-					n->sourcetype = $4;
-					n->targettype = $6;
-					n->func = NULL;
-					n->context = (CoercionContext) $10;
-					n->inout = true;
-					$$ = (Node *)n;
-				}
-		;
-
-cast_context:  AS IMPLICIT_P					{ $$ = COERCION_IMPLICIT; }
-		| AS ASSIGNMENT							{ $$ = COERCION_ASSIGNMENT; }
-		| /*EMPTY*/								{ $$ = COERCION_EXPLICIT; }
-		;
-
-
-DropCastStmt: DROP CAST opt_if_exists '(' Typename AS Typename ')' opt_drop_behavior
-				{
-					DropCastStmt *n = makeNode(DropCastStmt);
-					n->sourcetype = $5;
-					n->targettype = $7;
-					n->behavior = $9;
-					n->missing_ok = $3;
-					$$ = (Node *)n;
-				}
-		;
-
-opt_if_exists: IF_P EXISTS						{ $$ = TRUE; }
-		| /*EMPTY*/								{ $$ = FALSE; }
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY:
- *
- *		REINDEX type <name> [FORCE]
- *
- * FORCE no longer does anything, but we accept it for backwards compatibility
- *****************************************************************************/
-
-ReindexStmt:
-			REINDEX reindex_type qualified_name opt_force
-				{
-					ReindexStmt *n = makeNode(ReindexStmt);
-					n->kind = $2;
-					n->relation = $3;
-					n->name = NULL;
-					$$ = (Node *)n;
-				}
-			| REINDEX SYSTEM_P name opt_force
-				{
-					ReindexStmt *n = makeNode(ReindexStmt);
-					n->kind = OBJECT_DATABASE;
-					n->name = $3;
-					n->relation = NULL;
-					n->do_system = true;
-					n->do_user = false;
-					$$ = (Node *)n;
-				}
-			| REINDEX DATABASE name opt_force
-				{
-					ReindexStmt *n = makeNode(ReindexStmt);
-					n->kind = OBJECT_DATABASE;
-					n->name = $3;
-					n->relation = NULL;
-					n->do_system = true;
-					n->do_user = true;
-					$$ = (Node *)n;
-				}
-		;
-
-reindex_type:
-			INDEX									{ $$ = OBJECT_INDEX; }
-			| TABLE									{ $$ = OBJECT_TABLE; }
-		;
-
-opt_force:	FORCE									{  $$ = TRUE; }
-			| /* EMPTY */							{  $$ = FALSE; }
-		;
-
-
-/*****************************************************************************
- *
- * ALTER THING name RENAME TO newname
- *
- *****************************************************************************/
-
-RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_AGGREGATE;
-					n->object = $3;
-					n->objarg = $4;
-					n->newname = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER COLLATION any_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_COLLATION;
-					n->object = $3;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER CONVERSION_P any_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_CONVERSION;
-					n->object = $3;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER DATABASE database_name RENAME TO database_name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_DATABASE;
-					n->subname = $3;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER FUNCTION function_with_argtypes RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_FUNCTION;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER GROUP_P RoleId RENAME TO RoleId
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_ROLE;
-					n->subname = $3;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER opt_procedural LANGUAGE name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_LANGUAGE;
-					n->subname = $4;
-					n->newname = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER OPERATOR CLASS any_name USING access_method RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_OPCLASS;
-					n->object = $4;
-					n->subname = $6;
-					n->newname = $9;
-					$$ = (Node *)n;
-				}
-			| ALTER OPERATOR FAMILY any_name USING access_method RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_OPFAMILY;
-					n->object = $4;
-					n->subname = $6;
-					n->newname = $9;
-					$$ = (Node *)n;
-				}
-			| ALTER SCHEMA name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_SCHEMA;
-					n->subname = $3;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER TABLE relation_expr RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_TABLE;
-					n->relation = $3;
-					n->subname = NULL;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER SEQUENCE qualified_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_SEQUENCE;
-					n->relation = $3;
-					n->subname = NULL;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER VIEW qualified_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_VIEW;
-					n->relation = $3;
-					n->subname = NULL;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER INDEX qualified_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_INDEX;
-					n->relation = $3;
-					n->subname = NULL;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER FOREIGN TABLE relation_expr RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_FOREIGN_TABLE;
-					n->relation = $4;
-					n->subname = NULL;
-					n->newname = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER TABLE relation_expr RENAME opt_column name TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_COLUMN;
-					n->relationType = OBJECT_TABLE;
-					n->relation = $3;
-					n->subname = $6;
-					n->newname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER FOREIGN TABLE relation_expr RENAME opt_column name TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_COLUMN;
-					n->relationType = OBJECT_FOREIGN_TABLE;
-					n->relation = $4;
-					n->subname = $7;
-					n->newname = $9;
-					$$ = (Node *)n;
-				}
-			| ALTER TRIGGER name ON qualified_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_TRIGGER;
-					n->relation = $5;
-					n->subname = $3;
-					n->newname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER ROLE RoleId RENAME TO RoleId
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_ROLE;
-					n->subname = $3;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER USER RoleId RENAME TO RoleId
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_ROLE;
-					n->subname = $3;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER TABLESPACE name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_TABLESPACE;
-					n->subname = $3;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER TABLESPACE name SET reloptions
-				{
-					AlterTableSpaceOptionsStmt *n =
-						makeNode(AlterTableSpaceOptionsStmt);
-					n->tablespacename = $3;
-					n->options = $5;
-					n->isReset = FALSE;
-					$$ = (Node *)n;
-				}
-			| ALTER TABLESPACE name RESET reloptions
-				{
-					AlterTableSpaceOptionsStmt *n =
-						makeNode(AlterTableSpaceOptionsStmt);
-					n->tablespacename = $3;
-					n->options = $5;
-					n->isReset = TRUE;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH PARSER any_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_TSPARSER;
-					n->object = $5;
-					n->newname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH DICTIONARY any_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_TSDICTIONARY;
-					n->object = $5;
-					n->newname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH TEMPLATE any_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_TSTEMPLATE;
-					n->object = $5;
-					n->newname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH CONFIGURATION any_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_TSCONFIGURATION;
-					n->object = $5;
-					n->newname = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER TYPE_P any_name RENAME TO name
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_TYPE;
-					n->object = $3;
-					n->newname = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER TYPE_P any_name RENAME ATTRIBUTE name TO name opt_drop_behavior
-				{
-					RenameStmt *n = makeNode(RenameStmt);
-					n->renameType = OBJECT_ATTRIBUTE;
-					n->relationType = OBJECT_TYPE;
-					n->relation = makeRangeVarFromAnyName($3, @3, yyscanner);
-					n->subname = $6;
-					n->newname = $8;
-					n->behavior = $9;
-					$$ = (Node *)n;
-				}
-		;
-
-opt_column: COLUMN									{ $$ = COLUMN; }
-			| /*EMPTY*/								{ $$ = 0; }
-		;
-
-opt_set_data: SET DATA_P							{ $$ = 1; }
-			| /*EMPTY*/								{ $$ = 0; }
-		;
-
-/*****************************************************************************
- *
- * ALTER THING name SET SCHEMA name
- *
- *****************************************************************************/
-
-AlterObjectSchemaStmt:
-			ALTER AGGREGATE func_name aggr_args SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_AGGREGATE;
-					n->object = $3;
-					n->objarg = $4;
-					n->newschema = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER COLLATION any_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_COLLATION;
-					n->object = $3;
-					n->newschema = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER CONVERSION_P any_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_CONVERSION;
-					n->object = $3;
-					n->newschema = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER DOMAIN_P any_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_DOMAIN;
-					n->object = $3;
-					n->newschema = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION any_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_EXTENSION;
-					n->object = $3;
-					n->newschema = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER FUNCTION function_with_argtypes SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_FUNCTION;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
-					n->newschema = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER OPERATOR any_operator oper_argtypes SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_OPERATOR;
-					n->object = $3;
-					n->objarg = $4;
-					n->newschema = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER OPERATOR CLASS any_name USING access_method SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_OPCLASS;
-					n->object = $4;
-					n->addname = $6;
-					n->newschema = $9;
-					$$ = (Node *)n;
-				}
-			| ALTER OPERATOR FAMILY any_name USING access_method SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_OPFAMILY;
-					n->object = $4;
-					n->addname = $6;
-					n->newschema = $9;
-					$$ = (Node *)n;
-				}
-			| ALTER TABLE relation_expr SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_TABLE;
-					n->relation = $3;
-					n->newschema = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH PARSER any_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_TSPARSER;
-					n->object = $5;
-					n->newschema = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH DICTIONARY any_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_TSDICTIONARY;
-					n->object = $5;
-					n->newschema = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH TEMPLATE any_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_TSTEMPLATE;
-					n->object = $5;
-					n->newschema = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH CONFIGURATION any_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_TSCONFIGURATION;
-					n->object = $5;
-					n->newschema = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER SEQUENCE qualified_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_SEQUENCE;
-					n->relation = $3;
-					n->newschema = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER VIEW qualified_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_VIEW;
-					n->relation = $3;
-					n->newschema = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER FOREIGN TABLE relation_expr SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_FOREIGN_TABLE;
-					n->relation = $4;
-					n->newschema = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER TYPE_P any_name SET SCHEMA name
-				{
-					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
-					n->objectType = OBJECT_TYPE;
-					n->object = $3;
-					n->newschema = $6;
-					$$ = (Node *)n;
-				}
-		;
-
-/*****************************************************************************
- *
- * ALTER THING name OWNER TO newname
- *
- *****************************************************************************/
-
-AlterOwnerStmt: ALTER AGGREGATE func_name aggr_args OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_AGGREGATE;
-					n->object = $3;
-					n->objarg = $4;
-					n->newowner = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER COLLATION any_name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_COLLATION;
-					n->object = $3;
-					n->newowner = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER CONVERSION_P any_name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_CONVERSION;
-					n->object = $3;
-					n->newowner = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER DATABASE database_name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_DATABASE;
-					n->object = list_make1(makeString($3));
-					n->newowner = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER DOMAIN_P any_name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_DOMAIN;
-					n->object = $3;
-					n->newowner = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER FUNCTION function_with_argtypes OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_FUNCTION;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
-					n->newowner = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER opt_procedural LANGUAGE name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_LANGUAGE;
-					n->object = list_make1(makeString($4));
-					n->newowner = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER LARGE_P OBJECT_P NumericOnly OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_LARGEOBJECT;
-					n->object = list_make1($4);
-					n->newowner = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER OPERATOR any_operator oper_argtypes OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_OPERATOR;
-					n->object = $3;
-					n->objarg = $4;
-					n->newowner = $7;
-					$$ = (Node *)n;
-				}
-			| ALTER OPERATOR CLASS any_name USING access_method OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_OPCLASS;
-					n->object = $4;
-					n->addname = $6;
-					n->newowner = $9;
-					$$ = (Node *)n;
-				}
-			| ALTER OPERATOR FAMILY any_name USING access_method OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_OPFAMILY;
-					n->object = $4;
-					n->addname = $6;
-					n->newowner = $9;
-					$$ = (Node *)n;
-				}
-			| ALTER SCHEMA name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_SCHEMA;
-					n->object = list_make1(makeString($3));
-					n->newowner = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER TYPE_P any_name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_TYPE;
-					n->object = $3;
-					n->newowner = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER TABLESPACE name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_TABLESPACE;
-					n->object = list_make1(makeString($3));
-					n->newowner = $6;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH DICTIONARY any_name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_TSDICTIONARY;
-					n->object = $5;
-					n->newowner = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER TEXT_P SEARCH CONFIGURATION any_name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_TSCONFIGURATION;
-					n->object = $5;
-					n->newowner = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER FOREIGN DATA_P WRAPPER name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_FDW;
-					n->object = list_make1(makeString($5));
-					n->newowner = $8;
-					$$ = (Node *)n;
-				}
-			| ALTER SERVER name OWNER TO RoleId
-				{
-					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
-					n->objectType = OBJECT_FOREIGN_SERVER;
-					n->object = list_make1(makeString($3));
-					n->newowner = $6;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY:	Define Rewrite Rule
- *
- *****************************************************************************/
-
-RuleStmt:	CREATE opt_or_replace RULE name AS
-			ON event TO qualified_name where_clause
-			DO opt_instead RuleActionList
-				{
-					RuleStmt *n = makeNode(RuleStmt);
-					n->replace = $2;
-					n->relation = $9;
-					n->rulename = $4;
-					n->whereClause = $10;
-					n->event = $7;
-					n->instead = $12;
-					n->actions = $13;
-					$$ = (Node *)n;
-				}
-		;
-
-RuleActionList:
-			NOTHING									{ $$ = NIL; }
-			| RuleActionStmt						{ $$ = list_make1($1); }
-			| '(' RuleActionMulti ')'				{ $$ = $2; }
-		;
-
-/* the thrashing around here is to discard "empty" statements... */
-RuleActionMulti:
-			RuleActionMulti ';' RuleActionStmtOrEmpty
-				{ if ($3 != NULL)
-					$$ = lappend($1, $3);
-				  else
-					$$ = $1;
-				}
-			| RuleActionStmtOrEmpty
-				{ if ($1 != NULL)
-					$$ = list_make1($1);
-				  else
-					$$ = NIL;
-				}
-		;
-
-RuleActionStmt:
-			SelectStmt
-			| InsertStmt
-			| UpdateStmt
-			| DeleteStmt
-			| NotifyStmt
-		;
-
-RuleActionStmtOrEmpty:
-			RuleActionStmt							{ $$ = $1; }
-			|	/*EMPTY*/							{ $$ = NULL; }
-		;
-
-event:		SELECT									{ $$ = CMD_SELECT; }
-			| UPDATE								{ $$ = CMD_UPDATE; }
-			| DELETE_P								{ $$ = CMD_DELETE; }
-			| INSERT								{ $$ = CMD_INSERT; }
-		 ;
-
-opt_instead:
-			INSTEAD									{ $$ = TRUE; }
-			| ALSO									{ $$ = FALSE; }
-			| /*EMPTY*/								{ $$ = FALSE; }
-		;
-
-
-DropRuleStmt:
-			DROP RULE name ON qualified_name opt_drop_behavior
-				{
-					DropPropertyStmt *n = makeNode(DropPropertyStmt);
-					n->relation = $5;
-					n->property = $3;
-					n->behavior = $6;
-					n->removeType = OBJECT_RULE;
-					n->missing_ok = false;
-					$$ = (Node *) n;
-				}
-			| DROP RULE IF_P EXISTS name ON qualified_name opt_drop_behavior
-				{
-					DropPropertyStmt *n = makeNode(DropPropertyStmt);
-					n->relation = $7;
-					n->property = $5;
-					n->behavior = $8;
-					n->removeType = OBJECT_RULE;
-					n->missing_ok = true;
-					$$ = (Node *) n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY:
- *				NOTIFY <identifier> can appear both in rule bodies and
- *				as a query-level command
- *
- *****************************************************************************/
-
-NotifyStmt: NOTIFY ColId notify_payload
-				{
-					NotifyStmt *n = makeNode(NotifyStmt);
-					n->conditionname = $2;
-					n->payload = $3;
-					$$ = (Node *)n;
-				}
-		;
-
-notify_payload:
-			',' Sconst							{ $$ = $2; }
-			| /*EMPTY*/							{ $$ = NULL; }
-		;
-
-ListenStmt: LISTEN ColId
-				{
-					ListenStmt *n = makeNode(ListenStmt);
-					n->conditionname = $2;
-					$$ = (Node *)n;
-				}
-		;
-
-UnlistenStmt:
-			UNLISTEN ColId
-				{
-					UnlistenStmt *n = makeNode(UnlistenStmt);
-					n->conditionname = $2;
-					$$ = (Node *)n;
-				}
-			| UNLISTEN '*'
-				{
-					UnlistenStmt *n = makeNode(UnlistenStmt);
-					n->conditionname = NULL;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		Transactions:
- *
- *		BEGIN / COMMIT / ROLLBACK
- *		(also older versions END / ABORT)
- *
- *****************************************************************************/
-
-TransactionStmt:
-			ABORT_P opt_transaction
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_ROLLBACK;
-					n->options = NIL;
-					$$ = (Node *)n;
-				}
-			| BEGIN_P opt_transaction transaction_mode_list_or_empty
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_BEGIN;
-					n->options = $3;
-					$$ = (Node *)n;
-				}
-			| START TRANSACTION transaction_mode_list_or_empty
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_START;
-					n->options = $3;
-					$$ = (Node *)n;
-				}
-			| COMMIT opt_transaction
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_COMMIT;
-					n->options = NIL;
-					$$ = (Node *)n;
-				}
-			| END_P opt_transaction
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_COMMIT;
-					n->options = NIL;
-					$$ = (Node *)n;
-				}
-			| ROLLBACK opt_transaction
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_ROLLBACK;
-					n->options = NIL;
-					$$ = (Node *)n;
-				}
-			| SAVEPOINT ColId
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_SAVEPOINT;
-					n->options = list_make1(makeDefElem("savepoint_name",
-														(Node *)makeString($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)));
-					$$ = (Node *)n;
-				}
-			| RELEASE ColId
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_RELEASE;
-					n->options = list_make1(makeDefElem("savepoint_name",
-														(Node *)makeString($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)));
-					$$ = (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)));
-					$$ = (Node *)n;
-				}
-			| PREPARE TRANSACTION Sconst
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_PREPARE;
-					n->gid = $3;
-					$$ = (Node *)n;
-				}
-			| COMMIT PREPARED Sconst
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_COMMIT_PREPARED;
-					n->gid = $3;
-					$$ = (Node *)n;
-				}
-			| ROLLBACK PREPARED Sconst
-				{
-					TransactionStmt *n = makeNode(TransactionStmt);
-					n->kind = TRANS_STMT_ROLLBACK_PREPARED;
-					n->gid = $3;
-					$$ = (Node *)n;
-				}
-		;
-
-opt_transaction:	WORK							{}
-			| TRANSACTION							{}
-			| /*EMPTY*/								{}
-		;
-
-transaction_mode_item:
-			ISOLATION LEVEL iso_level
-					{ $$ = makeDefElem("transaction_isolation",
-									   makeStringConst($3, @3)); }
-			| READ ONLY
-					{ $$ = makeDefElem("transaction_read_only",
-									   makeIntConst(TRUE, @1)); }
-			| READ WRITE
-					{ $$ = makeDefElem("transaction_read_only",
-									   makeIntConst(FALSE, @1)); }
-			| DEFERRABLE
-					{ $$ = makeDefElem("transaction_deferrable",
-									   makeIntConst(TRUE, @1)); }
-			| NOT DEFERRABLE
-					{ $$ = makeDefElem("transaction_deferrable",
-									   makeIntConst(FALSE, @1)); }
-		;
-
-/* Syntax with commas is SQL-spec, without commas is Postgres historical */
-transaction_mode_list:
-			transaction_mode_item
-					{ $$ = list_make1($1); }
-			| transaction_mode_list ',' transaction_mode_item
-					{ $$ = lappend($1, $3); }
-			| transaction_mode_list transaction_mode_item
-					{ $$ = lappend($1, $2); }
-		;
-
-transaction_mode_list_or_empty:
-			transaction_mode_list
-			| /* EMPTY */
-					{ $$ = NIL; }
-		;
-
-
-/*****************************************************************************
- *
- *	QUERY:
- *		CREATE [ OR REPLACE ] [ TEMP ] VIEW <viewname> '('target-list ')'
- *			AS <query> [ WITH [ CASCADED | LOCAL ] CHECK OPTION ]
- *
- *****************************************************************************/
-
-ViewStmt: CREATE OptTemp VIEW qualified_name opt_column_list
-				AS SelectStmt opt_check_option
-				{
-					ViewStmt *n = makeNode(ViewStmt);
-					n->view = $4;
-					n->view->relpersistence = $2;
-					n->aliases = $5;
-					n->query = $7;
-					n->replace = false;
-					$$ = (Node *) n;
-				}
-		| CREATE OR REPLACE OptTemp VIEW qualified_name opt_column_list
-				AS SelectStmt opt_check_option
-				{
-					ViewStmt *n = makeNode(ViewStmt);
-					n->view = $6;
-					n->view->relpersistence = $4;
-					n->aliases = $7;
-					n->query = $9;
-					n->replace = true;
-					$$ = (Node *) n;
-				}
-		;
-
-opt_check_option:
-		WITH CHECK OPTION
-				{
-					ereport(ERROR,
-							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-							 errmsg("WITH CHECK OPTION is not implemented")));
-				}
-		| WITH CASCADED CHECK OPTION
-				{
-					ereport(ERROR,
-							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-							 errmsg("WITH CHECK OPTION is not implemented")));
-				}
-		| WITH LOCAL CHECK OPTION
-				{
-					ereport(ERROR,
-							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-							 errmsg("WITH CHECK OPTION is not implemented")));
-				}
-		| /* EMPTY */							{ $$ = NIL; }
-		;
-
-/*****************************************************************************
- *
- *		QUERY:
- *				LOAD "filename"
- *
- *****************************************************************************/
-
-LoadStmt:	LOAD file_name
-				{
-					LoadStmt *n = makeNode(LoadStmt);
-					n->filename = $2;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		CREATE DATABASE
- *
- *****************************************************************************/
-
-CreatedbStmt:
-			CREATE DATABASE database_name opt_with createdb_opt_list
-				{
-					CreatedbStmt *n = makeNode(CreatedbStmt);
-					n->dbname = $3;
-					n->options = $5;
-					$$ = (Node *)n;
-				}
-		;
-
-createdb_opt_list:
-			createdb_opt_list createdb_opt_item		{ $$ = lappend($1, $2); }
-			| /* EMPTY */							{ $$ = NIL; }
-		;
-
-createdb_opt_item:
-			TABLESPACE opt_equal name
-				{
-					$$ = makeDefElem("tablespace", (Node *)makeString($3));
-				}
-			| TABLESPACE opt_equal DEFAULT
-				{
-					$$ = makeDefElem("tablespace", NULL);
-				}
-			| LOCATION opt_equal Sconst
-				{
-					$$ = makeDefElem("location", (Node *)makeString($3));
-				}
-			| LOCATION opt_equal DEFAULT
-				{
-					$$ = makeDefElem("location", NULL);
-				}
-			| TEMPLATE opt_equal name
-				{
-					$$ = makeDefElem("template", (Node *)makeString($3));
-				}
-			| TEMPLATE opt_equal DEFAULT
-				{
-					$$ = makeDefElem("template", NULL);
-				}
-			| ENCODING opt_equal Sconst
-				{
-					$$ = makeDefElem("encoding", (Node *)makeString($3));
-				}
-			| ENCODING opt_equal Iconst
-				{
-					$$ = makeDefElem("encoding", (Node *)makeInteger($3));
-				}
-			| ENCODING opt_equal DEFAULT
-				{
-					$$ = makeDefElem("encoding", NULL);
-				}
-			| LC_COLLATE_P opt_equal Sconst
-				{
-					$$ = makeDefElem("lc_collate", (Node *)makeString($3));
-				}
-			| LC_COLLATE_P opt_equal DEFAULT
-				{
-					$$ = makeDefElem("lc_collate", NULL);
-				}
-			| LC_CTYPE_P opt_equal Sconst
-				{
-					$$ = makeDefElem("lc_ctype", (Node *)makeString($3));
-				}
-			| LC_CTYPE_P opt_equal DEFAULT
-				{
-					$$ = makeDefElem("lc_ctype", NULL);
-				}
-			| CONNECTION LIMIT opt_equal SignedIconst
-				{
-					$$ = makeDefElem("connectionlimit", (Node *)makeInteger($4));
-				}
-			| OWNER opt_equal name
-				{
-					$$ = makeDefElem("owner", (Node *)makeString($3));
-				}
-			| OWNER opt_equal DEFAULT
-				{
-					$$ = makeDefElem("owner", NULL);
-				}
-		;
-
-/*
- *	Though the equals sign doesn't match other WITH options, pg_dump uses
- *	equals for backward compatibility, and it doesn't seem worth removing it.
- */
-opt_equal:	'='										{}
-			| /*EMPTY*/								{}
-		;
-
-
-/*****************************************************************************
- *
- *		ALTER DATABASE
- *
- *****************************************************************************/
-
-AlterDatabaseStmt:
-			ALTER DATABASE database_name opt_with alterdb_opt_list
-				 {
-					AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt);
-					n->dbname = $3;
-					n->options = $5;
-					$$ = (Node *)n;
-				 }
-			| ALTER DATABASE database_name SET TABLESPACE name
-				 {
-					AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt);
-					n->dbname = $3;
-					n->options = list_make1(makeDefElem("tablespace",
-													(Node *)makeString($6)));
-					$$ = (Node *)n;
-				 }
-		;
-
-AlterDatabaseSetStmt:
-			ALTER DATABASE database_name SetResetClause
-				{
-					AlterDatabaseSetStmt *n = makeNode(AlterDatabaseSetStmt);
-					n->dbname = $3;
-					n->setstmt = $4;
-					$$ = (Node *)n;
-				}
-		;
-
-
-alterdb_opt_list:
-			alterdb_opt_list alterdb_opt_item		{ $$ = lappend($1, $2); }
-			| /* EMPTY */							{ $$ = NIL; }
-		;
-
-alterdb_opt_item:
-			CONNECTION LIMIT opt_equal SignedIconst
-				{
-					$$ = makeDefElem("connectionlimit", (Node *)makeInteger($4));
-				}
-		;
-
-
-/*****************************************************************************
- *
- *		DROP DATABASE [ IF EXISTS ]
- *
- * This is implicitly CASCADE, no need for drop behavior
- *****************************************************************************/
-
-DropdbStmt: DROP DATABASE database_name
-				{
-					DropdbStmt *n = makeNode(DropdbStmt);
-					n->dbname = $3;
-					n->missing_ok = FALSE;
-					$$ = (Node *)n;
-				}
-			| DROP DATABASE IF_P EXISTS database_name
-				{
-					DropdbStmt *n = makeNode(DropdbStmt);
-					n->dbname = $5;
-					n->missing_ok = TRUE;
-					$$ = (Node *)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- * Manipulate a domain
- *
- *****************************************************************************/
-
-CreateDomainStmt:
-			CREATE DOMAIN_P any_name opt_as Typename ColQualList
-				{
-					CreateDomainStmt *n = makeNode(CreateDomainStmt);
-					n->domainname = $3;
-					n->typeName = $5;
-					SplitColQualList($6, &n->constraints, &n->collClause,
-									 yyscanner);
-					$$ = (Node *)n;
-				}
-		;
-
-AlterDomainStmt:
-			/* ALTER DOMAIN <domain> {SET DEFAULT <expr>|DROP DEFAULT} */
-			ALTER DOMAIN_P any_name alter_column_default
-				{
-					AlterDomainStmt *n = makeNode(AlterDomainStmt);
-					n->subtype = 'T';
-					n->typeName = $3;
-					n->def = $4;
-					$$ = (Node *)n;
-				}
-			/* ALTER DOMAIN <domain> DROP NOT NULL */
-			| ALTER DOMAIN_P any_name DROP NOT NULL_P
-				{
-					AlterDomainStmt *n = makeNode(AlterDomainStmt);
-					n->subtype = 'N';
-					n->typeName = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER DOMAIN <domain> SET NOT NULL */
-			| ALTER DOMAIN_P any_name SET NOT NULL_P
-				{
-					AlterDomainStmt *n = makeNode(AlterDomainStmt);
-					n->subtype = 'O';
-					n->typeName = $3;
-					$$ = (Node *)n;
-				}
-			/* ALTER DOMAIN <domain> ADD CONSTRAINT ... */
-			| ALTER DOMAIN_P any_name ADD_P TableConstraint
-				{
-					AlterDomainStmt *n = makeNode(AlterDomainStmt);
-					n->subtype = 'C';
-					n->typeName = $3;
-					n->def = $5;
-					$$ = (Node *)n;
-				}
-			/* ALTER DOMAIN <domain> DROP CONSTRAINT <name> [RESTRICT|CASCADE] */
-			| ALTER DOMAIN_P any_name DROP CONSTRAINT name opt_drop_behavior
-				{
-					AlterDomainStmt *n = makeNode(AlterDomainStmt);
-					n->subtype = 'X';
-					n->typeName = $3;
-					n->name = $6;
-					n->behavior = $7;
-					$$ = (Node *)n;
-				}
-			;
-
-opt_as:		AS										{}
-			| /* EMPTY */							{}
-		;
-
-
-/*****************************************************************************
- *
- * Manipulate a text search dictionary or configuration
- *
- *****************************************************************************/
-
-AlterTSDictionaryStmt:
-			ALTER TEXT_P SEARCH DICTIONARY any_name definition
-				{
-					AlterTSDictionaryStmt *n = makeNode(AlterTSDictionaryStmt);
-					n->dictname = $5;
-					n->options = $6;
-					$$ = (Node *)n;
-				}
-		;
-
-AlterTSConfigurationStmt:
-			ALTER TEXT_P SEARCH CONFIGURATION any_name ADD_P MAPPING FOR name_list WITH any_name_list
-				{
-					AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt);
-					n->cfgname = $5;
-					n->tokentype = $9;
-					n->dicts = $11;
-					n->override = false;
-					n->replace = false;
-					$$ = (Node*)n;
-				}
-			| ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list WITH any_name_list
-				{
-					AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt);
-					n->cfgname = $5;
-					n->tokentype = $9;
-					n->dicts = $11;
-					n->override = true;
-					n->replace = false;
-					$$ = (Node*)n;
-				}
-			| ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING REPLACE any_name WITH any_name
-				{
-					AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt);
-					n->cfgname = $5;
-					n->tokentype = NIL;
-					n->dicts = list_make2($9,$11);
-					n->override = false;
-					n->replace = true;
-					$$ = (Node*)n;
-				}
-			| ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list REPLACE any_name WITH any_name
-				{
-					AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt);
-					n->cfgname = $5;
-					n->tokentype = $9;
-					n->dicts = list_make2($11,$13);
-					n->override = false;
-					n->replace = true;
-					$$ = (Node*)n;
-				}
-			| ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING FOR name_list
-				{
-					AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt);
-					n->cfgname = $5;
-					n->tokentype = $9;
-					n->missing_ok = false;
-					$$ = (Node*)n;
-				}
-			| ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING IF_P EXISTS FOR name_list
-				{
-					AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt);
-					n->cfgname = $5;
-					n->tokentype = $11;
-					n->missing_ok = true;
-					$$ = (Node*)n;
-				}
-		;
-
-
-/*****************************************************************************
- *
- * Manipulate a conversion
- *
- *		CREATE [DEFAULT] CONVERSION <conversion_name>
- *		FOR <encoding_name> TO <encoding_name> FROM <func_name>
- *
- *****************************************************************************/
-
-CreateConversionStmt:
-			CREATE opt_default CONVERSION_P any_name FOR Sconst
-			TO Sconst FROM any_name
-			{
-			  CreateConversionStmt *n = makeNode(CreateConversionStmt);
-			  n->conversion_name = $4;
-			  n->for_encoding_name = $6;
-			  n->to_encoding_name = $8;
-			  n->func_name = $10;
-			  n->def = $2;
-			  $$ = (Node *)n;
-			}
-		;
-
-/*****************************************************************************
- *
- *		QUERY:
- *				CLUSTER [VERBOSE] <qualified_name> [ USING <index_name> ]
- *				CLUSTER [VERBOSE]
- *				CLUSTER [VERBOSE] <index_name> ON <qualified_name> (for pre-8.3)
- *
- *****************************************************************************/
-
-ClusterStmt:
-			CLUSTER opt_verbose qualified_name cluster_index_specification
-				{
-			       ClusterStmt *n = makeNode(ClusterStmt);
-				   n->relation = $3;
-				   n->indexname = $4;
-				   n->verbose = $2;
-				   $$ = (Node*)n;
-				}
-			| CLUSTER opt_verbose
-			    {
-				   ClusterStmt *n = makeNode(ClusterStmt);
-				   n->relation = NULL;
-				   n->indexname = NULL;
-				   n->verbose = $2;
-				   $$ = (Node*)n;
-				}
-			/* kept for pre-8.3 compatibility */
-			| CLUSTER opt_verbose index_name ON qualified_name
-				{
-				   ClusterStmt *n = makeNode(ClusterStmt);
-				   n->relation = $5;
-				   n->indexname = $3;
-				   n->verbose = $2;
-				   $$ = (Node*)n;
-				}
-		;
-
-cluster_index_specification:
-			USING index_name		{ $$ = $2; }
-			| /*EMPTY*/				{ $$ = NULL; }
-		;
-
-
-/*****************************************************************************
- *
- *		QUERY:
- *				VACUUM
- *				ANALYZE
- *
- *****************************************************************************/
-
-VacuumStmt: VACUUM opt_full opt_freeze opt_verbose
-				{
-					VacuumStmt *n = makeNode(VacuumStmt);
-					n->options = VACOPT_VACUUM;
-					if ($2)
-						n->options |= VACOPT_FULL;
-					if ($4)
-						n->options |= VACOPT_VERBOSE;
-					n->freeze_min_age = $3 ? 0 : -1;
-					n->freeze_table_age = $3 ? 0 : -1;
-					n->relation = NULL;
-					n->va_cols = NIL;
-					$$ = (Node *)n;
-				}
-			| VACUUM opt_full opt_freeze opt_verbose qualified_name
-				{
-					VacuumStmt *n = makeNode(VacuumStmt);
-					n->options = VACOPT_VACUUM;
-					if ($2)
-						n->options |= VACOPT_FULL;
-					if ($4)
-						n->options |= VACOPT_VERBOSE;
-					n->freeze_min_age = $3 ? 0 : -1;
-					n->freeze_table_age = $3 ? 0 : -1;
-					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 ($4)
-						n->options |= VACOPT_VERBOSE;
-					n->freeze_min_age = $3 ? 0 : -1;
-					n->freeze_table_age = $3 ? 0 : -1;
-					$$ = (Node *)n;
-				}
-			| VACUUM '(' vacuum_option_list ')'
-				{
-					VacuumStmt *n = makeNode(VacuumStmt);
-					n->options = VACOPT_VACUUM | $3;
-					if (n->options & VACOPT_FREEZE)
-						n->freeze_min_age = n->freeze_table_age = 0;
-					else
-						n->freeze_min_age = n->freeze_table_age = -1;
-					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;
-					if (n->options & VACOPT_FREEZE)
-						n->freeze_min_age = n->freeze_table_age = 0;
-					else
-						n->freeze_min_age = n->freeze_table_age = -1;
-					n->relation = $5;
-					n->va_cols = $6;
-					if (n->va_cols != NIL)	/* implies analyze */
-						n->options |= VACOPT_ANALYZE;
-					$$ = (Node *) n;
-				}
-		;
-
-vacuum_option_list:
-			vacuum_option_elem								{ $$ = $1; }
-			| vacuum_option_list ',' vacuum_option_elem		{ $$ = $1 | $3; }
-		;
-
-vacuum_option_elem:
-			analyze_keyword		{ $$ = VACOPT_ANALYZE; }
-			| VERBOSE			{ $$ = VACOPT_VERBOSE; }
-			| FREEZE			{ $$ = VACOPT_FREEZE; }
-			| FULL				{ $$ = VACOPT_FULL; }
-		;
-
-AnalyzeStmt:
-			analyze_keyword opt_verbose
-				{
-					VacuumStmt *n = makeNode(VacuumStmt);
-					n->options = VACOPT_ANALYZE;
-					if ($2)
-						n->options |= VACOPT_VERBOSE;
-					n->freeze_min_age = -1;
-					n->freeze_table_age = -1;
-					n->relation = NULL;
-					n->va_cols = NIL;
-					$$ = (Node *)n;
-				}
-			| analyze_keyword opt_verbose qualified_name opt_name_list
-				{
-					VacuumStmt *n = makeNode(VacuumStmt);
-					n->options = VACOPT_ANALYZE;
-					if ($2)
-						n->options |= VACOPT_VERBOSE;
-					n->freeze_min_age = -1;
-					n->freeze_table_age = -1;
-					n->relation = $3;
-					n->va_cols = $4;
-					$$ = (Node *)n;
-				}
-		;
-
-analyze_keyword:
-			ANALYZE									{}
-			| ANALYSE /* British */					{}
-		;
-
-opt_verbose:
-			VERBOSE									{ $$ = TRUE; }
-			| /*EMPTY*/								{ $$ = FALSE; }
-		;
-
-opt_full:	FULL									{ $$ = TRUE; }
-			| /*EMPTY*/								{ $$ = FALSE; }
-		;
-
-opt_freeze: FREEZE									{ $$ = TRUE; }
-			| /*EMPTY*/								{ $$ = FALSE; }
-		;
-
 opt_name_list:
 			'(' name_list ')'						{ $$ = $2; }
 			| /*EMPTY*/								{ $$ = NIL; }
 		;
 
-
-/*****************************************************************************
- *
- *		QUERY:
- *				EXPLAIN [ANALYZE] [VERBOSE] query
- *				EXPLAIN ( options ) query
- *
- *****************************************************************************/
-
-ExplainStmt:
-		EXPLAIN ExplainableStmt
-				{
-					ExplainStmt *n = makeNode(ExplainStmt);
-					n->query = $2;
-					n->options = NIL;
-					$$ = (Node *) n;
-				}
-		| EXPLAIN analyze_keyword opt_verbose ExplainableStmt
-				{
-					ExplainStmt *n = makeNode(ExplainStmt);
-					n->query = $4;
-					n->options = list_make1(makeDefElem("analyze", NULL));
-					if ($3)
-						n->options = lappend(n->options,
-											 makeDefElem("verbose", NULL));
-					$$ = (Node *) n;
-				}
-		| EXPLAIN VERBOSE ExplainableStmt
-				{
-					ExplainStmt *n = makeNode(ExplainStmt);
-					n->query = $3;
-					n->options = list_make1(makeDefElem("verbose", NULL));
-					$$ = (Node *) n;
-				}
-		| EXPLAIN '(' explain_option_list ')' ExplainableStmt
-				{
-					ExplainStmt *n = makeNode(ExplainStmt);
-					n->query = $5;
-					n->options = $3;
-					$$ = (Node *) n;
-				}
-		;
-
-ExplainableStmt:
-			SelectStmt
-			| InsertStmt
-			| UpdateStmt
-			| DeleteStmt
-			| DeclareCursorStmt
-			| CreateAsStmt
-			| ExecuteStmt					/* by default all are $$=$1 */
-		;
-
-explain_option_list:
-			explain_option_elem
-				{
-					$$ = list_make1($1);
-				}
-			| explain_option_list ',' explain_option_elem
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-explain_option_elem:
-			explain_option_name explain_option_arg
-				{
-					$$ = makeDefElem($1, $2);
-				}
-		;
-
-explain_option_name:
-			ColId					{ $$ = $1; }
-			| analyze_keyword		{ $$ = "analyze"; }
-			| VERBOSE				{ $$ = "verbose"; }
-		;
-
-explain_option_arg:
-			opt_boolean_or_string	{ $$ = (Node *) makeString($1); }
-			| NumericOnly			{ $$ = (Node *) $1; }
-			| /* EMPTY */			{ $$ = NULL; }
-		;
-
-/*****************************************************************************
- *
- *		QUERY:
- *				PREPARE <plan_name> [(args, ...)] AS <query>
- *
- *****************************************************************************/
-
-PrepareStmt: PREPARE name prep_type_clause AS PreparableStmt
-				{
-					PrepareStmt *n = makeNode(PrepareStmt);
-					n->name = $2;
-					n->argtypes = $3;
-					n->query = $5;
-					$$ = (Node *) n;
-				}
-		;
-
-prep_type_clause: '(' type_list ')'			{ $$ = $2; }
-				| /* EMPTY */				{ $$ = NIL; }
-		;
-
 PreparableStmt:
 			SelectStmt
 			| InsertStmt
@@ -7963,75 +562,6 @@ PreparableStmt:
 
 /*****************************************************************************
  *
- * EXECUTE <plan_name> [(params, ...)]
- * CREATE TABLE <name> AS EXECUTE <plan_name> [(params, ...)]
- *
- *****************************************************************************/
-
-ExecuteStmt: EXECUTE name execute_param_clause
-				{
-					ExecuteStmt *n = makeNode(ExecuteStmt);
-					n->name = $2;
-					n->params = $3;
-					n->into = NULL;
-					$$ = (Node *) n;
-				}
-			| CREATE OptTemp TABLE create_as_target AS
-				EXECUTE name execute_param_clause
-				{
-					ExecuteStmt *n = makeNode(ExecuteStmt);
-					n->name = $7;
-					n->params = $8;
-					$4->rel->relpersistence = $2;
-					n->into = $4;
-					if ($4->colNames)
-						ereport(ERROR,
-								(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-								 errmsg("column name list not allowed in CREATE TABLE / AS EXECUTE")));
-					/* ... because it's not implemented, but it could be */
-					$$ = (Node *) n;
-				}
-		;
-
-execute_param_clause: '(' expr_list ')'				{ $$ = $2; }
-					| /* EMPTY */					{ $$ = NIL; }
-					;
-
-/*****************************************************************************
- *
- *		QUERY:
- *				DEALLOCATE [PREPARE] <plan_name>
- *
- *****************************************************************************/
-
-DeallocateStmt: DEALLOCATE name
-					{
-						DeallocateStmt *n = makeNode(DeallocateStmt);
-						n->name = $2;
-						$$ = (Node *) n;
-					}
-				| DEALLOCATE PREPARE name
-					{
-						DeallocateStmt *n = makeNode(DeallocateStmt);
-						n->name = $3;
-						$$ = (Node *) n;
-					}
-				| DEALLOCATE ALL
-					{
-						DeallocateStmt *n = makeNode(DeallocateStmt);
-						n->name = NULL;
-						$$ = (Node *) n;
-					}
-				| DEALLOCATE PREPARE ALL
-					{
-						DeallocateStmt *n = makeNode(DeallocateStmt);
-						n->name = NULL;
-						$$ = (Node *) n;
-					}
-		;
-
-/*****************************************************************************
- *
  *		QUERY:
  *				INSERT STATEMENTS
  *
@@ -8117,39 +647,6 @@ using_clause:
 			| /*EMPTY*/								{ $$ = NIL; }
 		;
 
-
-/*****************************************************************************
- *
- *		QUERY:
- *				LOCK TABLE
- *
- *****************************************************************************/
-
-LockStmt:	LOCK_P opt_table relation_expr_list opt_lock opt_nowait
-				{
-					LockStmt *n = makeNode(LockStmt);
-
-					n->relations = $3;
-					n->mode = $4;
-					n->nowait = $5;
-					$$ = (Node *)n;
-				}
-		;
-
-opt_lock:	IN_P lock_type MODE 			{ $$ = $2; }
-			| /*EMPTY*/						{ $$ = AccessExclusiveLock; }
-		;
-
-lock_type:	ACCESS SHARE					{ $$ = AccessShareLock; }
-			| ROW SHARE						{ $$ = RowShareLock; }
-			| ROW EXCLUSIVE					{ $$ = RowExclusiveLock; }
-			| SHARE UPDATE EXCLUSIVE		{ $$ = ShareUpdateExclusiveLock; }
-			| SHARE							{ $$ = ShareLock; }
-			| SHARE ROW EXCLUSIVE			{ $$ = ShareRowExclusiveLock; }
-			| EXCLUSIVE						{ $$ = ExclusiveLock; }
-			| ACCESS EXCLUSIVE				{ $$ = AccessExclusiveLock; }
-		;
-
 opt_nowait:	NOWAIT							{ $$ = TRUE; }
 			| /*EMPTY*/						{ $$ = FALSE; }
 		;
@@ -8242,38 +739,9 @@ set_target_list:
 		;
 
 
-/*****************************************************************************
- *
- *		QUERY:
- *				CURSOR STATEMENTS
- *
- *****************************************************************************/
-DeclareCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR SelectStmt
-				{
-					DeclareCursorStmt *n = makeNode(DeclareCursorStmt);
-					n->portalname = $2;
-					/* currently we always set FAST_PLAN option */
-					n->options = $3 | $5 | CURSOR_OPT_FAST_PLAN;
-					n->query = $7;
-					$$ = (Node *)n;
-				}
-		;
-
 cursor_name:	name						{ $$ = $1; }
 		;
 
-cursor_options: /*EMPTY*/					{ $$ = 0; }
-			| cursor_options NO SCROLL		{ $$ = $1 | CURSOR_OPT_NO_SCROLL; }
-			| cursor_options SCROLL			{ $$ = $1 | CURSOR_OPT_SCROLL; }
-			| cursor_options BINARY			{ $$ = $1 | CURSOR_OPT_BINARY; }
-			| cursor_options INSENSITIVE	{ $$ = $1 | CURSOR_OPT_INSENSITIVE; }
-		;
-
-opt_hold: /* EMPTY */						{ $$ = 0; }
-			| WITH HOLD						{ $$ = CURSOR_OPT_HOLD; }
-			| WITHOUT HOLD					{ $$ = 0; }
-		;
-
 /*****************************************************************************
  *
  *		QUERY:
@@ -9077,13 +1545,6 @@ relation_expr:
 				}
 		;
 
-
-relation_expr_list:
-			relation_expr							{ $$ = list_make1($1); }
-			| relation_expr_list ',' relation_expr	{ $$ = lappend($1, $3); }
-		;
-
-
 /*
  * Given "UPDATE foo set set ...", we have to decide without looking any
  * further ahead whether the first "set" is an alias or the UPDATE's SET
@@ -9138,11 +1599,6 @@ where_or_current_clause:
 		;
 
 
-OptTableFuncElementList:
-			TableFuncElementList				{ $$ = $1; }
-			| /*EMPTY*/							{ $$ = NIL; }
-		;
-
 TableFuncElementList:
 			TableFuncElement
 				{
@@ -11629,18 +4085,8 @@ name_list:	name
 
 name:		ColId									{ $$ = $1; };
 
-database_name:
-			ColId									{ $$ = $1; };
-
-access_method:
-			ColId									{ $$ = $1; };
-
 attr_name:	ColLabel								{ $$ = $1; };
 
-index_name: ColId									{ $$ = $1; };
-
-file_name:	Sconst									{ $$ = $1; };
-
 /*
  * The production for a qualified func_name has to exactly match the
  * production for a qualified columnref, because we cannot tell which we
@@ -11762,7 +4208,6 @@ AexprConst: Iconst
 
 Iconst:		ICONST									{ $$ = $1; };
 Sconst:		SCONST									{ $$ = $1; };
-RoleId:		ColId									{ $$ = $1; };
 
 SignedIconst: Iconst								{ $$ = $1; }
 			| '+' Iconst							{ $$ = + $2; }
@@ -11817,239 +4262,55 @@ ColLabel:	IDENT									{ $$ = $1; }
  * it is listed here.  (Someday we may be able to generate these lists and
  * kwlist.h's table from a common master list.)
  */
-
 /* "Unreserved" keywords --- available for use as any kind of name.
  */
 unreserved_keyword:
-			  ABORT_P
-			| ABSOLUTE_P
-			| ACCESS
-			| ACTION
-			| ADD_P
-			| ADMIN
-			| AFTER
-			| AGGREGATE
-			| ALSO
-			| ALTER
-			| ALWAYS
-			| ASSERTION
-			| ASSIGNMENT
-			| AT
-			| ATTRIBUTE
-			| BACKWARD
-			| BEFORE
-			| BEGIN_P
+			  AT
 			| BY
-			| CACHE
-			| CALLED
-			| CASCADE
-			| CASCADED
-			| CATALOG_P
-			| CHAIN
-			| CHARACTERISTICS
-			| CHECKPOINT
-			| CLASS
-			| CLOSE
-			| CLUSTER
-			| COLLATION
-			| COMMENT
-			| COMMENTS
-			| COMMIT
-			| COMMITTED
-			| CONFIGURATION
-			| CONNECTION
-			| CONSTRAINTS
 			| CONTENT_P
-			| CONTINUE_P
-			| CONVERSION_P
-			| COPY
-			| COST
-			| CSV
 			| CURRENT_P
-			| CURSOR
-			| CYCLE
-			| DATA_P
-			| DATABASE
 			| DAY_P
-			| DEALLOCATE
-			| DECLARE
-			| DEFAULTS
-			| DEFERRED
-			| DEFINER
 			| DELETE_P
-			| DELIMITER
-			| DELIMITERS
-			| DICTIONARY
-			| DISABLE_P
-			| DISCARD
 			| DOCUMENT_P
-			| DOMAIN_P
 			| DOUBLE_P
-			| DROP
-			| EACH
-			| ENABLE_P
-			| ENCODING
-			| ENCRYPTED
-			| ENUM_P
 			| ESCAPE
-			| EXCLUDE
-			| EXCLUDING
-			| EXCLUSIVE
-			| EXECUTE
-			| EXPLAIN
-			| EXTENSION
-			| EXTERNAL
-			| FAMILY
 			| FIRST_P
 			| FOLLOWING
-			| FORCE
-			| FORWARD
-			| FUNCTION
-			| FUNCTIONS
 			| GLOBAL
-			| GRANTED
-			| HANDLER
-			| HEADER_P
-			| HOLD
 			| HOUR_P
-			| IDENTITY_P
-			| IF_P
-			| IMMEDIATE
-			| IMMUTABLE
-			| IMPLICIT_P
-			| INCLUDING
-			| INCREMENT
-			| INDEX
-			| INDEXES
-			| INHERIT
-			| INHERITS
-			| INLINE_P
-			| INPUT_P
-			| INSENSITIVE
 			| INSERT
-			| INSTEAD
-			| INVOKER
-			| ISOLATION
-			| KEY
-			| LABEL
-			| LANGUAGE
-			| LARGE_P
 			| LAST_P
-			| LC_COLLATE_P
-			| LC_CTYPE_P
-			| LEVEL
-			| LISTEN
-			| LOAD
 			| LOCAL
-			| LOCATION
-			| LOCK_P
-			| MAPPING
-			| MATCH
-			| MAXVALUE
 			| MINUTE_P
-			| MINVALUE
-			| MODE
 			| MONTH_P
-			| MOVE
 			| NAME_P
-			| NAMES
 			| NEXT
 			| NO
-			| NOTHING
-			| NOTIFY
 			| NOWAIT
 			| NULLS_P
-			| OBJECT_P
 			| OF
-			| OFF
-			| OIDS
 			| OPERATOR
-			| OPTION
-			| OPTIONS
-			| OWNED
-			| OWNER
-			| PARSER
-			| PARTIAL
 			| PARTITION
 			| PASSING
-			| PASSWORD
-			| PLANS
 			| PRECEDING
-			| PREPARE
-			| PREPARED
 			| PRESERVE
-			| PRIOR
-			| PRIVILEGES
-			| PROCEDURAL
-			| PROCEDURE
-			| QUOTE
 			| RANGE
 			| READ
-			| REASSIGN
-			| RECHECK
 			| RECURSIVE
 			| REF
-			| REINDEX
-			| RELATIVE_P
-			| RELEASE
-			| RENAME
-			| REPEATABLE
-			| REPLACE
-			| REPLICA
-			| RESET
-			| RESTART
-			| RESTRICT
-			| RETURNS
-			| REVOKE
-			| ROLE
-			| ROLLBACK
 			| ROWS
-			| RULE
-			| SAVEPOINT
-			| SCHEMA
-			| SCROLL
-			| SEARCH
 			| SECOND_P
-			| SECURITY
-			| SEQUENCE
-			| SEQUENCES
-			| SERIALIZABLE
-			| SERVER
-			| SESSION
 			| SET
 			| SHARE
-			| SHOW
-			| SIMPLE
-			| STABLE
 			| STANDALONE_P
-			| START
-			| STATEMENT
-			| STATISTICS
-			| STDIN
-			| STDOUT
-			| STORAGE
-			| STRICT_P
 			| STRIP_P
-			| SYSID
-			| SYSTEM_P
-			| TABLES
-			| TABLESPACE
 			| TEMP
-			| TEMPLATE
 			| TEMPORARY
 			| TEXT_P
-			| TRANSACTION
-			| TRIGGER
-			| TRUNCATE
-			| TRUSTED
 			| TYPE_P
 			| UNBOUNDED
-			| UNCOMMITTED
-			| UNENCRYPTED
 			| UNKNOWN
-			| UNLISTEN
 			| UNLOGGED
-			| UNTIL
 			| UPDATE
 			| VACUUM
 			| VALID
@@ -12393,30 +4654,6 @@ makeNullAConst(int location)
 	return (Node *)n;
 }
 
-static Node *
-makeAConst(Value *v, int location)
-{
-	Node *n;
-
-	switch (v->type)
-	{
-		case T_Float:
-			n = makeFloatConst(v->val.str, location);
-			break;
-
-		case T_Integer:
-			n = makeIntConst(v->val.ival, location);
-			break;
-
-		case T_String:
-		default:
-			n = makeStringConst(v->val.str, location);
-			break;
-	}
-
-	return n;
-}
-
 /* makeBoolAConst()
  * Create an A_Const string node and put it inside a boolean cast.
  */
@@ -12521,40 +4758,6 @@ check_indirection(List *indirection, core_yyscan_t yyscanner)
 	return indirection;
 }
 
-/* extractArgTypes()
- * Given a list of FunctionParameter nodes, extract a list of just the
- * argument types (TypeNames) for input parameters only.  This is what
- * is needed to look up an existing function, which is what is wanted by
- * the productions that use this call.
- */
-static List *
-extractArgTypes(List *parameters)
-{
-	List	   *result = NIL;
-	ListCell   *i;
-
-	foreach(i, parameters)
-	{
-		FunctionParameter *p = (FunctionParameter *) lfirst(i);
-
-		if (p->mode != FUNC_PARAM_OUT && p->mode != FUNC_PARAM_TABLE)
-			result = lappend(result, p->argType);
-	}
-	return result;
-}
-
-/* findLeftmostSelect()
- * Find the leftmost component SelectStmt in a set-operation parsetree.
- */
-static SelectStmt *
-findLeftmostSelect(SelectStmt *node)
-{
-	while (node && node->op != SETOP_NONE)
-		node = node->larg;
-	Assert(node && IsA(node, SelectStmt) && node->larg == NULL);
-	return node;
-}
-
 /* insertSelectOptions()
  * Insert ORDER BY, etc into an already-constructed SelectStmt.
  *
@@ -12736,135 +4939,6 @@ makeXmlExpr(XmlExprOp op, char *name, List *named_args, List *args,
 	return (Node *) x;
 }
 
-/*
- * Merge the input and output parameters of a table function.
- */
-static List *
-mergeTableFuncParameters(List *func_args, List *columns)
-{
-	ListCell   *lc;
-
-	/* Explicit OUT and INOUT parameters shouldn't be used in this syntax */
-	foreach(lc, func_args)
-	{
-		FunctionParameter *p = (FunctionParameter *) lfirst(lc);
-
-		if (p->mode != FUNC_PARAM_IN && p->mode != FUNC_PARAM_VARIADIC)
-			ereport(ERROR,
-					(errcode(ERRCODE_SYNTAX_ERROR),
-					 errmsg("OUT and INOUT arguments aren't allowed in TABLE functions")));
-	}
-
-	return list_concat(func_args, columns);
-}
-
-/*
- * Determine return type of a TABLE function.  A single result column
- * returns setof that column's type; otherwise return setof record.
- */
-static TypeName *
-TableFuncTypeName(List *columns)
-{
-	TypeName *result;
-
-	if (list_length(columns) == 1)
-	{
-		FunctionParameter *p = (FunctionParameter *) linitial(columns);
-
-		result = (TypeName *) copyObject(p->argType);
-	}
-	else
-		result = SystemTypeName("record");
-
-	result->setof = true;
-
-	return result;
-}
-
-/*
- * Convert a list of (dotted) names to a RangeVar (like
- * makeRangeVarFromNameList, but with position support).  The
- * "AnyName" refers to the any_name production in the grammar.
- */
-static RangeVar *
-makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner)
-{
-	RangeVar *r = makeNode(RangeVar);
-
-	switch (list_length(names))
-	{
-		case 1:
-			r->catalogname = NULL;
-			r->schemaname = NULL;
-			r->relname = strVal(linitial(names));
-			break;
-		case 2:
-			r->catalogname = NULL;
-			r->schemaname = strVal(linitial(names));
-			r->relname = strVal(lsecond(names));
-			break;
-		case 3:
-			r->catalogname = strVal(linitial(names));;
-			r->schemaname = strVal(lsecond(names));
-			r->relname = strVal(lthird(names));
-			break;
-		default:
-			ereport(ERROR,
-					(errcode(ERRCODE_SYNTAX_ERROR),
-					 errmsg("improper qualified name (too many dotted names): %s",
-							NameListToString(names)),
-					 parser_errposition(position)));
-			break;
-	}
-
-	r->relpersistence = RELPERSISTENCE_PERMANENT;
-	r->location = position;
-
-	return r;
-}
-
-/* Separate Constraint nodes from COLLATE clauses in a ColQualList */
-static void
-SplitColQualList(List *qualList,
-				 List **constraintList, CollateClause **collClause,
-				 core_yyscan_t yyscanner)
-{
-	ListCell   *cell;
-	ListCell   *prev;
-	ListCell   *next;
-
-	*collClause = NULL;
-	prev = NULL;
-	for (cell = list_head(qualList); cell; cell = next)
-	{
-		Node   *n = (Node *) lfirst(cell);
-
-		next = lnext(cell);
-		if (IsA(n, Constraint))
-		{
-			/* keep it in list */
-			prev = cell;
-			continue;
-		}
-		if (IsA(n, CollateClause))
-		{
-			CollateClause *c = (CollateClause *) n;
-
-			if (*collClause)
-				ereport(ERROR,
-						(errcode(ERRCODE_SYNTAX_ERROR),
-						 errmsg("multiple COLLATE clauses not allowed"),
-						 parser_errposition(c->location)));
-			*collClause = c;
-		}
-		else
-			elog(ERROR, "unexpected node type %d", (int) n->type);
-		/* remove non-Constraint nodes from qualList */
-		qualList = list_delete_cell(qualList, cell, prev);
-	}
-	*constraintList = qualList;
-}
-
 /* parser_init()
  * Initialize to parse one query string
  */
diff --git a/src/include/parser/kwlist.h b/src/include/parser/kwlist.h
index 12c2faf..2e5e329 100644
--- a/src/include/parser/kwlist.h
+++ b/src/include/parser/kwlist.h
@@ -26,18 +26,7 @@
  */
 
 /* name, value, category */
-PG_KEYWORD("abort", ABORT_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("absolute", ABSOLUTE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("access", ACCESS, UNRESERVED_KEYWORD)
-PG_KEYWORD("action", ACTION, UNRESERVED_KEYWORD)
-PG_KEYWORD("add", ADD_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("admin", ADMIN, UNRESERVED_KEYWORD)
-PG_KEYWORD("after", AFTER, UNRESERVED_KEYWORD)
-PG_KEYWORD("aggregate", AGGREGATE, UNRESERVED_KEYWORD)
 PG_KEYWORD("all", ALL, RESERVED_KEYWORD)
-PG_KEYWORD("also", ALSO, UNRESERVED_KEYWORD)
-PG_KEYWORD("alter", ALTER, UNRESERVED_KEYWORD)
-PG_KEYWORD("always", ALWAYS, UNRESERVED_KEYWORD)
 PG_KEYWORD("analyse", ANALYSE, RESERVED_KEYWORD)		/* British spelling */
 PG_KEYWORD("analyze", ANALYZE, RESERVED_KEYWORD)
 PG_KEYWORD("and", AND, RESERVED_KEYWORD)
@@ -45,15 +34,9 @@ PG_KEYWORD("any", ANY, RESERVED_KEYWORD)
 PG_KEYWORD("array", ARRAY, RESERVED_KEYWORD)
 PG_KEYWORD("as", AS, RESERVED_KEYWORD)
 PG_KEYWORD("asc", ASC, RESERVED_KEYWORD)
-PG_KEYWORD("assertion", ASSERTION, UNRESERVED_KEYWORD)
-PG_KEYWORD("assignment", ASSIGNMENT, UNRESERVED_KEYWORD)
 PG_KEYWORD("asymmetric", ASYMMETRIC, RESERVED_KEYWORD)
 PG_KEYWORD("at", AT, UNRESERVED_KEYWORD)
-PG_KEYWORD("attribute", ATTRIBUTE, UNRESERVED_KEYWORD)
 PG_KEYWORD("authorization", AUTHORIZATION, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("backward", BACKWARD, UNRESERVED_KEYWORD)
-PG_KEYWORD("before", BEFORE, UNRESERVED_KEYWORD)
-PG_KEYWORD("begin", BEGIN_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("between", BETWEEN, COL_NAME_KEYWORD)
 PG_KEYWORD("bigint", BIGINT, COL_NAME_KEYWORD)
 PG_KEYWORD("binary", BINARY, TYPE_FUNC_NAME_KEYWORD)
@@ -61,43 +44,19 @@ PG_KEYWORD("bit", BIT, COL_NAME_KEYWORD)
 PG_KEYWORD("boolean", BOOLEAN_P, COL_NAME_KEYWORD)
 PG_KEYWORD("both", BOTH, RESERVED_KEYWORD)
 PG_KEYWORD("by", BY, UNRESERVED_KEYWORD)
-PG_KEYWORD("cache", CACHE, UNRESERVED_KEYWORD)
-PG_KEYWORD("called", CALLED, UNRESERVED_KEYWORD)
-PG_KEYWORD("cascade", CASCADE, UNRESERVED_KEYWORD)
-PG_KEYWORD("cascaded", CASCADED, UNRESERVED_KEYWORD)
 PG_KEYWORD("case", CASE, RESERVED_KEYWORD)
 PG_KEYWORD("cast", CAST, RESERVED_KEYWORD)
-PG_KEYWORD("catalog", CATALOG_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("chain", CHAIN, UNRESERVED_KEYWORD)
 PG_KEYWORD("char", CHAR_P, COL_NAME_KEYWORD)
 PG_KEYWORD("character", CHARACTER, COL_NAME_KEYWORD)
-PG_KEYWORD("characteristics", CHARACTERISTICS, UNRESERVED_KEYWORD)
 PG_KEYWORD("check", CHECK, RESERVED_KEYWORD)
-PG_KEYWORD("checkpoint", CHECKPOINT, UNRESERVED_KEYWORD)
-PG_KEYWORD("class", CLASS, UNRESERVED_KEYWORD)
-PG_KEYWORD("close", CLOSE, UNRESERVED_KEYWORD)
-PG_KEYWORD("cluster", CLUSTER, UNRESERVED_KEYWORD)
 PG_KEYWORD("coalesce", COALESCE, COL_NAME_KEYWORD)
 PG_KEYWORD("collate", COLLATE, RESERVED_KEYWORD)
-PG_KEYWORD("collation", COLLATION, UNRESERVED_KEYWORD)
 PG_KEYWORD("column", COLUMN, RESERVED_KEYWORD)
-PG_KEYWORD("comment", COMMENT, UNRESERVED_KEYWORD)
-PG_KEYWORD("comments", COMMENTS, UNRESERVED_KEYWORD)
-PG_KEYWORD("commit", COMMIT, UNRESERVED_KEYWORD)
-PG_KEYWORD("committed", COMMITTED, UNRESERVED_KEYWORD)
 PG_KEYWORD("concurrently", CONCURRENTLY, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("configuration", CONFIGURATION, UNRESERVED_KEYWORD)
-PG_KEYWORD("connection", CONNECTION, UNRESERVED_KEYWORD)
 PG_KEYWORD("constraint", CONSTRAINT, RESERVED_KEYWORD)
-PG_KEYWORD("constraints", CONSTRAINTS, UNRESERVED_KEYWORD)
 PG_KEYWORD("content", CONTENT_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("continue", CONTINUE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("conversion", CONVERSION_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("copy", COPY, UNRESERVED_KEYWORD)
-PG_KEYWORD("cost", COST, UNRESERVED_KEYWORD)
 PG_KEYWORD("create", CREATE, RESERVED_KEYWORD)
 PG_KEYWORD("cross", CROSS, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("csv", CSV, UNRESERVED_KEYWORD)
 PG_KEYWORD("current", CURRENT_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("current_catalog", CURRENT_CATALOG, RESERVED_KEYWORD)
 PG_KEYWORD("current_date", CURRENT_DATE, RESERVED_KEYWORD)
@@ -107,136 +66,65 @@ PG_KEYWORD("current_time", CURRENT_TIME, RESERVED_KEYWORD)
 PG_KEYWORD("current_timestamp", CURRENT_TIMESTAMP, RESERVED_KEYWORD)
 PG_KEYWORD("current_user", CURRENT_USER, RESERVED_KEYWORD)
 PG_KEYWORD("cursor", CURSOR, UNRESERVED_KEYWORD)
-PG_KEYWORD("cycle", CYCLE, UNRESERVED_KEYWORD)
-PG_KEYWORD("data", DATA_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("database", DATABASE, UNRESERVED_KEYWORD)
 PG_KEYWORD("day", DAY_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("deallocate", DEALLOCATE, UNRESERVED_KEYWORD)
 PG_KEYWORD("dec", DEC, COL_NAME_KEYWORD)
 PG_KEYWORD("decimal", DECIMAL_P, COL_NAME_KEYWORD)
-PG_KEYWORD("declare", DECLARE, UNRESERVED_KEYWORD)
 PG_KEYWORD("default", DEFAULT, RESERVED_KEYWORD)
-PG_KEYWORD("defaults", DEFAULTS, UNRESERVED_KEYWORD)
 PG_KEYWORD("deferrable", DEFERRABLE, RESERVED_KEYWORD)
-PG_KEYWORD("deferred", DEFERRED, UNRESERVED_KEYWORD)
-PG_KEYWORD("definer", DEFINER, UNRESERVED_KEYWORD)
 PG_KEYWORD("delete", DELETE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("delimiter", DELIMITER, UNRESERVED_KEYWORD)
-PG_KEYWORD("delimiters", DELIMITERS, UNRESERVED_KEYWORD)
 PG_KEYWORD("desc", DESC, RESERVED_KEYWORD)
-PG_KEYWORD("dictionary", DICTIONARY, UNRESERVED_KEYWORD)
-PG_KEYWORD("disable", DISABLE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("discard", DISCARD, UNRESERVED_KEYWORD)
 PG_KEYWORD("distinct", DISTINCT, RESERVED_KEYWORD)
 PG_KEYWORD("do", DO, RESERVED_KEYWORD)
 PG_KEYWORD("document", DOCUMENT_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("domain", DOMAIN_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("double", DOUBLE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("drop", DROP, UNRESERVED_KEYWORD)
-PG_KEYWORD("each", EACH, UNRESERVED_KEYWORD)
 PG_KEYWORD("else", ELSE, RESERVED_KEYWORD)
-PG_KEYWORD("enable", ENABLE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("encoding", ENCODING, UNRESERVED_KEYWORD)
-PG_KEYWORD("encrypted", ENCRYPTED, UNRESERVED_KEYWORD)
 PG_KEYWORD("end", END_P, RESERVED_KEYWORD)
-PG_KEYWORD("enum", ENUM_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("escape", ESCAPE, UNRESERVED_KEYWORD)
 PG_KEYWORD("except", EXCEPT, RESERVED_KEYWORD)
-PG_KEYWORD("exclude", EXCLUDE, UNRESERVED_KEYWORD)
-PG_KEYWORD("excluding", EXCLUDING, UNRESERVED_KEYWORD)
-PG_KEYWORD("exclusive", EXCLUSIVE, UNRESERVED_KEYWORD)
-PG_KEYWORD("execute", EXECUTE, UNRESERVED_KEYWORD)
 PG_KEYWORD("exists", EXISTS, COL_NAME_KEYWORD)
-PG_KEYWORD("explain", EXPLAIN, UNRESERVED_KEYWORD)
-PG_KEYWORD("extension", EXTENSION, UNRESERVED_KEYWORD)
-PG_KEYWORD("external", EXTERNAL, UNRESERVED_KEYWORD)
 PG_KEYWORD("extract", EXTRACT, COL_NAME_KEYWORD)
 PG_KEYWORD("false", FALSE_P, RESERVED_KEYWORD)
-PG_KEYWORD("family", FAMILY, UNRESERVED_KEYWORD)
 PG_KEYWORD("fetch", FETCH, RESERVED_KEYWORD)
 PG_KEYWORD("first", FIRST_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("float", FLOAT_P, COL_NAME_KEYWORD)
 PG_KEYWORD("following", FOLLOWING, UNRESERVED_KEYWORD)
 PG_KEYWORD("for", FOR, RESERVED_KEYWORD)
-PG_KEYWORD("force", FORCE, UNRESERVED_KEYWORD)
 PG_KEYWORD("foreign", FOREIGN, RESERVED_KEYWORD)
-PG_KEYWORD("forward", FORWARD, UNRESERVED_KEYWORD)
 PG_KEYWORD("freeze", FREEZE, TYPE_FUNC_NAME_KEYWORD)
 PG_KEYWORD("from", FROM, RESERVED_KEYWORD)
 PG_KEYWORD("full", FULL, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("function", FUNCTION, UNRESERVED_KEYWORD)
-PG_KEYWORD("functions", FUNCTIONS, UNRESERVED_KEYWORD)
 PG_KEYWORD("global", GLOBAL, UNRESERVED_KEYWORD)
 PG_KEYWORD("grant", GRANT, RESERVED_KEYWORD)
-PG_KEYWORD("granted", GRANTED, UNRESERVED_KEYWORD)
 PG_KEYWORD("greatest", GREATEST, COL_NAME_KEYWORD)
 PG_KEYWORD("group", GROUP_P, RESERVED_KEYWORD)
-PG_KEYWORD("handler", HANDLER, UNRESERVED_KEYWORD)
 PG_KEYWORD("having", HAVING, RESERVED_KEYWORD)
-PG_KEYWORD("header", HEADER_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("hold", HOLD, UNRESERVED_KEYWORD)
 PG_KEYWORD("hour", HOUR_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("identity", IDENTITY_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("if", IF_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("ilike", ILIKE, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("immediate", IMMEDIATE, UNRESERVED_KEYWORD)
-PG_KEYWORD("immutable", IMMUTABLE, UNRESERVED_KEYWORD)
-PG_KEYWORD("implicit", IMPLICIT_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("in", IN_P, RESERVED_KEYWORD)
-PG_KEYWORD("including", INCLUDING, UNRESERVED_KEYWORD)
-PG_KEYWORD("increment", INCREMENT, UNRESERVED_KEYWORD)
-PG_KEYWORD("index", INDEX, UNRESERVED_KEYWORD)
-PG_KEYWORD("indexes", INDEXES, UNRESERVED_KEYWORD)
-PG_KEYWORD("inherit", INHERIT, UNRESERVED_KEYWORD)
-PG_KEYWORD("inherits", INHERITS, UNRESERVED_KEYWORD)
 PG_KEYWORD("initially", INITIALLY, RESERVED_KEYWORD)
-PG_KEYWORD("inline", INLINE_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("inner", INNER_P, TYPE_FUNC_NAME_KEYWORD)
 PG_KEYWORD("inout", INOUT, COL_NAME_KEYWORD)
-PG_KEYWORD("input", INPUT_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("insensitive", INSENSITIVE, UNRESERVED_KEYWORD)
 PG_KEYWORD("insert", INSERT, UNRESERVED_KEYWORD)
-PG_KEYWORD("instead", INSTEAD, UNRESERVED_KEYWORD)
 PG_KEYWORD("int", INT_P, COL_NAME_KEYWORD)
 PG_KEYWORD("integer", INTEGER, COL_NAME_KEYWORD)
 PG_KEYWORD("intersect", INTERSECT, RESERVED_KEYWORD)
 PG_KEYWORD("interval", INTERVAL, COL_NAME_KEYWORD)
 PG_KEYWORD("into", INTO, RESERVED_KEYWORD)
-PG_KEYWORD("invoker", INVOKER, UNRESERVED_KEYWORD)
 PG_KEYWORD("is", IS, TYPE_FUNC_NAME_KEYWORD)
 PG_KEYWORD("isnull", ISNULL, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("isolation", ISOLATION, UNRESERVED_KEYWORD)
 PG_KEYWORD("join", JOIN, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("key", KEY, UNRESERVED_KEYWORD)
-PG_KEYWORD("label", LABEL, UNRESERVED_KEYWORD)
-PG_KEYWORD("language", LANGUAGE, UNRESERVED_KEYWORD)
-PG_KEYWORD("large", LARGE_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("last", LAST_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("lc_collate", LC_COLLATE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("lc_ctype", LC_CTYPE_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("leading", LEADING, RESERVED_KEYWORD)
 PG_KEYWORD("least", LEAST, COL_NAME_KEYWORD)
 PG_KEYWORD("left", LEFT, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("level", LEVEL, UNRESERVED_KEYWORD)
 PG_KEYWORD("like", LIKE, TYPE_FUNC_NAME_KEYWORD)
 PG_KEYWORD("limit", LIMIT, RESERVED_KEYWORD)
-PG_KEYWORD("listen", LISTEN, UNRESERVED_KEYWORD)
-PG_KEYWORD("load", LOAD, UNRESERVED_KEYWORD)
 PG_KEYWORD("local", LOCAL, UNRESERVED_KEYWORD)
 PG_KEYWORD("localtime", LOCALTIME, RESERVED_KEYWORD)
 PG_KEYWORD("localtimestamp", LOCALTIMESTAMP, RESERVED_KEYWORD)
-PG_KEYWORD("location", LOCATION, UNRESERVED_KEYWORD)
-PG_KEYWORD("lock", LOCK_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("mapping", MAPPING, UNRESERVED_KEYWORD)
-PG_KEYWORD("match", MATCH, UNRESERVED_KEYWORD)
-PG_KEYWORD("maxvalue", MAXVALUE, UNRESERVED_KEYWORD)
 PG_KEYWORD("minute", MINUTE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("minvalue", MINVALUE, UNRESERVED_KEYWORD)
-PG_KEYWORD("mode", MODE, UNRESERVED_KEYWORD)
 PG_KEYWORD("month", MONTH_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("move", MOVE, UNRESERVED_KEYWORD)
 PG_KEYWORD("name", NAME_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("names", NAMES, UNRESERVED_KEYWORD)
 PG_KEYWORD("national", NATIONAL, COL_NAME_KEYWORD)
 PG_KEYWORD("natural", NATURAL, TYPE_FUNC_NAME_KEYWORD)
 PG_KEYWORD("nchar", NCHAR, COL_NAME_KEYWORD)
@@ -244,24 +132,17 @@ PG_KEYWORD("next", NEXT, UNRESERVED_KEYWORD)
 PG_KEYWORD("no", NO, UNRESERVED_KEYWORD)
 PG_KEYWORD("none", NONE, COL_NAME_KEYWORD)
 PG_KEYWORD("not", NOT, RESERVED_KEYWORD)
-PG_KEYWORD("nothing", NOTHING, UNRESERVED_KEYWORD)
-PG_KEYWORD("notify", NOTIFY, UNRESERVED_KEYWORD)
 PG_KEYWORD("notnull", NOTNULL, TYPE_FUNC_NAME_KEYWORD)
 PG_KEYWORD("nowait", NOWAIT, UNRESERVED_KEYWORD)
 PG_KEYWORD("null", NULL_P, RESERVED_KEYWORD)
 PG_KEYWORD("nullif", NULLIF, COL_NAME_KEYWORD)
 PG_KEYWORD("nulls", NULLS_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("numeric", NUMERIC, COL_NAME_KEYWORD)
-PG_KEYWORD("object", OBJECT_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("of", OF, UNRESERVED_KEYWORD)
-PG_KEYWORD("off", OFF, UNRESERVED_KEYWORD)
 PG_KEYWORD("offset", OFFSET, RESERVED_KEYWORD)
-PG_KEYWORD("oids", OIDS, UNRESERVED_KEYWORD)
 PG_KEYWORD("on", ON, RESERVED_KEYWORD)
 PG_KEYWORD("only", ONLY, RESERVED_KEYWORD)
 PG_KEYWORD("operator", OPERATOR, UNRESERVED_KEYWORD)
-PG_KEYWORD("option", OPTION, UNRESERVED_KEYWORD)
-PG_KEYWORD("options", OPTIONS, UNRESERVED_KEYWORD)
 PG_KEYWORD("or", OR, RESERVED_KEYWORD)
 PG_KEYWORD("order", ORDER, RESERVED_KEYWORD)
 PG_KEYWORD("out", OUT_P, COL_NAME_KEYWORD)
@@ -269,94 +150,39 @@ PG_KEYWORD("outer", OUTER_P, TYPE_FUNC_NAME_KEYWORD)
 PG_KEYWORD("over", OVER, TYPE_FUNC_NAME_KEYWORD)
 PG_KEYWORD("overlaps", OVERLAPS, TYPE_FUNC_NAME_KEYWORD)
 PG_KEYWORD("overlay", OVERLAY, COL_NAME_KEYWORD)
-PG_KEYWORD("owned", OWNED, UNRESERVED_KEYWORD)
-PG_KEYWORD("owner", OWNER, UNRESERVED_KEYWORD)
-PG_KEYWORD("parser", PARSER, UNRESERVED_KEYWORD)
-PG_KEYWORD("partial", PARTIAL, UNRESERVED_KEYWORD)
 PG_KEYWORD("partition", PARTITION, UNRESERVED_KEYWORD)
 PG_KEYWORD("passing", PASSING, UNRESERVED_KEYWORD)
-PG_KEYWORD("password", PASSWORD, UNRESERVED_KEYWORD)
 PG_KEYWORD("placing", PLACING, RESERVED_KEYWORD)
-PG_KEYWORD("plans", PLANS, UNRESERVED_KEYWORD)
 PG_KEYWORD("position", POSITION, COL_NAME_KEYWORD)
 PG_KEYWORD("preceding", PRECEDING, UNRESERVED_KEYWORD)
 PG_KEYWORD("precision", PRECISION, COL_NAME_KEYWORD)
-PG_KEYWORD("prepare", PREPARE, UNRESERVED_KEYWORD)
-PG_KEYWORD("prepared", PREPARED, UNRESERVED_KEYWORD)
 PG_KEYWORD("preserve", PRESERVE, UNRESERVED_KEYWORD)
 PG_KEYWORD("primary", PRIMARY, RESERVED_KEYWORD)
-PG_KEYWORD("prior", PRIOR, UNRESERVED_KEYWORD)
-PG_KEYWORD("privileges", PRIVILEGES, UNRESERVED_KEYWORD)
-PG_KEYWORD("procedural", PROCEDURAL, UNRESERVED_KEYWORD)
-PG_KEYWORD("procedure", PROCEDURE, UNRESERVED_KEYWORD)
-PG_KEYWORD("quote", QUOTE, UNRESERVED_KEYWORD)
 PG_KEYWORD("range", RANGE, UNRESERVED_KEYWORD)
 PG_KEYWORD("read", READ, UNRESERVED_KEYWORD)
 PG_KEYWORD("real", REAL, COL_NAME_KEYWORD)
-PG_KEYWORD("reassign", REASSIGN, UNRESERVED_KEYWORD)
-PG_KEYWORD("recheck", RECHECK, UNRESERVED_KEYWORD)
 PG_KEYWORD("recursive", RECURSIVE, UNRESERVED_KEYWORD)
 PG_KEYWORD("ref", REF, UNRESERVED_KEYWORD)
 PG_KEYWORD("references", REFERENCES, RESERVED_KEYWORD)
-PG_KEYWORD("reindex", REINDEX, UNRESERVED_KEYWORD)
-PG_KEYWORD("relative", RELATIVE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("release", RELEASE, UNRESERVED_KEYWORD)
-PG_KEYWORD("rename", RENAME, UNRESERVED_KEYWORD)
-PG_KEYWORD("repeatable", REPEATABLE, UNRESERVED_KEYWORD)
-PG_KEYWORD("replace", REPLACE, UNRESERVED_KEYWORD)
-PG_KEYWORD("replica", REPLICA, UNRESERVED_KEYWORD)
-PG_KEYWORD("reset", RESET, UNRESERVED_KEYWORD)
-PG_KEYWORD("restart", RESTART, UNRESERVED_KEYWORD)
-PG_KEYWORD("restrict", RESTRICT, UNRESERVED_KEYWORD)
 PG_KEYWORD("returning", RETURNING, RESERVED_KEYWORD)
-PG_KEYWORD("returns", RETURNS, UNRESERVED_KEYWORD)
-PG_KEYWORD("revoke", REVOKE, UNRESERVED_KEYWORD)
 PG_KEYWORD("right", RIGHT, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("role", ROLE, UNRESERVED_KEYWORD)
-PG_KEYWORD("rollback", ROLLBACK, UNRESERVED_KEYWORD)
 PG_KEYWORD("row", ROW, COL_NAME_KEYWORD)
 PG_KEYWORD("rows", ROWS, UNRESERVED_KEYWORD)
-PG_KEYWORD("rule", RULE, UNRESERVED_KEYWORD)
-PG_KEYWORD("savepoint", SAVEPOINT, UNRESERVED_KEYWORD)
-PG_KEYWORD("schema", SCHEMA, UNRESERVED_KEYWORD)
-PG_KEYWORD("scroll", SCROLL, UNRESERVED_KEYWORD)
-PG_KEYWORD("search", SEARCH, UNRESERVED_KEYWORD)
 PG_KEYWORD("second", SECOND_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("security", SECURITY, UNRESERVED_KEYWORD)
 PG_KEYWORD("select", SELECT, RESERVED_KEYWORD)
-PG_KEYWORD("sequence", SEQUENCE, UNRESERVED_KEYWORD)
-PG_KEYWORD("sequences", SEQUENCES, UNRESERVED_KEYWORD)
-PG_KEYWORD("serializable", SERIALIZABLE, UNRESERVED_KEYWORD)
-PG_KEYWORD("server", SERVER, UNRESERVED_KEYWORD)
-PG_KEYWORD("session", SESSION, UNRESERVED_KEYWORD)
 PG_KEYWORD("session_user", SESSION_USER, RESERVED_KEYWORD)
 PG_KEYWORD("set", SET, UNRESERVED_KEYWORD)
 PG_KEYWORD("setof", SETOF, COL_NAME_KEYWORD)
 PG_KEYWORD("share", SHARE, UNRESERVED_KEYWORD)
-PG_KEYWORD("show", SHOW, UNRESERVED_KEYWORD)
 PG_KEYWORD("similar", SIMILAR, TYPE_FUNC_NAME_KEYWORD)
-PG_KEYWORD("simple", SIMPLE, UNRESERVED_KEYWORD)
 PG_KEYWORD("smallint", SMALLINT, COL_NAME_KEYWORD)
 PG_KEYWORD("some", SOME, RESERVED_KEYWORD)
-PG_KEYWORD("stable", STABLE, UNRESERVED_KEYWORD)
 PG_KEYWORD("standalone", STANDALONE_P, UNRESERVED_KEYWORD)
-PG_KEYWORD("start", START, UNRESERVED_KEYWORD)
-PG_KEYWORD("statement", STATEMENT, UNRESERVED_KEYWORD)
-PG_KEYWORD("statistics", STATISTICS, UNRESERVED_KEYWORD)
-PG_KEYWORD("stdin", STDIN, UNRESERVED_KEYWORD)
-PG_KEYWORD("stdout", STDOUT, UNRESERVED_KEYWORD)
-PG_KEYWORD("storage", STORAGE, UNRESERVED_KEYWORD)
-PG_KEYWORD("strict", STRICT_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("strip", STRIP_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("substring", SUBSTRING, COL_NAME_KEYWORD)
 PG_KEYWORD("symmetric", SYMMETRIC, RESERVED_KEYWORD)
-PG_KEYWORD("sysid", SYSID, UNRESERVED_KEYWORD)
-PG_KEYWORD("system", SYSTEM_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("table", TABLE, RESERVED_KEYWORD)
-PG_KEYWORD("tables", TABLES, UNRESERVED_KEYWORD)
-PG_KEYWORD("tablespace", TABLESPACE, UNRESERVED_KEYWORD)
 PG_KEYWORD("temp", TEMP, UNRESERVED_KEYWORD)
-PG_KEYWORD("template", TEMPLATE, UNRESERVED_KEYWORD)
 PG_KEYWORD("temporary", TEMPORARY, UNRESERVED_KEYWORD)
 PG_KEYWORD("text", TEXT_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("then", THEN, RESERVED_KEYWORD)
@@ -364,23 +190,15 @@ PG_KEYWORD("time", TIME, COL_NAME_KEYWORD)
 PG_KEYWORD("timestamp", TIMESTAMP, COL_NAME_KEYWORD)
 PG_KEYWORD("to", TO, RESERVED_KEYWORD)
 PG_KEYWORD("trailing", TRAILING, RESERVED_KEYWORD)
-PG_KEYWORD("transaction", TRANSACTION, UNRESERVED_KEYWORD)
 PG_KEYWORD("treat", TREAT, COL_NAME_KEYWORD)
-PG_KEYWORD("trigger", TRIGGER, UNRESERVED_KEYWORD)
 PG_KEYWORD("trim", TRIM, COL_NAME_KEYWORD)
 PG_KEYWORD("true", TRUE_P, RESERVED_KEYWORD)
-PG_KEYWORD("truncate", TRUNCATE, UNRESERVED_KEYWORD)
-PG_KEYWORD("trusted", TRUSTED, UNRESERVED_KEYWORD)
 PG_KEYWORD("type", TYPE_P, UNRESERVED_KEYWORD)
 PG_KEYWORD("unbounded", UNBOUNDED, UNRESERVED_KEYWORD)
-PG_KEYWORD("uncommitted", UNCOMMITTED, UNRESERVED_KEYWORD)
-PG_KEYWORD("unencrypted", UNENCRYPTED, UNRESERVED_KEYWORD)
 PG_KEYWORD("union", UNION, RESERVED_KEYWORD)
 PG_KEYWORD("unique", UNIQUE, RESERVED_KEYWORD)
 PG_KEYWORD("unknown", UNKNOWN, UNRESERVED_KEYWORD)
-PG_KEYWORD("unlisten", UNLISTEN, UNRESERVED_KEYWORD)
 PG_KEYWORD("unlogged", UNLOGGED, UNRESERVED_KEYWORD)
-PG_KEYWORD("until", UNTIL, UNRESERVED_KEYWORD)
 PG_KEYWORD("update", UPDATE, UNRESERVED_KEYWORD)
 PG_KEYWORD("user", USER, RESERVED_KEYWORD)
 PG_KEYWORD("using", USING, RESERVED_KEYWORD)
