From 01c66cf13a43aaee3fe89e65d90936cc6dd5856a Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Sat, 12 Nov 2016 12:00:00 -0500
Subject: [PATCH 3/6] Remove objname/objargs split for referring to objects

In simpler times, it might have worked to refer to all kinds of objects
by a list of name components and an optional argument list.  But this
doesn't work for all objects, which has resulted in a collection of
hacks to place various other nodes types into these fields, which have
to be unpacked at the other end.  This makes it also weird to represent
lists of such things in the grammar, because they would have to be lists
of singleton lists, to make the unpacking work consistently.  The other
problem is that keeping separate name and args fields makes it awkward
to deal with lists of functions.

Change that by dropping the objargs field and have objname be a generic
Node, which can then be flexibly assigned and managed using the normal
Node mechanisms.  In many cases it will still be a List of names, in
some cases it will be a string Value, for types it will be the existing
Typename, for functions it will now use the existing FuncWithArgs node
type.  Some of the more obscure object types still use somewhat
arbitrary nested lists.
---
 src/backend/catalog/objectaddress.c          | 330 +++++++++++---------
 src/backend/commands/alter.c                 |  29 +-
 src/backend/commands/comment.c               |  11 +-
 src/backend/commands/dropcmds.c              | 151 +++++-----
 src/backend/commands/extension.c             |  13 +-
 src/backend/commands/seclabel.c              |   4 +-
 src/backend/commands/tablecmds.c             |  10 +-
 src/backend/commands/typecmds.c              |   2 +-
 src/backend/nodes/copyfuncs.c                |   8 -
 src/backend/nodes/equalfuncs.c               |   8 -
 src/backend/parser/gram.y                    | 431 +++++++++++++--------------
 src/backend/parser/parse_utilcmd.c           |  14 +-
 src/include/catalog/objectaddress.h          |   8 +-
 src/include/commands/extension.h             |   2 +-
 src/include/nodes/parsenodes.h               |  24 +-
 src/test/regress/expected/event_trigger.out  |   3 -
 src/test/regress/expected/object_address.out |  20 +-
 src/test/regress/sql/event_trigger.sql       |   3 -
 18 files changed, 518 insertions(+), 553 deletions(-)

diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index bb4b080b00..e444604071 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -667,7 +667,7 @@ const ObjectAddress InvalidObjectAddress =
 };
 
 static ObjectAddress get_object_address_unqualified(ObjectType objtype,
-							   List *qualname, bool missing_ok);
+							   Value *strval, bool missing_ok);
 static ObjectAddress get_relation_by_qualified_name(ObjectType objtype,
 							   List *objname, Relation *relp,
 							   LOCKMODE lockmode, bool missing_ok);
@@ -680,15 +680,15 @@ static ObjectAddress get_object_address_attrdef(ObjectType objtype,
 						   List *objname, Relation *relp, LOCKMODE lockmode,
 						   bool missing_ok);
 static ObjectAddress get_object_address_type(ObjectType objtype,
-						ListCell *typecell, bool missing_ok);
+						TypeName *typename, bool missing_ok);
 static ObjectAddress get_object_address_opcf(ObjectType objtype, List *objname,
 						bool missing_ok);
 static ObjectAddress get_object_address_opf_member(ObjectType objtype,
-							  List *objname, List *objargs, bool missing_ok);
+							  List *objname, bool missing_ok);
 
 static ObjectAddress get_object_address_usermapping(List *objname,
-							   List *objargs, bool missing_ok);
-static ObjectAddress get_object_address_defacl(List *objname, List *objargs,
+							   bool missing_ok);
+static ObjectAddress get_object_address_defacl(List *objname,
 						  bool missing_ok);
 static const ObjectPropertyType *get_object_property_data(Oid class_id);
 
@@ -733,7 +733,7 @@ static void getRelationIdentity(StringInfo buffer, Oid relid, List **objname);
  * better to add some support for that in this function.
  */
 ObjectAddress
-get_object_address(ObjectType objtype, List *objname, List *objargs,
+get_object_address(ObjectType objtype, Node *objname,
 				   Relation *relp, LOCKMODE lockmode, bool missing_ok)
 {
 	ObjectAddress address;
@@ -763,19 +763,19 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 			case OBJECT_MATVIEW:
 			case OBJECT_FOREIGN_TABLE:
 				address =
-					get_relation_by_qualified_name(objtype, objname,
+					get_relation_by_qualified_name(objtype, (List *) objname,
 												   &relation, lockmode,
 												   missing_ok);
 				break;
 			case OBJECT_COLUMN:
 				address =
-					get_object_address_attribute(objtype, objname,
+					get_object_address_attribute(objtype, (List *) objname,
 												 &relation, lockmode,
 												 missing_ok);
 				break;
 			case OBJECT_DEFAULT:
 				address =
-					get_object_address_attrdef(objtype, objname,
+					get_object_address_attrdef(objtype, (List *) objname,
 											   &relation, lockmode,
 											   missing_ok);
 				break;
@@ -783,7 +783,7 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 			case OBJECT_TRIGGER:
 			case OBJECT_TABCONSTRAINT:
 			case OBJECT_POLICY:
-				address = get_object_address_relobject(objtype, objname,
+				address = get_object_address_relobject(objtype, (List *) objname,
 													   &relation, missing_ok);
 				break;
 			case OBJECT_DOMCONSTRAINT:
@@ -792,8 +792,8 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 					char	   *constrname;
 
 					domaddr = get_object_address_type(OBJECT_DOMAIN,
-											 list_head(objname), missing_ok);
-					constrname = strVal(linitial(objargs));
+													  (TypeName *) linitial((List *) objname), missing_ok);
+					constrname = strVal(lsecond((List *) objname));
 
 					address.classId = ConstraintRelationId;
 					address.objectId = get_domain_constraint_oid(domaddr.objectId,
@@ -813,57 +813,64 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 			case OBJECT_EVENT_TRIGGER:
 			case OBJECT_ACCESS_METHOD:
 				address = get_object_address_unqualified(objtype,
-														 objname, missing_ok);
+														 (Value *) objname, missing_ok);
 				break;
 			case OBJECT_TYPE:
 			case OBJECT_DOMAIN:
-				address = get_object_address_type(objtype, list_head(objname), missing_ok);
+				address = get_object_address_type(objtype, (TypeName *) objname, missing_ok);
 				break;
 			case OBJECT_AGGREGATE:
-				address.classId = ProcedureRelationId;
-				address.objectId =
-					LookupAggNameTypeNames(objname, objargs, missing_ok);
-				address.objectSubId = 0;
-				break;
+				{
+					FuncWithArgs *fwa = (FuncWithArgs *) objname;
+					address.classId = ProcedureRelationId;
+					address.objectId =
+						LookupAggNameTypeNames(fwa->funcname, fwa->funcargs, missing_ok);
+					address.objectSubId = 0;
+					break;
+				}
 			case OBJECT_FUNCTION:
-				address.classId = ProcedureRelationId;
-				address.objectId =
-					LookupFuncNameTypeNames(objname, objargs, missing_ok);
-				address.objectSubId = 0;
-				break;
+				{
+					FuncWithArgs *fwa = (FuncWithArgs *) objname;
+					address.classId = ProcedureRelationId;
+					address.objectId =
+						LookupFuncNameTypeNames(fwa->funcname, fwa->funcargs, missing_ok);
+					address.objectSubId = 0;
+					break;
+				}
 			case OBJECT_OPERATOR:
-				Assert(list_length(objargs) == 2);
-				address.classId = OperatorRelationId;
-				address.objectId =
-					LookupOperNameTypeNames(NULL, objname,
-											(TypeName *) linitial(objargs),
-											(TypeName *) lsecond(objargs),
-											missing_ok, -1);
-				address.objectSubId = 0;
-				break;
+				{
+					FuncWithArgs *fwa = (FuncWithArgs *) objname;
+					address.classId = OperatorRelationId;
+					Assert(list_length(fwa->funcargs) == 2);
+					address.objectId =
+						LookupOperNameTypeNames(NULL, fwa->funcname,
+												(TypeName *) linitial(fwa->funcargs),
+												(TypeName *) lsecond(fwa->funcargs),
+												missing_ok, -1);
+					address.objectSubId = 0;
+					break;
+				}
 			case OBJECT_COLLATION:
 				address.classId = CollationRelationId;
-				address.objectId = get_collation_oid(objname, missing_ok);
+				address.objectId = get_collation_oid((List *) objname, missing_ok);
 				address.objectSubId = 0;
 				break;
 			case OBJECT_CONVERSION:
 				address.classId = ConversionRelationId;
-				address.objectId = get_conversion_oid(objname, missing_ok);
+				address.objectId = get_conversion_oid((List *) objname, missing_ok);
 				address.objectSubId = 0;
 				break;
 			case OBJECT_OPCLASS:
 			case OBJECT_OPFAMILY:
-				address = get_object_address_opcf(objtype, objname, missing_ok);
+				address = get_object_address_opcf(objtype, (List *) objname, missing_ok);
 				break;
 			case OBJECT_AMOP:
 			case OBJECT_AMPROC:
-				address = get_object_address_opf_member(objtype, objname,
-														objargs, missing_ok);
+				address = get_object_address_opf_member(objtype, (List *) objname, missing_ok);
 				break;
 			case OBJECT_LARGEOBJECT:
-				Assert(list_length(objname) == 1);
 				address.classId = LargeObjectRelationId;
-				address.objectId = oidparse(linitial(objname));
+				address.objectId = oidparse(objname);
 				address.objectSubId = 0;
 				if (!LargeObjectExists(address.objectId))
 				{
@@ -876,8 +883,8 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 				break;
 			case OBJECT_CAST:
 				{
-					TypeName   *sourcetype = (TypeName *) linitial(objname);
-					TypeName   *targettype = (TypeName *) linitial(objargs);
+					TypeName   *sourcetype = (TypeName *) linitial((List *) objname);
+					TypeName   *targettype = (TypeName *) lsecond((List *) objname);
 					Oid			sourcetypeid;
 					Oid			targettypeid;
 
@@ -891,8 +898,8 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 				break;
 			case OBJECT_TRANSFORM:
 				{
-					TypeName   *typename = (TypeName *) linitial(objname);
-					char	   *langname = strVal(linitial(objargs));
+					TypeName   *typename = (TypeName *) linitial((List *) objname);
+					char	   *langname = strVal(lsecond((List *) objname));
 					Oid			type_id = LookupTypeNameOid(NULL, typename, missing_ok);
 					Oid			lang_id = get_language_oid(langname, missing_ok);
 
@@ -904,30 +911,30 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 				break;
 			case OBJECT_TSPARSER:
 				address.classId = TSParserRelationId;
-				address.objectId = get_ts_parser_oid(objname, missing_ok);
+				address.objectId = get_ts_parser_oid((List *) objname, missing_ok);
 				address.objectSubId = 0;
 				break;
 			case OBJECT_TSDICTIONARY:
 				address.classId = TSDictionaryRelationId;
-				address.objectId = get_ts_dict_oid(objname, missing_ok);
+				address.objectId = get_ts_dict_oid((List *) objname, missing_ok);
 				address.objectSubId = 0;
 				break;
 			case OBJECT_TSTEMPLATE:
 				address.classId = TSTemplateRelationId;
-				address.objectId = get_ts_template_oid(objname, missing_ok);
+				address.objectId = get_ts_template_oid((List *) objname, missing_ok);
 				address.objectSubId = 0;
 				break;
 			case OBJECT_TSCONFIGURATION:
 				address.classId = TSConfigRelationId;
-				address.objectId = get_ts_config_oid(objname, missing_ok);
+				address.objectId = get_ts_config_oid((List *) objname, missing_ok);
 				address.objectSubId = 0;
 				break;
 			case OBJECT_USER_MAPPING:
-				address = get_object_address_usermapping(objname, objargs,
+				address = get_object_address_usermapping((List *) objname,
 														 missing_ok);
 				break;
 			case OBJECT_DEFACL:
-				address = get_object_address_defacl(objname, objargs,
+				address = get_object_address_defacl((List *) objname,
 													missing_ok);
 				break;
 			default:
@@ -1024,7 +1031,7 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
  */
 ObjectAddress
 get_object_address_rv(ObjectType objtype, RangeVar *rel, List *objname,
-					  List *objargs, Relation *relp, LOCKMODE lockmode,
+					  Relation *relp, LOCKMODE lockmode,
 					  bool missing_ok)
 {
 	if (rel)
@@ -1036,7 +1043,7 @@ get_object_address_rv(ObjectType objtype, RangeVar *rel, List *objname,
 			objname = lcons(makeString(rel->catalogname), objname);
 	}
 
-	return get_object_address(objtype, objname, objargs,
+	return get_object_address(objtype, (Node *) objname,
 							  relp, lockmode, missing_ok);
 }
 
@@ -1046,62 +1053,12 @@ get_object_address_rv(ObjectType objtype, RangeVar *rel, List *objname,
  */
 static ObjectAddress
 get_object_address_unqualified(ObjectType objtype,
-							   List *qualname, bool missing_ok)
+							   Value *strval, bool missing_ok)
 {
 	const char *name;
 	ObjectAddress address;
 
-	/*
-	 * The types of names handled by this function are not permitted to be
-	 * schema-qualified or catalog-qualified.
-	 */
-	if (list_length(qualname) != 1)
-	{
-		const char *msg;
-
-		switch (objtype)
-		{
-			case OBJECT_ACCESS_METHOD:
-				msg = gettext_noop("access method name cannot be qualified");
-				break;
-			case OBJECT_DATABASE:
-				msg = gettext_noop("database name cannot be qualified");
-				break;
-			case OBJECT_EXTENSION:
-				msg = gettext_noop("extension name cannot be qualified");
-				break;
-			case OBJECT_TABLESPACE:
-				msg = gettext_noop("tablespace name cannot be qualified");
-				break;
-			case OBJECT_ROLE:
-				msg = gettext_noop("role name cannot be qualified");
-				break;
-			case OBJECT_SCHEMA:
-				msg = gettext_noop("schema name cannot be qualified");
-				break;
-			case OBJECT_LANGUAGE:
-				msg = gettext_noop("language name cannot be qualified");
-				break;
-			case OBJECT_FDW:
-				msg = gettext_noop("foreign-data wrapper name cannot be qualified");
-				break;
-			case OBJECT_FOREIGN_SERVER:
-				msg = gettext_noop("server name cannot be qualified");
-				break;
-			case OBJECT_EVENT_TRIGGER:
-				msg = gettext_noop("event trigger name cannot be qualified");
-				break;
-			default:
-				elog(ERROR, "unrecognized objtype: %d", (int) objtype);
-				msg = NULL;		/* placate compiler */
-		}
-		ereport(ERROR,
-				(errcode(ERRCODE_SYNTAX_ERROR),
-				 errmsg("%s", _(msg))));
-	}
-
-	/* Format is valid, extract the actual name. */
-	name = strVal(linitial(qualname));
+	name = strVal(strval);
 
 	/* Translate name to OID. */
 	switch (objtype)
@@ -1492,14 +1449,11 @@ get_object_address_attrdef(ObjectType objtype, List *objname,
  * Find the ObjectAddress for a type or domain
  */
 static ObjectAddress
-get_object_address_type(ObjectType objtype, ListCell *typecell, bool missing_ok)
+get_object_address_type(ObjectType objtype, TypeName *typename, bool missing_ok)
 {
 	ObjectAddress address;
-	TypeName   *typename;
 	Type		tup;
 
-	typename = (TypeName *) lfirst(typecell);
-
 	address.classId = TypeRelationId;
 	address.objectId = InvalidOid;
 	address.objectSubId = 0;
@@ -1573,7 +1527,7 @@ get_object_address_opcf(ObjectType objtype, List *objname, bool missing_ok)
  */
 static ObjectAddress
 get_object_address_opf_member(ObjectType objtype,
-							  List *objname, List *objargs, bool missing_ok)
+							  List *objname, bool missing_ok)
 {
 	ObjectAddress famaddr;
 	ObjectAddress address;
@@ -1589,20 +1543,20 @@ get_object_address_opf_member(ObjectType objtype,
 	 * number.  We need to strip that out before getting the opclass/family
 	 * address.  The rest can be used directly by get_object_address_opcf().
 	 */
-	membernum = atoi(strVal(llast(objname)));
-	copy = list_truncate(list_copy(objname), list_length(objname) - 1);
+	membernum = atoi(strVal(llast(linitial(objname))));
+	copy = list_truncate(list_copy(linitial(objname)), list_length(linitial(objname)) - 1);
 
 	/* no missing_ok support here */
 	famaddr = get_object_address_opcf(OBJECT_OPFAMILY, copy, false);
 
 	/* find out left/right type names and OIDs */
 	i = 0;
-	foreach(cell, objargs)
+	foreach(cell, lsecond(objname))
 	{
 		ObjectAddress typaddr;
 
 		typenames[i] = strVal(lfirst(cell));
-		typaddr = get_object_address_type(OBJECT_TYPE, cell, missing_ok);
+		typaddr = get_object_address_type(OBJECT_TYPE, (TypeName *) lfirst(cell), missing_ok);
 		typeoids[i] = typaddr.objectId;
 		if (++i >= 2)
 			break;
@@ -1678,7 +1632,7 @@ get_object_address_opf_member(ObjectType objtype,
  * Find the ObjectAddress for a user mapping.
  */
 static ObjectAddress
-get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
+get_object_address_usermapping(List *objname, bool missing_ok)
 {
 	ObjectAddress address;
 	Oid			userid;
@@ -1691,7 +1645,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
 
 	/* fetch string names from input lists, for error messages */
 	username = strVal(linitial(objname));
-	servername = strVal(linitial(objargs));
+	servername = strVal(lsecond(objname));
 
 	/* look up pg_authid OID of mapped user; InvalidOid if PUBLIC */
 	if (strcmp(username, "public") == 0)
@@ -1747,7 +1701,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
  * Find the ObjectAddress for a default ACL.
  */
 static ObjectAddress
-get_object_address_defacl(List *objname, List *objargs, bool missing_ok)
+get_object_address_defacl(List *objname, bool missing_ok)
 {
 	HeapTuple	tp;
 	Oid			userid;
@@ -1764,9 +1718,9 @@ get_object_address_defacl(List *objname, List *objargs, bool missing_ok)
 	 * First figure out the textual attributes so that they can be used for
 	 * error reporting.
 	 */
-	username = strVal(linitial(objname));
-	if (list_length(objname) >= 2)
-		schema = (char *) strVal(lsecond(objname));
+	username = strVal(lsecond(objname));
+	if (list_length(objname) >= 3)
+		schema = (char *) strVal(lthird(objname));
 	else
 		schema = NULL;
 
@@ -1774,7 +1728,7 @@ get_object_address_defacl(List *objname, List *objargs, bool missing_ok)
 	 * Decode defaclobjtype.  Only first char is considered; the rest of the
 	 * string, if any, is blissfully ignored.
 	 */
-	objtype = ((char *) strVal(linitial(objargs)))[0];
+	objtype = ((char *) strVal(linitial(objname)))[0];
 	switch (objtype)
 	{
 		case DEFACLOBJ_RELATION:
@@ -1889,8 +1843,10 @@ pg_get_object_address(PG_FUNCTION_ARGS)
 	ArrayType  *argsarr = PG_GETARG_ARRAYTYPE_P(2);
 	int			itype;
 	ObjectType	type;
-	List	   *name;
-	List	   *args;
+	List	   *name = NIL;
+	TypeName   *typename = NULL;
+	List	   *args = NIL;
+	Node	   *objnode = NULL;
 	ObjectAddress addr;
 	TupleDesc	tupdesc;
 	Datum		values[3];
@@ -1928,7 +1884,7 @@ pg_get_object_address(PG_FUNCTION_ARGS)
 			ereport(ERROR,
 					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
 					 errmsg("name or argument lists may not contain nulls")));
-		name = list_make1(typeStringToTypeName(TextDatumGetCString(elems[0])));
+		typename = typeStringToTypeName(TextDatumGetCString(elems[0]));
 	}
 	else if (type == OBJECT_LARGEOBJECT)
 	{
@@ -1946,7 +1902,7 @@ pg_get_object_address(PG_FUNCTION_ARGS)
 			ereport(ERROR,
 					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
 					 errmsg("large object OID may not be null")));
-		name = list_make1(makeFloat(TextDatumGetCString(elems[0])));
+		objnode = (Node *) makeFloat(TextDatumGetCString(elems[0]));
 	}
 	else
 	{
@@ -2033,7 +1989,91 @@ pg_get_object_address(PG_FUNCTION_ARGS)
 			break;
 	}
 
-	addr = get_object_address(type, name, args,
+	/*
+	 * Now build the Node type that get_object_name() expects for the given
+	 * type.
+	 */
+	switch (type)
+	{
+		case OBJECT_TABLE:
+		case OBJECT_SEQUENCE:
+		case OBJECT_VIEW:
+		case OBJECT_MATVIEW:
+		case OBJECT_INDEX:
+		case OBJECT_FOREIGN_TABLE:
+		case OBJECT_COLUMN:
+		case OBJECT_ATTRIBUTE:
+		case OBJECT_COLLATION:
+		case OBJECT_CONVERSION:
+		case OBJECT_TSPARSER:
+		case OBJECT_TSDICTIONARY:
+		case OBJECT_TSTEMPLATE:
+		case OBJECT_TSCONFIGURATION:
+		case OBJECT_DEFAULT:
+		case OBJECT_POLICY:
+		case OBJECT_RULE:
+		case OBJECT_TRIGGER:
+		case OBJECT_TABCONSTRAINT:
+		case OBJECT_OPCLASS:
+		case OBJECT_OPFAMILY:
+			objnode = (Node *) name;
+			break;
+		case OBJECT_ACCESS_METHOD:
+		case OBJECT_DATABASE:
+		case OBJECT_EVENT_TRIGGER:
+		case OBJECT_EXTENSION:
+		case OBJECT_FDW:
+		case OBJECT_FOREIGN_SERVER:
+		case OBJECT_LANGUAGE:
+		case OBJECT_ROLE:
+		case OBJECT_SCHEMA:
+		case OBJECT_TABLESPACE:
+			if (list_length(name) != 1)
+				ereport(ERROR,
+						(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+					  errmsg("name list length must be exactly %d", 1)));
+			objnode = linitial(name);
+			break;
+		case OBJECT_TYPE:
+		case OBJECT_DOMAIN:
+			objnode = (Node *) typename;
+			break;
+		case OBJECT_CAST:
+		case OBJECT_DOMCONSTRAINT:
+		case OBJECT_TRANSFORM:
+			objnode = (Node *) list_make2(typename, linitial(args));
+			break;
+		case OBJECT_USER_MAPPING:
+			objnode = (Node *) list_make2(linitial(name), linitial(args));
+			break;
+		case OBJECT_DEFACL:
+			objnode = (Node *) lcons(linitial(args), name);
+			break;
+		case OBJECT_AMOP:
+		case OBJECT_AMPROC:
+			objnode = (Node *) list_make2(name, args);
+			break;
+		case OBJECT_FUNCTION:
+		case OBJECT_AGGREGATE:
+		case OBJECT_OPERATOR:
+		{
+			FuncWithArgs *fwa = makeNode(FuncWithArgs);
+
+			fwa->funcname = name;
+			fwa->funcargs = args;
+			objnode = (Node *) fwa;
+			break;
+		}
+		case OBJECT_LARGEOBJECT:
+			/* already handled above */
+			break;
+		/* no default, to let compiler warn about missing case */
+	}
+
+	if (objnode == NULL)
+		elog(ERROR, "unrecognized object type: %d", type);
+
+	addr = get_object_address(type, objnode,
 							  &relation, AccessShareLock, false);
 
 	/* We don't need the relcache entry, thank you very much */
@@ -2066,7 +2106,7 @@ pg_get_object_address(PG_FUNCTION_ARGS)
  */
 void
 check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
-					   List *objname, List *objargs, Relation relation)
+					   Node *objname, Relation relation)
 {
 	switch (objtype)
 	{
@@ -2088,7 +2128,7 @@ check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
 		case OBJECT_DATABASE:
 			if (!pg_database_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_DATABASE,
-							   NameListToString(objname));
+							   strVal((Value *) objname));
 			break;
 		case OBJECT_TYPE:
 		case OBJECT_DOMAIN:
@@ -2101,62 +2141,62 @@ check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
 		case OBJECT_FUNCTION:
 			if (!pg_proc_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_PROC,
-							   NameListToString(objname));
+							   NameListToString(((FuncWithArgs *) objname)->funcname));
 			break;
 		case OBJECT_OPERATOR:
 			if (!pg_oper_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_OPER,
-							   NameListToString(objname));
+							   NameListToString(((FuncWithArgs *) objname)->funcname));
 			break;
 		case OBJECT_SCHEMA:
 			if (!pg_namespace_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_NAMESPACE,
-							   NameListToString(objname));
+							   strVal((Value *) objname));
 			break;
 		case OBJECT_COLLATION:
 			if (!pg_collation_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_COLLATION,
-							   NameListToString(objname));
+							   NameListToString((List *) objname));
 			break;
 		case OBJECT_CONVERSION:
 			if (!pg_conversion_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_CONVERSION,
-							   NameListToString(objname));
+							   NameListToString((List *) objname));
 			break;
 		case OBJECT_EXTENSION:
 			if (!pg_extension_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_EXTENSION,
-							   NameListToString(objname));
+							   strVal((Value *) objname));
 			break;
 		case OBJECT_FDW:
 			if (!pg_foreign_data_wrapper_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_FDW,
-							   NameListToString(objname));
+							   strVal((Value *) objname));
 			break;
 		case OBJECT_FOREIGN_SERVER:
 			if (!pg_foreign_server_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_FOREIGN_SERVER,
-							   NameListToString(objname));
+							   strVal((Value *) objname));
 			break;
 		case OBJECT_EVENT_TRIGGER:
 			if (!pg_event_trigger_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_EVENT_TRIGGER,
-							   NameListToString(objname));
+							   strVal((Value *) objname));
 			break;
 		case OBJECT_LANGUAGE:
 			if (!pg_language_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_LANGUAGE,
-							   NameListToString(objname));
+							   strVal((Value *) objname));
 			break;
 		case OBJECT_OPCLASS:
 			if (!pg_opclass_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_OPCLASS,
-							   NameListToString(objname));
+							   NameListToString((List *) objname));
 			break;
 		case OBJECT_OPFAMILY:
 			if (!pg_opfamily_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_OPFAMILY,
-							   NameListToString(objname));
+							   NameListToString((List *) objname));
 			break;
 		case OBJECT_LARGEOBJECT:
 			if (!lo_compat_privileges &&
@@ -2169,8 +2209,8 @@ check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
 		case OBJECT_CAST:
 			{
 				/* We can only check permissions on the source/target types */
-				TypeName   *sourcetype = (TypeName *) linitial(objname);
-				TypeName   *targettype = (TypeName *) linitial(objargs);
+				TypeName   *sourcetype = (TypeName *) linitial((List *) objname);
+				TypeName   *targettype = (TypeName *) lsecond((List *) objname);
 				Oid			sourcetypeid = typenameTypeId(NULL, sourcetype);
 				Oid			targettypeid = typenameTypeId(NULL, targettype);
 
@@ -2185,7 +2225,7 @@ check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
 			break;
 		case OBJECT_TRANSFORM:
 			{
-				TypeName   *typename = (TypeName *) linitial(objname);
+				TypeName   *typename = (TypeName *) linitial((List *) objname);
 				Oid			typeid = typenameTypeId(NULL, typename);
 
 				if (!pg_type_ownercheck(typeid, roleid))
@@ -2195,17 +2235,17 @@ check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
 		case OBJECT_TABLESPACE:
 			if (!pg_tablespace_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TABLESPACE,
-							   NameListToString(objname));
+							   strVal((Value *) objname));
 			break;
 		case OBJECT_TSDICTIONARY:
 			if (!pg_ts_dict_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TSDICTIONARY,
-							   NameListToString(objname));
+							   NameListToString((List *) objname));
 			break;
 		case OBJECT_TSCONFIGURATION:
 			if (!pg_ts_config_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TSCONFIGURATION,
-							   NameListToString(objname));
+							   NameListToString((List *) objname));
 			break;
 		case OBJECT_ROLE:
 
diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c
index 03c0433992..2ce535e1ec 100644
--- a/src/backend/commands/alter.c
+++ b/src/backend/commands/alter.c
@@ -369,7 +369,7 @@ ExecRenameStmt(RenameStmt *stmt)
 				Relation	relation;
 
 				address = get_object_address(stmt->renameType,
-											 stmt->object, stmt->objarg,
+											 stmt->object,
 											 &relation,
 											 AccessExclusiveLock, false);
 				Assert(relation == NULL);
@@ -405,8 +405,8 @@ ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddre
 	Relation	rel;
 
 	address =
-		get_object_address_rv(stmt->objectType, stmt->relation, stmt->objname,
-							stmt->objargs, &rel, AccessExclusiveLock, false);
+		get_object_address_rv(stmt->objectType, stmt->relation, (List *) stmt->objname,
+							&rel, AccessExclusiveLock, false);
 
 	/*
 	 * If a relation was involved, it would have been opened and locked. We
@@ -415,8 +415,8 @@ ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddre
 	if (rel)
 		heap_close(rel, NoLock);
 
-	refAddr = get_object_address(OBJECT_EXTENSION, list_make1(stmt->extname),
-								 NULL, &rel, AccessExclusiveLock, false);
+	refAddr = get_object_address(OBJECT_EXTENSION, (Node *) stmt->extname,
+								 &rel, AccessExclusiveLock, false);
 	Assert(rel == NULL);
 	if (refAddress)
 		*refAddress = refAddr;
@@ -445,7 +445,7 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt,
 	switch (stmt->objectType)
 	{
 		case OBJECT_EXTENSION:
-			address = AlterExtensionNamespace(stmt->object, stmt->newschema,
+			address = AlterExtensionNamespace(strVal((Value *) stmt->object), stmt->newschema,
 										  oldSchemaAddr ? &oldNspOid : NULL);
 			break;
 
@@ -460,7 +460,7 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt,
 
 		case OBJECT_DOMAIN:
 		case OBJECT_TYPE:
-			address = AlterTypeNamespace(stmt->object, stmt->newschema,
+			address = AlterTypeNamespace((List *) stmt->object, stmt->newschema,
 										 stmt->objectType,
 										 oldSchemaAddr ? &oldNspOid : NULL);
 			break;
@@ -485,7 +485,6 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt,
 
 				address = get_object_address(stmt->objectType,
 											 stmt->object,
-											 stmt->objarg,
 											 &relation,
 											 AccessExclusiveLock,
 											 false);
@@ -749,25 +748,26 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
 	switch (stmt->objectType)
 	{
 		case OBJECT_DATABASE:
-			return AlterDatabaseOwner(strVal(linitial(stmt->object)), newowner);
+			return AlterDatabaseOwner(strVal((Value *) stmt->object), newowner);
 
 		case OBJECT_SCHEMA:
-			return AlterSchemaOwner(strVal(linitial(stmt->object)), newowner);
+			return AlterSchemaOwner(strVal((Value *) stmt->object), newowner);
 
 		case OBJECT_TYPE:
 		case OBJECT_DOMAIN:		/* same as TYPE */
-			return AlterTypeOwner(stmt->object, newowner, stmt->objectType);
+			return AlterTypeOwner((List *) stmt->object, newowner, stmt->objectType);
+			break;
 
 		case OBJECT_FDW:
-			return AlterForeignDataWrapperOwner(strVal(linitial(stmt->object)),
+			return AlterForeignDataWrapperOwner(strVal((Value *) stmt->object),
 												newowner);
 
 		case OBJECT_FOREIGN_SERVER:
-			return AlterForeignServerOwner(strVal(linitial(stmt->object)),
+			return AlterForeignServerOwner(strVal((Value *) stmt->object),
 										   newowner);
 
 		case OBJECT_EVENT_TRIGGER:
-			return AlterEventTriggerOwner(strVal(linitial(stmt->object)),
+			return AlterEventTriggerOwner(strVal((Value *) stmt->object),
 										  newowner);
 
 			/* Generic cases */
@@ -791,7 +791,6 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
 
 				address = get_object_address(stmt->objectType,
 											 stmt->object,
-											 stmt->objarg,
 											 &relation,
 											 AccessExclusiveLock,
 											 false);
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c
index a0d3f8d01d..2af10bcf1a 100644
--- a/src/backend/commands/comment.c
+++ b/src/backend/commands/comment.c
@@ -48,12 +48,11 @@ CommentObject(CommentStmt *stmt)
 	 * (which is really pg_restore's fault, but for now we will work around
 	 * the problem here).  Consensus is that the best fix is to treat wrong
 	 * database name as a WARNING not an ERROR; hence, the following special
-	 * case.  (If the length of stmt->objname is not 1, get_object_address
-	 * will throw an error below; that's OK.)
+	 * case.
 	 */
-	if (stmt->objtype == OBJECT_DATABASE && list_length(stmt->objname) == 1)
+	if (stmt->objtype == OBJECT_DATABASE)
 	{
-		char	   *database = strVal(linitial(stmt->objname));
+		char	   *database = strVal((Value *) stmt->objname);
 
 		if (!OidIsValid(get_database_oid(database, true)))
 		{
@@ -70,12 +69,12 @@ CommentObject(CommentStmt *stmt)
 	 * does not exist, and will also acquire a lock on the target to guard
 	 * against concurrent DROP operations.
 	 */
-	address = get_object_address(stmt->objtype, stmt->objname, stmt->objargs,
+	address = get_object_address(stmt->objtype, stmt->objname,
 								 &relation, ShareUpdateExclusiveLock, false);
 
 	/* Require ownership of the target object. */
 	check_object_ownership(GetUserId(), stmt->objtype, address,
-						   stmt->objname, stmt->objargs, relation);
+						   stmt->objname, relation);
 
 	/* Perform other integrity checks as needed. */
 	switch (stmt->objtype)
diff --git a/src/backend/commands/dropcmds.c b/src/backend/commands/dropcmds.c
index 61ff8f2190..011d6867ce 100644
--- a/src/backend/commands/dropcmds.c
+++ b/src/backend/commands/dropcmds.c
@@ -30,7 +30,7 @@
 
 
 static void does_not_exist_skipping(ObjectType objtype,
-						List *objname, List *objargs);
+						Node *objname);
 static bool owningrel_does_not_exist_skipping(List *objname,
 								  const char **msg, char **name);
 static bool schema_does_not_exist_skipping(List *objname,
@@ -55,27 +55,19 @@ RemoveObjects(DropStmt *stmt)
 {
 	ObjectAddresses *objects;
 	ListCell   *cell1;
-	ListCell   *cell2 = NULL;
 
 	objects = new_object_addresses();
 
 	foreach(cell1, stmt->objects)
 	{
 		ObjectAddress address;
-		List	   *objname = lfirst(cell1);
-		List	   *objargs = NIL;
+		Node	   *objname = lfirst(cell1);
 		Relation	relation = NULL;
 		Oid			namespaceId;
 
-		if (stmt->arguments)
-		{
-			cell2 = (!cell2 ? list_head(stmt->arguments) : lnext(cell2));
-			objargs = lfirst(cell2);
-		}
-
 		/* Get an ObjectAddress for the object. */
 		address = get_object_address(stmt->removeType,
-									 objname, objargs,
+									 objname,
 									 &relation,
 									 AccessExclusiveLock,
 									 stmt->missing_ok);
@@ -88,7 +80,7 @@ RemoveObjects(DropStmt *stmt)
 		if (!OidIsValid(address.objectId))
 		{
 			Assert(stmt->missing_ok);
-			does_not_exist_skipping(stmt->removeType, objname, objargs);
+			does_not_exist_skipping(stmt->removeType, objname);
 			continue;
 		}
 
@@ -110,7 +102,7 @@ RemoveObjects(DropStmt *stmt)
 				ereport(ERROR,
 						(errcode(ERRCODE_WRONG_OBJECT_TYPE),
 						 errmsg("\"%s\" is an aggregate function",
-								NameListToString(objname)),
+								NameListToString(((FuncWithArgs *) objname)->funcname)),
 				errhint("Use DROP AGGREGATE to drop aggregate functions.")));
 
 			ReleaseSysCache(tup);
@@ -121,7 +113,7 @@ RemoveObjects(DropStmt *stmt)
 		if (!OidIsValid(namespaceId) ||
 			!pg_namespace_ownercheck(namespaceId, GetUserId()))
 			check_object_ownership(GetUserId(), stmt->removeType, address,
-								   objname, objargs, relation);
+								   objname, relation);
 
 		/* Release any relcache reference count, but keep lock until commit. */
 		if (relation)
@@ -254,7 +246,7 @@ type_in_list_does_not_exist_skipping(List *typenames, const char **msg,
  * get_object_address() in RemoveObjects would have thrown an ERROR.
  */
 static void
-does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs)
+does_not_exist_skipping(ObjectType objtype, Node *objname)
 {
 	const char *msg = NULL;
 	char	   *name = NULL;
@@ -264,12 +256,12 @@ does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs)
 	{
 		case OBJECT_ACCESS_METHOD:
 			msg = gettext_noop("access method \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) objname);
 			break;
 		case OBJECT_TYPE:
 		case OBJECT_DOMAIN:
 			{
-				TypeName   *typ = linitial(objname);
+				TypeName   *typ = (TypeName *) objname;
 
 				if (!schema_does_not_exist_skipping(typ->names, &msg, &name))
 				{
@@ -279,165 +271,174 @@ does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs)
 			}
 			break;
 		case OBJECT_COLLATION:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping((List *) objname, &msg, &name))
 			{
 				msg = gettext_noop("collation \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString((List *) objname);
 			}
 			break;
 		case OBJECT_CONVERSION:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping((List *) objname, &msg, &name))
 			{
 				msg = gettext_noop("conversion \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString((List *) objname);
 			}
 			break;
 		case OBJECT_SCHEMA:
 			msg = gettext_noop("schema \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) objname);
 			break;
 		case OBJECT_TSPARSER:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping((List *) objname, &msg, &name))
 			{
 				msg = gettext_noop("text search parser \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString((List *) objname);
 			}
 			break;
 		case OBJECT_TSDICTIONARY:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping((List *) objname, &msg, &name))
 			{
 				msg = gettext_noop("text search dictionary \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString((List *) objname);
 			}
 			break;
 		case OBJECT_TSTEMPLATE:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping((List *) objname, &msg, &name))
 			{
 				msg = gettext_noop("text search template \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString((List *) objname);
 			}
 			break;
 		case OBJECT_TSCONFIGURATION:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping((List *) objname, &msg, &name))
 			{
 				msg = gettext_noop("text search configuration \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString((List *) objname);
 			}
 			break;
 		case OBJECT_EXTENSION:
 			msg = gettext_noop("extension \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) objname);
 			break;
 		case OBJECT_FUNCTION:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name) &&
-				!type_in_list_does_not_exist_skipping(objargs, &msg, &name))
 			{
-				msg = gettext_noop("function %s(%s) does not exist, skipping");
-				name = NameListToString(objname);
-				args = TypeNameListToString(objargs);
+				FuncWithArgs *fwa = (FuncWithArgs *) objname;
+				if (!schema_does_not_exist_skipping(fwa->funcname, &msg, &name) &&
+					!type_in_list_does_not_exist_skipping(fwa->funcargs, &msg, &name))
+				{
+					msg = gettext_noop("function %s(%s) does not exist, skipping");
+					name = NameListToString(fwa->funcname);
+					args = TypeNameListToString(fwa->funcargs);
+				}
+				break;
 			}
-			break;
 		case OBJECT_AGGREGATE:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name) &&
-				!type_in_list_does_not_exist_skipping(objargs, &msg, &name))
 			{
-				msg = gettext_noop("aggregate %s(%s) does not exist, skipping");
-				name = NameListToString(objname);
-				args = TypeNameListToString(objargs);
+				FuncWithArgs *fwa = (FuncWithArgs *) objname;
+				if (!schema_does_not_exist_skipping(fwa->funcname, &msg, &name) &&
+					!type_in_list_does_not_exist_skipping(fwa->funcargs, &msg, &name))
+				{
+					msg = gettext_noop("aggregate %s(%s) does not exist, skipping");
+					name = NameListToString(fwa->funcname);
+					args = TypeNameListToString(fwa->funcargs);
+				}
+				break;
 			}
-			break;
 		case OBJECT_OPERATOR:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name) &&
-				!type_in_list_does_not_exist_skipping(objargs, &msg, &name))
 			{
-				msg = gettext_noop("operator %s does not exist, skipping");
-				name = NameListToString(objname);
+				FuncWithArgs *fwa = (FuncWithArgs *) objname;
+				if (!schema_does_not_exist_skipping(fwa->funcname, &msg, &name) &&
+					!type_in_list_does_not_exist_skipping(fwa->funcargs, &msg, &name))
+				{
+					msg = gettext_noop("operator %s does not exist, skipping");
+					name = NameListToString(fwa->funcname);
+				}
+				break;
 			}
-			break;
 		case OBJECT_LANGUAGE:
 			msg = gettext_noop("language \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) objname);
 			break;
 		case OBJECT_CAST:
 			{
-				if (!type_in_list_does_not_exist_skipping(objname, &msg, &name) &&
-				 !type_in_list_does_not_exist_skipping(objargs, &msg, &name))
+				if (!type_in_list_does_not_exist_skipping(list_make1(linitial((List *) objname)), &msg, &name) &&
+					!type_in_list_does_not_exist_skipping(list_make1(lsecond((List *) objname)), &msg, &name))
 				{
 					/* XXX quote or no quote? */
 					msg = gettext_noop("cast from type %s to type %s does not exist, skipping");
-					name = TypeNameToString((TypeName *) linitial(objname));
-					args = TypeNameToString((TypeName *) linitial(objargs));
+					name = TypeNameToString((TypeName *) linitial((List *) objname));
+					args = TypeNameToString((TypeName *) lsecond((List *) objname));
 				}
 			}
 			break;
 		case OBJECT_TRANSFORM:
-			if (!type_in_list_does_not_exist_skipping(objname, &msg, &name))
+			if (!type_in_list_does_not_exist_skipping(list_make1(linitial((List *) objname)), &msg, &name))
 			{
 				msg = gettext_noop("transform for type %s language \"%s\" does not exist, skipping");
-				name = TypeNameToString((TypeName *) linitial(objname));
-				args = strVal(linitial(objargs));
+				name = TypeNameToString((TypeName *) linitial((List *) objname));
+				args = strVal(lsecond((List *) objname));
 			}
 			break;
 		case OBJECT_TRIGGER:
-			if (!owningrel_does_not_exist_skipping(objname, &msg, &name))
+			if (!owningrel_does_not_exist_skipping((List *) objname, &msg, &name))
 			{
 				msg = gettext_noop("trigger \"%s\" for relation \"%s\" does not exist, skipping");
-				name = strVal(llast(objname));
-				args = NameListToString(list_truncate(list_copy(objname),
-												  list_length(objname) - 1));
+				name = strVal(llast((List *) objname));
+				args = NameListToString(list_truncate(list_copy((List *) objname),
+													  list_length((List *) objname) - 1));
 			}
 			break;
 		case OBJECT_POLICY:
-			if (!owningrel_does_not_exist_skipping(objname, &msg, &name))
+			if (!owningrel_does_not_exist_skipping((List *) objname, &msg, &name))
 			{
 				msg = gettext_noop("policy \"%s\" for relation \"%s\" does not exist, skipping");
-				name = strVal(llast(objname));
-				args = NameListToString(list_truncate(list_copy(objname),
-												  list_length(objname) - 1));
+				name = strVal(llast((List *) objname));
+				args = NameListToString(list_truncate(list_copy((List *) objname),
+													  list_length((List *) objname) - 1));
 			}
 			break;
 		case OBJECT_EVENT_TRIGGER:
 			msg = gettext_noop("event trigger \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) objname);
 			break;
 		case OBJECT_RULE:
-			if (!owningrel_does_not_exist_skipping(objname, &msg, &name))
+			if (!owningrel_does_not_exist_skipping((List *) objname, &msg, &name))
 			{
 				msg = gettext_noop("rule \"%s\" for relation \"%s\" does not exist, skipping");
-				name = strVal(llast(objname));
-				args = NameListToString(list_truncate(list_copy(objname),
-												  list_length(objname) - 1));
+				name = strVal(llast((List *) objname));
+				args = NameListToString(list_truncate(list_copy((List *) objname),
+													  list_length((List *) objname) - 1));
 			}
 			break;
 		case OBJECT_FDW:
 			msg = gettext_noop("foreign-data wrapper \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) objname);
 			break;
 		case OBJECT_FOREIGN_SERVER:
 			msg = gettext_noop("server \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) objname);
 			break;
 		case OBJECT_OPCLASS:
 			{
-				List	   *opcname = list_copy_tail(objname, 1);
+				List	   *opcname = list_copy_tail((List *) objname, 1);
 
 				if (!schema_does_not_exist_skipping(opcname, &msg, &name))
 				{
 					msg = gettext_noop("operator class \"%s\" does not exist for access method \"%s\", skipping");
 					name = NameListToString(opcname);
-					args = strVal(linitial(objname));
+					args = strVal(linitial((List *) objname));
 				}
 			}
 			break;
 		case OBJECT_OPFAMILY:
 			{
-				List	   *opfname = list_copy_tail(objname, 1);
+				List	   *opfname = list_copy_tail((List *) objname, 1);
 
 				if (!schema_does_not_exist_skipping(opfname, &msg, &name))
 				{
 					msg = gettext_noop("operator family \"%s\" does not exist for access method \"%s\", skipping");
 					name = NameListToString(opfname);
-					args = strVal(linitial(objname));
+					args = strVal(linitial((List *) objname));
 				}
 			}
 			break;
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index f6c2c8af91..f883db33f6 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -2673,9 +2673,8 @@ extension_config_remove(Oid extensionoid, Oid tableoid)
  * Execute ALTER EXTENSION SET SCHEMA
  */
 ObjectAddress
-AlterExtensionNamespace(List *names, const char *newschema, Oid *oldschema)
+AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *oldschema)
 {
-	char	   *extensionName;
 	Oid			extensionOid;
 	Oid			nspOid;
 	Oid			oldNspOid = InvalidOid;
@@ -2691,12 +2690,6 @@ AlterExtensionNamespace(List *names, const char *newschema, Oid *oldschema)
 	ObjectAddresses *objsMoved;
 	ObjectAddress extAddr;
 
-	if (list_length(names) != 1)
-		ereport(ERROR,
-				(errcode(ERRCODE_SYNTAX_ERROR),
-				 errmsg("extension name cannot be qualified")));
-	extensionName = strVal(linitial(names));
-
 	extensionOid = get_extension_oid(extensionName, false);
 
 	nspOid = LookupCreationNamespace(newschema);
@@ -3194,7 +3187,7 @@ ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
 	 * does not exist, and will also acquire a lock on the object to guard
 	 * against concurrent DROP and ALTER EXTENSION ADD/DROP operations.
 	 */
-	object = get_object_address(stmt->objtype, stmt->objname, stmt->objargs,
+	object = get_object_address(stmt->objtype, stmt->objname,
 								&relation, ShareUpdateExclusiveLock, false);
 
 	Assert(object.objectSubId == 0);
@@ -3203,7 +3196,7 @@ ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
 
 	/* Permission check: must own target object, too */
 	check_object_ownership(GetUserId(), stmt->objtype, object,
-						   stmt->objname, stmt->objargs, relation);
+						   stmt->objname, relation);
 
 	/*
 	 * Check existing extension membership.
diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c
index 2b0ae34830..8fb7af5e79 100644
--- a/src/backend/commands/seclabel.c
+++ b/src/backend/commands/seclabel.c
@@ -89,12 +89,12 @@ ExecSecLabelStmt(SecLabelStmt *stmt)
 	 * object does not exist, and will also acquire a lock on the target to
 	 * guard against concurrent modifications.
 	 */
-	address = get_object_address(stmt->objtype, stmt->objname, stmt->objargs,
+	address = get_object_address(stmt->objtype, stmt->objname,
 								 &relation, ShareUpdateExclusiveLock, false);
 
 	/* Require ownership of the target object. */
 	check_object_ownership(GetUserId(), stmt->objtype, address,
-						   stmt->objname, stmt->objargs, relation);
+						   stmt->objname, relation);
 
 	/* Perform other integrity checks as needed. */
 	switch (stmt->objtype)
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 2f605ce83d..237783afbc 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -2778,7 +2778,7 @@ RenameConstraint(RenameStmt *stmt)
 		Relation	rel;
 		HeapTuple	tup;
 
-		typid = typenameTypeId(NULL, makeTypeNameFromNameList(stmt->object));
+		typid = typenameTypeId(NULL, makeTypeNameFromNameList((List *) stmt->object));
 		rel = heap_open(TypeRelationId, RowExclusiveLock);
 		tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
 		if (!HeapTupleIsValid(tup))
@@ -9366,11 +9366,9 @@ RebuildConstraintComment(AlteredTableInfo *tab, int pass, Oid objid,
 	/* Build node CommentStmt */
 	cmd = makeNode(CommentStmt);
 	cmd->objtype = OBJECT_TABCONSTRAINT;
-	cmd->objname = list_make3(
-				   makeString(get_namespace_name(RelationGetNamespace(rel))),
-							  makeString(RelationGetRelationName(rel)),
-							  makeString(conname));
-	cmd->objargs = NIL;
+	cmd->objname = (Node *) list_make3(makeString(get_namespace_name(RelationGetNamespace(rel))),
+									   makeString(RelationGetRelationName(rel)),
+									   makeString(conname));
 	cmd->comment = comment_str;
 
 	/* Append it to list of commands */
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c
index 5e3989acd2..9304ad11e6 100644
--- a/src/backend/commands/typecmds.c
+++ b/src/backend/commands/typecmds.c
@@ -3106,7 +3106,7 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid,
 ObjectAddress
 RenameType(RenameStmt *stmt)
 {
-	List	   *names = stmt->object;
+	List	   *names = (List *) stmt->object;
 	const char *newTypeName = stmt->newname;
 	TypeName   *typename;
 	Oid			typeOid;
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 6955298577..13f7f110fb 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -3080,7 +3080,6 @@ _copyDropStmt(const DropStmt *from)
 	DropStmt   *newnode = makeNode(DropStmt);
 
 	COPY_NODE_FIELD(objects);
-	COPY_NODE_FIELD(arguments);
 	COPY_SCALAR_FIELD(removeType);
 	COPY_SCALAR_FIELD(behavior);
 	COPY_SCALAR_FIELD(missing_ok);
@@ -3108,7 +3107,6 @@ _copyCommentStmt(const CommentStmt *from)
 
 	COPY_SCALAR_FIELD(objtype);
 	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
 	COPY_STRING_FIELD(comment);
 
 	return newnode;
@@ -3121,7 +3119,6 @@ _copySecLabelStmt(const SecLabelStmt *from)
 
 	COPY_SCALAR_FIELD(objtype);
 	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
 	COPY_STRING_FIELD(provider);
 	COPY_STRING_FIELD(label);
 
@@ -3227,7 +3224,6 @@ _copyRenameStmt(const RenameStmt *from)
 	COPY_SCALAR_FIELD(relationType);
 	COPY_NODE_FIELD(relation);
 	COPY_NODE_FIELD(object);
-	COPY_NODE_FIELD(objarg);
 	COPY_STRING_FIELD(subname);
 	COPY_STRING_FIELD(newname);
 	COPY_SCALAR_FIELD(behavior);
@@ -3244,7 +3240,6 @@ _copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
 	COPY_SCALAR_FIELD(objectType);
 	COPY_NODE_FIELD(relation);
 	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
 	COPY_NODE_FIELD(extname);
 
 	return newnode;
@@ -3258,7 +3253,6 @@ _copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
 	COPY_SCALAR_FIELD(objectType);
 	COPY_NODE_FIELD(relation);
 	COPY_NODE_FIELD(object);
-	COPY_NODE_FIELD(objarg);
 	COPY_STRING_FIELD(newschema);
 	COPY_SCALAR_FIELD(missing_ok);
 
@@ -3273,7 +3267,6 @@ _copyAlterOwnerStmt(const AlterOwnerStmt *from)
 	COPY_SCALAR_FIELD(objectType);
 	COPY_NODE_FIELD(relation);
 	COPY_NODE_FIELD(object);
-	COPY_NODE_FIELD(objarg);
 	COPY_NODE_FIELD(newowner);
 
 	return newnode;
@@ -3745,7 +3738,6 @@ _copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
 	COPY_SCALAR_FIELD(action);
 	COPY_SCALAR_FIELD(objtype);
 	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
 
 	return newnode;
 }
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index 548a2aa876..3538932662 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -1205,7 +1205,6 @@ static bool
 _equalDropStmt(const DropStmt *a, const DropStmt *b)
 {
 	COMPARE_NODE_FIELD(objects);
-	COMPARE_NODE_FIELD(arguments);
 	COMPARE_SCALAR_FIELD(removeType);
 	COMPARE_SCALAR_FIELD(behavior);
 	COMPARE_SCALAR_FIELD(missing_ok);
@@ -1229,7 +1228,6 @@ _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
 {
 	COMPARE_SCALAR_FIELD(objtype);
 	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
 	COMPARE_STRING_FIELD(comment);
 
 	return true;
@@ -1240,7 +1238,6 @@ _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
 {
 	COMPARE_SCALAR_FIELD(objtype);
 	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
 	COMPARE_STRING_FIELD(provider);
 	COMPARE_STRING_FIELD(label);
 
@@ -1332,7 +1329,6 @@ _equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
 	COMPARE_SCALAR_FIELD(relationType);
 	COMPARE_NODE_FIELD(relation);
 	COMPARE_NODE_FIELD(object);
-	COMPARE_NODE_FIELD(objarg);
 	COMPARE_STRING_FIELD(subname);
 	COMPARE_STRING_FIELD(newname);
 	COMPARE_SCALAR_FIELD(behavior);
@@ -1347,7 +1343,6 @@ _equalAlterObjectDependsStmt(const AlterObjectDependsStmt *a, const AlterObjectD
 	COMPARE_SCALAR_FIELD(objectType);
 	COMPARE_NODE_FIELD(relation);
 	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
 	COMPARE_NODE_FIELD(extname);
 
 	return true;
@@ -1359,7 +1354,6 @@ _equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSch
 	COMPARE_SCALAR_FIELD(objectType);
 	COMPARE_NODE_FIELD(relation);
 	COMPARE_NODE_FIELD(object);
-	COMPARE_NODE_FIELD(objarg);
 	COMPARE_STRING_FIELD(newschema);
 	COMPARE_SCALAR_FIELD(missing_ok);
 
@@ -1372,7 +1366,6 @@ _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
 	COMPARE_SCALAR_FIELD(objectType);
 	COMPARE_NODE_FIELD(relation);
 	COMPARE_NODE_FIELD(object);
-	COMPARE_NODE_FIELD(objarg);
 	COMPARE_NODE_FIELD(newowner);
 
 	return true;
@@ -1769,7 +1762,6 @@ _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const Alte
 	COMPARE_SCALAR_FIELD(action);
 	COMPARE_SCALAR_FIELD(objtype);
 	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
 
 	return true;
 }
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 645c95909e..c7d08784f4 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -425,7 +425,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
 %type <boolean> copy_from opt_program
 
 %type <ival>	opt_column event cursor_options opt_hold opt_set_data
-%type <objtype>	drop_type comment_type security_label_type
+%type <objtype>	drop_type1 drop_type2 comment_type1 comment_type2 security_label_type1 security_label_type2
 
 %type <node>	fetch_args limit_clause select_limit_value
 				offset_clause select_offset_value
@@ -4044,8 +4044,7 @@ DropPLangStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_LANGUAGE;
-					n->objects = list_make1(list_make1(makeString($4)));
-					n->arguments = NIL;
+					n->objects = list_make1(makeString($4));
 					n->behavior = $5;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -4055,7 +4054,7 @@ DropPLangStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_LANGUAGE;
-					n->objects = list_make1(list_make1(makeString($6)));
+					n->objects = list_make1(makeString($6));
 					n->behavior = $7;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -4210,7 +4209,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_ACCESS_METHOD;
-					n->objname = list_make1(makeString($7));
+					n->objname = (Node *) makeString($7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop AGGREGATE aggregate_with_argtypes
@@ -4219,8 +4218,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $6->funcname;
-					n->objargs = $6->funcargs;
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop CAST '(' Typename AS Typename ')'
@@ -4229,8 +4227,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_CAST;
-					n->objname = list_make1($7);
-					n->objargs = list_make1($9);
+					n->objname = (Node *) list_make2($7, $9);
 					$$ = (Node *) n;
 				}
 			| ALTER EXTENSION name add_drop COLLATION any_name
@@ -4239,7 +4236,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_COLLATION;
-					n->objname = $6;
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop CONVERSION_P any_name
@@ -4248,7 +4245,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_CONVERSION;
-					n->objname = $6;
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop DOMAIN_P Typename
@@ -4257,7 +4254,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_DOMAIN;
-					n->objname = list_make1($6);
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop FUNCTION function_with_argtypes
@@ -4266,8 +4263,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_FUNCTION;
-					n->objname = $6->funcname;
-					n->objargs = $6->funcargs;
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop opt_procedural LANGUAGE name
@@ -4276,7 +4272,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_LANGUAGE;
-					n->objname = list_make1(makeString($7));
+					n->objname = (Node *) makeString($7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop OPERATOR operator_with_argtypes
@@ -4285,8 +4281,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_OPERATOR;
-					n->objname = $6->funcname;
-					n->objargs = $6->funcargs;
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop OPERATOR CLASS any_name USING access_method
@@ -4295,7 +4290,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_OPCLASS;
-					n->objname = lcons(makeString($9), $7);
+					n->objname = (Node *) lcons(makeString($9), $7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop OPERATOR FAMILY any_name USING access_method
@@ -4304,7 +4299,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_OPFAMILY;
-					n->objname = lcons(makeString($9), $7);
+					n->objname = (Node *) lcons(makeString($9), $7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop SCHEMA name
@@ -4313,7 +4308,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_SCHEMA;
-					n->objname = list_make1(makeString($6));
+					n->objname = (Node *) makeString($6);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop EVENT TRIGGER name
@@ -4322,7 +4317,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_EVENT_TRIGGER;
-					n->objname = list_make1(makeString($7));
+					n->objname = (Node *) makeString($7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TABLE any_name
@@ -4331,7 +4326,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TABLE;
-					n->objname = $6;
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TEXT_P SEARCH PARSER any_name
@@ -4340,7 +4335,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TSPARSER;
-					n->objname = $8;
+					n->objname = (Node *) $8;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TEXT_P SEARCH DICTIONARY any_name
@@ -4349,7 +4344,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TSDICTIONARY;
-					n->objname = $8;
+					n->objname = (Node *) $8;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TEXT_P SEARCH TEMPLATE any_name
@@ -4358,7 +4353,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TSTEMPLATE;
-					n->objname = $8;
+					n->objname = (Node *) $8;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TEXT_P SEARCH CONFIGURATION any_name
@@ -4367,7 +4362,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TSCONFIGURATION;
-					n->objname = $8;
+					n->objname = (Node *) $8;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop SEQUENCE any_name
@@ -4376,7 +4371,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_SEQUENCE;
-					n->objname = $6;
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop VIEW any_name
@@ -4385,7 +4380,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_VIEW;
-					n->objname = $6;
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop MATERIALIZED VIEW any_name
@@ -4394,7 +4389,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_MATVIEW;
-					n->objname = $7;
+					n->objname = (Node *) $7;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop FOREIGN TABLE any_name
@@ -4403,7 +4398,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_FOREIGN_TABLE;
-					n->objname = $7;
+					n->objname = (Node *) $7;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop FOREIGN DATA_P WRAPPER name
@@ -4412,7 +4407,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_FDW;
-					n->objname = list_make1(makeString($8));
+					n->objname = (Node *) makeString($8);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop SERVER name
@@ -4421,7 +4416,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_FOREIGN_SERVER;
-					n->objname = list_make1(makeString($6));
+					n->objname = (Node *) makeString($6);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TRANSFORM FOR Typename LANGUAGE name
@@ -4430,8 +4425,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TRANSFORM;
-					n->objname = list_make1($7);
-					n->objargs = list_make1(makeString($9));
+					n->objname = (Node *) list_make2($7, makeString($9));
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TYPE_P Typename
@@ -4440,7 +4434,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TYPE;
-					n->objname = list_make1($6);
+					n->objname = (Node *) $6;
 					$$ = (Node *)n;
 				}
 		;
@@ -4490,8 +4484,7 @@ DropFdwStmt: DROP FOREIGN DATA_P WRAPPER name opt_drop_behavior
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FDW;
-					n->objects = list_make1(list_make1(makeString($5)));
-					n->arguments = NIL;
+					n->objects = list_make1(makeString($5));
 					n->missing_ok = false;
 					n->behavior = $6;
 					n->concurrent = false;
@@ -4501,8 +4494,7 @@ DropFdwStmt: DROP FOREIGN DATA_P WRAPPER name opt_drop_behavior
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FDW;
-					n->objects = list_make1(list_make1(makeString($7)));
-					n->arguments = NIL;
+					n->objects = list_make1(makeString($7));
 					n->missing_ok = true;
 					n->behavior = $8;
 					n->concurrent = false;
@@ -4652,8 +4644,7 @@ DropForeignServerStmt: DROP SERVER name opt_drop_behavior
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FOREIGN_SERVER;
-					n->objects = list_make1(list_make1(makeString($3)));
-					n->arguments = NIL;
+					n->objects = list_make1(makeString($3));
 					n->missing_ok = false;
 					n->behavior = $4;
 					n->concurrent = false;
@@ -4663,8 +4654,7 @@ DropForeignServerStmt: DROP SERVER name opt_drop_behavior
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FOREIGN_SERVER;
-					n->objects = list_make1(list_make1(makeString($5)));
-					n->arguments = NIL;
+					n->objects = list_make1(makeString($5));
 					n->missing_ok = true;
 					n->behavior = $6;
 					n->concurrent = false;
@@ -4988,7 +4978,6 @@ DropPolicyStmt:
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_POLICY;
 					n->objects = list_make1(lappend($5, makeString($3)));
-					n->arguments = NIL;
 					n->behavior = $6;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -4999,7 +4988,6 @@ DropPolicyStmt:
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_POLICY;
 					n->objects = list_make1(lappend($7, makeString($5)));
-					n->arguments = NIL;
 					n->behavior = $8;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -5312,7 +5300,6 @@ DropTrigStmt:
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_TRIGGER;
 					n->objects = list_make1(lappend($5, makeString($3)));
-					n->arguments = NIL;
 					n->behavior = $6;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -5323,7 +5310,6 @@ DropTrigStmt:
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_TRIGGER;
 					n->objects = list_make1(lappend($7, makeString($5)));
-					n->arguments = NIL;
 					n->behavior = $8;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -5433,7 +5419,6 @@ DropAssertStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->objects = NIL;
-					n->arguments = NIL;
 					n->behavior = $4;
 					n->removeType = OBJECT_TRIGGER; /* XXX */
 					ereport(ERROR,
@@ -5947,24 +5932,42 @@ ReassignOwnedStmt:
  *
  *****************************************************************************/
 
-DropStmt:	DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior
+DropStmt:	DROP drop_type1 IF_P EXISTS any_name_list opt_drop_behavior
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = $2;
 					n->missing_ok = TRUE;
 					n->objects = $5;
-					n->arguments = NIL;
 					n->behavior = $6;
 					n->concurrent = false;
 					$$ = (Node *)n;
 				}
-			| DROP drop_type any_name_list opt_drop_behavior
+			| DROP drop_type1 any_name_list opt_drop_behavior
+				{
+					DropStmt *n = makeNode(DropStmt);
+					n->removeType = $2;
+					n->missing_ok = FALSE;
+					n->objects = $3;
+					n->behavior = $4;
+					n->concurrent = false;
+					$$ = (Node *)n;
+				}
+			| DROP drop_type2 IF_P EXISTS name_list opt_drop_behavior
+				{
+					DropStmt *n = makeNode(DropStmt);
+					n->removeType = $2;
+					n->missing_ok = TRUE;
+					n->objects = $5;
+					n->behavior = $6;
+					n->concurrent = false;
+					$$ = (Node *)n;
+				}
+			| DROP drop_type2 name_list opt_drop_behavior
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = $2;
 					n->missing_ok = FALSE;
 					n->objects = $3;
-					n->arguments = NIL;
 					n->behavior = $4;
 					n->concurrent = false;
 					$$ = (Node *)n;
@@ -6015,7 +6018,6 @@ DropStmt:	DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior
 					n->removeType = OBJECT_INDEX;
 					n->missing_ok = FALSE;
 					n->objects = $4;
-					n->arguments = NIL;
 					n->behavior = $5;
 					n->concurrent = true;
 					$$ = (Node *)n;
@@ -6026,32 +6028,34 @@ DropStmt:	DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior
 					n->removeType = OBJECT_INDEX;
 					n->missing_ok = TRUE;
 					n->objects = $6;
-					n->arguments = NIL;
 					n->behavior = $7;
 					n->concurrent = true;
 					$$ = (Node *)n;
 				}
 		;
 
-
-drop_type:	TABLE									{ $$ = OBJECT_TABLE; }
+/* object types taking any_name_list */
+drop_type1:	TABLE									{ $$ = OBJECT_TABLE; }
 			| SEQUENCE								{ $$ = OBJECT_SEQUENCE; }
 			| VIEW									{ $$ = OBJECT_VIEW; }
 			| MATERIALIZED VIEW						{ $$ = OBJECT_MATVIEW; }
 			| INDEX									{ $$ = OBJECT_INDEX; }
 			| FOREIGN TABLE							{ $$ = OBJECT_FOREIGN_TABLE; }
-			| ACCESS METHOD							{ $$ = OBJECT_ACCESS_METHOD; }
-			| EVENT TRIGGER 						{ $$ = OBJECT_EVENT_TRIGGER; }
 			| 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; }
 		;
 
+/* object types taking name_list */
+drop_type2: ACCESS METHOD							{ $$ = OBJECT_ACCESS_METHOD; }
+			| EVENT TRIGGER							{ $$ = OBJECT_EVENT_TRIGGER; }
+			| EXTENSION								{ $$ = OBJECT_EXTENSION; }
+			| SCHEMA								{ $$ = OBJECT_SCHEMA; }
+		;
+
 any_name_list:
 			any_name								{ $$ = list_make1($1); }
 			| any_name_list ',' any_name			{ $$ = lappend($1, $3); }
@@ -6068,8 +6072,8 @@ attrs:		'.' attr_name
 		;
 
 type_name_list:
-			Typename								{ $$ = list_make1(list_make1($1)); }
-			| type_name_list ',' Typename			{ $$ = lappend($1, list_make1($3)); }
+			Typename								{ $$ = list_make1($1); }
+			| type_name_list ',' Typename			{ $$ = lappend($1, $3); }
 
 /*****************************************************************************
  *
@@ -6126,12 +6130,19 @@ opt_restart_seqs:
  *****************************************************************************/
 
 CommentStmt:
-			COMMENT ON comment_type any_name IS comment_text
+			COMMENT ON comment_type1 any_name IS comment_text
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = $3;
-					n->objname = $4;
-					n->objargs = NIL;
+					n->objname = (Node *) $4;
+					n->comment = $6;
+					$$ = (Node *) n;
+				}
+			| COMMENT ON comment_type2 name IS comment_text
+				{
+					CommentStmt *n = makeNode(CommentStmt);
+					n->objtype = $3;
+					n->objname = (Node *) makeString($4);
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6139,8 +6150,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TYPE;
-					n->objname = list_make1($4);
-					n->objargs = NIL;
+					n->objname = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6148,8 +6158,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_DOMAIN;
-					n->objname = list_make1($4);
-					n->objargs = NIL;
+					n->objname = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6157,8 +6166,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $4->funcname;
-					n->objargs = $4->funcargs;
+					n->objname = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6166,8 +6174,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_FUNCTION;
-					n->objname = $4->funcname;
-					n->objargs = $4->funcargs;
+					n->objname = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6175,8 +6182,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_OPERATOR;
-					n->objname = $4->funcname;
-					n->objargs = $4->funcargs;
+					n->objname = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6184,8 +6190,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TABCONSTRAINT;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
+					n->objname = (Node *) lappend($6, makeString($4));
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -6198,8 +6203,7 @@ CommentStmt:
 					 * there's a shift/reduce conflict if we do that, so fix it
 					 * up here.
 					 */
-					n->objname = list_make1(makeTypeNameFromNameList($7));
-					n->objargs = list_make1(makeString($4));
+					n->objname = (Node *) list_make2(makeTypeNameFromNameList($7), makeString($4));
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -6207,8 +6211,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_POLICY;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
+					n->objname = (Node *) lappend($6, makeString($4));
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -6216,8 +6219,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_RULE;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
+					n->objname = (Node *) lappend($6, makeString($4));
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -6226,8 +6228,7 @@ CommentStmt:
 					/* 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->objname = (Node *) list_make1(makeString($4));
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6235,8 +6236,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TRANSFORM;
-					n->objname = list_make1($5);
-					n->objargs = list_make1(makeString($7));
+					n->objname = (Node *) list_make2($5, makeString($7));
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -6244,8 +6244,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TRIGGER;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
+					n->objname = (Node *) lappend($6, makeString($4));
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -6253,7 +6252,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_OPCLASS;
-					n->objname = lcons(makeString($7), $5);
+					n->objname = (Node *) lcons(makeString($7), $5);
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -6261,8 +6260,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_OPFAMILY;
-					n->objname = lcons(makeString($7), $5);
-					n->objargs = NIL;
+					n->objname = (Node *) lcons(makeString($7), $5);
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -6270,8 +6268,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_LARGEOBJECT;
-					n->objname = list_make1($5);
-					n->objargs = NIL;
+					n->objname = (Node *) $5;
 					n->comment = $7;
 					$$ = (Node *) n;
 				}
@@ -6279,27 +6276,15 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_CAST;
-					n->objname = list_make1($5);
-					n->objargs = list_make1($7);
+					n->objname = (Node *) list_make2($5, $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_type:
-			ACCESS METHOD						{ $$ = OBJECT_ACCESS_METHOD; }
-			| COLUMN							{ $$ = OBJECT_COLUMN; }
-			| DATABASE							{ $$ = OBJECT_DATABASE; }
-			| SCHEMA							{ $$ = OBJECT_SCHEMA; }
+/* object types taking any_name */
+comment_type1:
+			COLUMN								{ $$ = OBJECT_COLUMN; }
 			| INDEX								{ $$ = OBJECT_INDEX; }
 			| SEQUENCE							{ $$ = OBJECT_SEQUENCE; }
 			| TABLE								{ $$ = OBJECT_TABLE; }
@@ -6307,19 +6292,27 @@ comment_type:
 			| MATERIALIZED VIEW					{ $$ = OBJECT_MATVIEW; }
 			| 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; }
-			| EVENT TRIGGER						{ $$ = OBJECT_EVENT_TRIGGER; }
 			| TEXT_P SEARCH CONFIGURATION		{ $$ = OBJECT_TSCONFIGURATION; }
 			| TEXT_P SEARCH DICTIONARY			{ $$ = OBJECT_TSDICTIONARY; }
 			| TEXT_P SEARCH PARSER				{ $$ = OBJECT_TSPARSER; }
 			| TEXT_P SEARCH TEMPLATE			{ $$ = OBJECT_TSTEMPLATE; }
 		;
 
+/* object types taking name */
+comment_type2:
+			ACCESS METHOD						{ $$ = OBJECT_ACCESS_METHOD; }
+			| DATABASE							{ $$ = OBJECT_DATABASE; }
+			| EVENT TRIGGER						{ $$ = OBJECT_EVENT_TRIGGER; }
+			| EXTENSION							{ $$ = OBJECT_EXTENSION; }
+			| FOREIGN DATA_P WRAPPER			{ $$ = OBJECT_FDW; }
+			| opt_procedural LANGUAGE			{ $$ = OBJECT_LANGUAGE; }
+			| ROLE								{ $$ = OBJECT_ROLE; }
+			| SCHEMA							{ $$ = OBJECT_SCHEMA; }
+			| SERVER							{ $$ = OBJECT_FOREIGN_SERVER; }
+			| TABLESPACE						{ $$ = OBJECT_TABLESPACE; }
+		;
+
 comment_text:
 			Sconst								{ $$ = $1; }
 			| NULL_P							{ $$ = NULL; }
@@ -6336,14 +6329,23 @@ comment_text:
  *****************************************************************************/
 
 SecLabelStmt:
-			SECURITY LABEL opt_provider ON security_label_type any_name
+			SECURITY LABEL opt_provider ON security_label_type1 any_name
 			IS security_label
 				{
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = $5;
-					n->objname = $6;
-					n->objargs = NIL;
+					n->objname = (Node *) $6;
+					n->label = $8;
+					$$ = (Node *) n;
+				}
+			| SECURITY LABEL opt_provider ON security_label_type2 name
+			  IS security_label
+				{
+					SecLabelStmt *n = makeNode(SecLabelStmt);
+					n->provider = $3;
+					n->objtype = $5;
+					n->objname = (Node *) makeString($6);
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6353,8 +6355,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_TYPE;
-					n->objname = list_make1($6);
-					n->objargs = NIL;
+					n->objname = (Node *) $6;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6364,8 +6365,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_TYPE;
-					n->objname = list_make1($6);
-					n->objargs = NIL;
+					n->objname = (Node *) $6;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6375,8 +6375,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $6->funcname;
-					n->objargs = $6->funcargs;
+					n->objname = (Node *) $6;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6386,8 +6385,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_FUNCTION;
-					n->objname = $6->funcname;
-					n->objargs = $6->funcargs;
+					n->objname = (Node *) $6;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6397,19 +6395,7 @@ SecLabelStmt:
 					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->objname = (Node *) $7;
 					n->label = $9;
 					$$ = (Node *) n;
 				}
@@ -6419,20 +6405,26 @@ opt_provider:	FOR NonReservedWord_or_Sconst	{ $$ = $2; }
 				| /* empty */					{ $$ = NULL; }
 		;
 
-security_label_type:
+/* object types taking any_name */
+security_label_type1:
 			COLUMN								{ $$ = OBJECT_COLUMN; }
-			| DATABASE							{ $$ = OBJECT_DATABASE; }
-			| EVENT TRIGGER						{ $$ = OBJECT_EVENT_TRIGGER; }
 			| FOREIGN TABLE						{ $$ = OBJECT_FOREIGN_TABLE; }
-			| SCHEMA							{ $$ = OBJECT_SCHEMA; }
 			| SEQUENCE							{ $$ = OBJECT_SEQUENCE; }
 			| TABLE								{ $$ = OBJECT_TABLE; }
-			| ROLE								{ $$ = OBJECT_ROLE; }
-			| TABLESPACE						{ $$ = OBJECT_TABLESPACE; }
 			| VIEW								{ $$ = OBJECT_VIEW; }
 			| MATERIALIZED VIEW					{ $$ = OBJECT_MATVIEW; }
 		;
 
+/* object types taking name */
+security_label_type2:
+			DATABASE							{ $$ = OBJECT_DATABASE; }
+			| EVENT TRIGGER						{ $$ = OBJECT_EVENT_TRIGGER; }
+			| opt_procedural LANGUAGE			{ $$ = OBJECT_LANGUAGE; }
+			| ROLE								{ $$ = OBJECT_ROLE; }
+			| SCHEMA							{ $$ = OBJECT_SCHEMA; }
+			| TABLESPACE						{ $$ = OBJECT_TABLESPACE; }
+		;
+
 security_label:	Sconst				{ $$ = $1; }
 				| NULL_P			{ $$ = NULL; }
 		;
@@ -7632,8 +7624,7 @@ RemoveFuncStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FUNCTION;
-					n->objects = list_make1($3->funcname);
-					n->arguments = list_make1($3->funcargs);
+					n->objects = list_make1($3);
 					n->behavior = $4;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -7643,8 +7634,7 @@ RemoveFuncStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FUNCTION;
-					n->objects = list_make1($5->funcname);
-					n->arguments = list_make1($5->funcargs);
+					n->objects = list_make1($5);
 					n->behavior = $6;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -7657,8 +7647,7 @@ RemoveAggrStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_AGGREGATE;
-					n->objects = list_make1($3->funcname);
-					n->arguments = list_make1($3->funcargs);
+					n->objects = list_make1($3);
 					n->behavior = $4;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -7668,8 +7657,7 @@ RemoveAggrStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_AGGREGATE;
-					n->objects = list_make1($5->funcname);
-					n->arguments = list_make1($5->funcargs);
+					n->objects = list_make1($5);
 					n->behavior = $6;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -7682,8 +7670,7 @@ RemoveOperStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_OPERATOR;
-					n->objects = list_make1($3->funcname);
-					n->arguments = list_make1($3->funcargs);
+					n->objects = list_make1($3);
 					n->behavior = $4;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -7693,8 +7680,7 @@ RemoveOperStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_OPERATOR;
-					n->objects = list_make1($5->funcname);
-					n->arguments = list_make1($5->funcargs);
+					n->objects = list_make1($5);
 					n->behavior = $6;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -7820,8 +7806,7 @@ DropCastStmt: DROP CAST opt_if_exists '(' Typename AS Typename ')' opt_drop_beha
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_CAST;
-					n->objects = list_make1(list_make1($5));
-					n->arguments = list_make1(list_make1($7));
+					n->objects = list_make1(list_make2($5, $7));
 					n->behavior = $9;
 					n->missing_ok = $3;
 					n->concurrent = false;
@@ -7875,8 +7860,7 @@ DropTransformStmt: DROP TRANSFORM opt_if_exists FOR Typename LANGUAGE name opt_d
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_TRANSFORM;
-					n->objects = list_make1(list_make1($5));
-					n->arguments = list_make1(list_make1(makeString($7)));
+					n->objects = list_make1(list_make2($5, makeString($7)));
 					n->behavior = $8;
 					n->missing_ok = $3;
 					$$ = (Node *)n;
@@ -7983,8 +7967,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_AGGREGATE;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = (Node *) $3;
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -7993,7 +7976,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_COLLATION;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8002,7 +7985,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_CONVERSION;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8020,7 +8003,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_DOMAIN;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8029,7 +8012,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_DOMCONSTRAINT;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->subname = $6;
 					n->newname = $8;
 					$$ = (Node *)n;
@@ -8038,7 +8021,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_FDW;
-					n->object = list_make1(makeString($5));
+					n->object = (Node *) makeString($5);
 					n->newname = $8;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8047,8 +8030,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_FUNCTION;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = (Node *) $3;
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8066,7 +8048,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_LANGUAGE;
-					n->object = list_make1(makeString($4));
+					n->object = (Node *) makeString($4);
 					n->newname = $7;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8075,7 +8057,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_OPCLASS;
-					n->object = lcons(makeString($6), $4);
+					n->object = (Node *) lcons(makeString($6), $4);
 					n->newname = $9;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8084,7 +8066,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_OPFAMILY;
-					n->object = lcons(makeString($6), $4);
+					n->object = (Node *) lcons(makeString($6), $4);
 					n->newname = $9;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8122,7 +8104,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_FOREIGN_SERVER;
-					n->object = list_make1(makeString($3));
+					n->object = (Node *) makeString($3);
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8357,7 +8339,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_EVENT_TRIGGER;
-					n->object = list_make1(makeString($4));
+					n->object = (Node *) makeString($4);
 					n->newname = $7;
 					$$ = (Node *)n;
 				}
@@ -8392,7 +8374,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_TSPARSER;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newname = $8;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8401,7 +8383,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_TSDICTIONARY;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newname = $8;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8410,7 +8392,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_TSTEMPLATE;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newname = $8;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8419,7 +8401,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_TSCONFIGURATION;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newname = $8;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8428,7 +8410,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_TYPE;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8466,9 +8448,7 @@ AlterObjectDependsStmt:
 				{
 					AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
 					n->objectType = OBJECT_FUNCTION;
-					n->relation = NULL;
-					n->objname = $3->funcname;
-					n->objargs = $3->funcargs;
+					n->objname = (Node *) $3;
 					n->extname = makeString($7);
 					$$ = (Node *)n;
 				}
@@ -8477,8 +8457,7 @@ AlterObjectDependsStmt:
 					AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
 					n->objectType = OBJECT_TRIGGER;
 					n->relation = $5;
-					n->objname = list_make1(makeString($3));
-					n->objargs = NIL;
+					n->objname = (Node *) list_make1(makeString($3));
 					n->extname = makeString($9);
 					$$ = (Node *)n;
 				}
@@ -8487,8 +8466,6 @@ AlterObjectDependsStmt:
 					AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
 					n->objectType = OBJECT_MATVIEW;
 					n->relation = $4;
-					n->objname = NIL;
-					n->objargs = NIL;
 					n->extname = makeString($8);
 					$$ = (Node *)n;
 				}
@@ -8497,8 +8474,6 @@ AlterObjectDependsStmt:
 					AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
 					n->objectType = OBJECT_INDEX;
 					n->relation = $3;
-					n->objname = NIL;
-					n->objargs = NIL;
 					n->extname = makeString($7);
 					$$ = (Node *)n;
 				}
@@ -8515,8 +8490,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_AGGREGATE;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8525,7 +8499,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_COLLATION;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8534,7 +8508,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_CONVERSION;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8543,16 +8517,16 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_DOMAIN;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
 				}
-			| ALTER EXTENSION any_name SET SCHEMA name
+			| ALTER EXTENSION name SET SCHEMA name
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_EXTENSION;
-					n->object = $3;
+					n->object = (Node *) makeString($3);
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8561,8 +8535,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_FUNCTION;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8571,8 +8544,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_OPERATOR;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8581,7 +8553,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_OPCLASS;
-					n->object = lcons(makeString($6), $4);
+					n->object = (Node *) lcons(makeString($6), $4);
 					n->newschema = $9;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8590,7 +8562,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_OPFAMILY;
-					n->object = lcons(makeString($6), $4);
+					n->object = (Node *) lcons(makeString($6), $4);
 					n->newschema = $9;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8617,7 +8589,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_TSPARSER;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newschema = $8;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8626,7 +8598,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_TSDICTIONARY;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newschema = $8;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8635,7 +8607,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_TSTEMPLATE;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newschema = $8;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8644,7 +8616,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_TSCONFIGURATION;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newschema = $8;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8725,7 +8697,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_TYPE;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8769,8 +8741,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_AGGREGATE;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8778,7 +8749,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_COLLATION;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8786,7 +8757,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_CONVERSION;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8794,7 +8765,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_DATABASE;
-					n->object = list_make1(makeString($3));
+					n->object = (Node *) makeString($3);
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8802,7 +8773,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_DOMAIN;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8810,8 +8781,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_FUNCTION;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8819,7 +8789,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_LANGUAGE;
-					n->object = list_make1(makeString($4));
+					n->object = (Node *) makeString($4);
 					n->newowner = $7;
 					$$ = (Node *)n;
 				}
@@ -8827,7 +8797,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_LARGEOBJECT;
-					n->object = list_make1($4);
+					n->object = (Node *) $4;
 					n->newowner = $7;
 					$$ = (Node *)n;
 				}
@@ -8835,8 +8805,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_OPERATOR;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8844,7 +8813,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_OPCLASS;
-					n->object = lcons(makeString($6), $4);
+					n->object = (Node *) lcons(makeString($6), $4);
 					n->newowner = $9;
 					$$ = (Node *)n;
 				}
@@ -8852,7 +8821,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_OPFAMILY;
-					n->object = lcons(makeString($6), $4);
+					n->object = (Node *) lcons(makeString($6), $4);
 					n->newowner = $9;
 					$$ = (Node *)n;
 				}
@@ -8860,7 +8829,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_SCHEMA;
-					n->object = list_make1(makeString($3));
+					n->object = (Node *) makeString($3);
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8868,7 +8837,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_TYPE;
-					n->object = $3;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8876,7 +8845,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_TABLESPACE;
-					n->object = list_make1(makeString($3));
+					n->object = (Node *) makeString($3);
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8884,7 +8853,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_TSDICTIONARY;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newowner = $8;
 					$$ = (Node *)n;
 				}
@@ -8892,7 +8861,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_TSCONFIGURATION;
-					n->object = $5;
+					n->object = (Node *) $5;
 					n->newowner = $8;
 					$$ = (Node *)n;
 				}
@@ -8900,7 +8869,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_FDW;
-					n->object = list_make1(makeString($5));
+					n->object = (Node *) makeString($5);
 					n->newowner = $8;
 					$$ = (Node *)n;
 				}
@@ -8908,7 +8877,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_FOREIGN_SERVER;
-					n->object = list_make1(makeString($3));
+					n->object = (Node *) makeString($3);
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8916,7 +8885,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_EVENT_TRIGGER;
-					n->object = list_make1(makeString($4));
+					n->object = (Node *) makeString($4);
 					n->newowner = $7;
 					$$ = (Node *)n;
 				}
@@ -8999,7 +8968,6 @@ DropRuleStmt:
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_RULE;
 					n->objects = list_make1(lappend($5, makeString($3)));
-					n->arguments = NIL;
 					n->behavior = $6;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -9010,7 +8978,6 @@ DropRuleStmt:
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_RULE;
 					n->objects = list_make1(lappend($7, makeString($5)));
-					n->arguments = NIL;
 					n->behavior = $8;
 					n->missing_ok = true;
 					n->concurrent = false;
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 4f74208633..7bdb73cecc 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -948,10 +948,9 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
 			CommentStmt *stmt = makeNode(CommentStmt);
 
 			stmt->objtype = OBJECT_COLUMN;
-			stmt->objname = list_make3(makeString(cxt->relation->schemaname),
-									   makeString(cxt->relation->relname),
-									   makeString(def->colname));
-			stmt->objargs = NIL;
+			stmt->objname = (Node *) list_make3(makeString(cxt->relation->schemaname),
+												makeString(cxt->relation->relname),
+												makeString(def->colname));
 			stmt->comment = comment;
 
 			cxt->alist = lappend(cxt->alist, stmt);
@@ -1014,10 +1013,9 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
 				CommentStmt *stmt = makeNode(CommentStmt);
 
 				stmt->objtype = OBJECT_TABCONSTRAINT;
-				stmt->objname = list_make3(makeString(cxt->relation->schemaname),
-										   makeString(cxt->relation->relname),
-										   makeString(n->conname));
-				stmt->objargs = NIL;
+				stmt->objname = (Node *) list_make3(makeString(cxt->relation->schemaname),
+													makeString(cxt->relation->relname),
+													makeString(n->conname));
 				stmt->comment = comment;
 
 				cxt->alist = lappend(cxt->alist, stmt);
diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h
index 583a1206f3..91bb7d1905 100644
--- a/src/include/catalog/objectaddress.h
+++ b/src/include/catalog/objectaddress.h
@@ -40,17 +40,17 @@ extern const ObjectAddress InvalidObjectAddress;
 #define ObjectAddressSet(addr, class_id, object_id) \
 	ObjectAddressSubSet(addr, class_id, object_id, 0)
 
-extern ObjectAddress get_object_address(ObjectType objtype, List *objname,
-				   List *objargs, Relation *relp,
+extern ObjectAddress get_object_address(ObjectType objtype, Node *objname,
+				   Relation *relp,
 				   LOCKMODE lockmode, bool missing_ok);
 
 extern ObjectAddress get_object_address_rv(ObjectType objtype, RangeVar *rel,
-					  List *objname, List *objargs, Relation *relp,
+					  List *objname, Relation *relp,
 					  LOCKMODE lockmode, bool missing_ok);
 
 extern void check_object_ownership(Oid roleid,
 					   ObjectType objtype, ObjectAddress address,
-					   List *objname, List *objargs, Relation relation);
+					   Node *objname, Relation relation);
 
 extern Oid	get_object_namespace(const ObjectAddress *address);
 
diff --git a/src/include/commands/extension.h b/src/include/commands/extension.h
index c0e08ddf7d..ed9a7aac81 100644
--- a/src/include/commands/extension.h
+++ b/src/include/commands/extension.h
@@ -48,7 +48,7 @@ extern ObjectAddress ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *
 extern Oid	get_extension_oid(const char *extname, bool missing_ok);
 extern char *get_extension_name(Oid ext_oid);
 
-extern ObjectAddress AlterExtensionNamespace(List *names, const char *newschema,
+extern ObjectAddress AlterExtensionNamespace(const char *extensionName, const char *newschema,
 						Oid *oldschema);
 
 extern void AlterExtensionOwner_oid(Oid extensionOid, Oid newOwnerId);
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 9d8ef775e4..9fe6e9ed09 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -2038,8 +2038,7 @@ typedef struct AlterExtensionContentsStmt
 	char	   *extname;		/* Extension's name */
 	int			action;			/* +1 = add object, -1 = drop object */
 	ObjectType	objtype;		/* Object's type */
-	List	   *objname;		/* Qualified name of the object */
-	List	   *objargs;		/* Arguments if needed (eg, for functions) */
+	Node	   *objname;		/* Qualified name of the object */
 } AlterExtensionContentsStmt;
 
 /* ----------------------
@@ -2422,8 +2421,7 @@ typedef struct AlterOpFamilyStmt
 typedef struct DropStmt
 {
 	NodeTag		type;
-	List	   *objects;		/* list of sublists of names (as Values) */
-	List	   *arguments;		/* list of sublists of arguments (as Values) */
+	List	   *objects;		/* list of names */
 	ObjectType	removeType;		/* object type */
 	DropBehavior behavior;		/* RESTRICT or CASCADE behavior */
 	bool		missing_ok;		/* skip error if object is missing? */
@@ -2450,8 +2448,7 @@ typedef struct CommentStmt
 {
 	NodeTag		type;
 	ObjectType	objtype;		/* Object's type */
-	List	   *objname;		/* Qualified name of the object */
-	List	   *objargs;		/* Arguments if needed (eg, for functions) */
+	Node	   *objname;		/* Qualified name of the object */
 	char	   *comment;		/* Comment to insert, or NULL to remove */
 } CommentStmt;
 
@@ -2463,8 +2460,7 @@ typedef struct SecLabelStmt
 {
 	NodeTag		type;
 	ObjectType	objtype;		/* Object's type */
-	List	   *objname;		/* Qualified name of the object */
-	List	   *objargs;		/* Arguments if needed (eg, for functions) */
+	Node	   *objname;		/* Qualified name of the object */
 	char	   *provider;		/* Label provider (or NULL) */
 	char	   *label;			/* New security label to be assigned */
 } SecLabelStmt;
@@ -2638,8 +2634,7 @@ typedef struct RenameStmt
 	ObjectType	renameType;		/* OBJECT_TABLE, OBJECT_COLUMN, etc */
 	ObjectType	relationType;	/* if column name, associated relation type */
 	RangeVar   *relation;		/* in case it's a table */
-	List	   *object;			/* in case it's some other object */
-	List	   *objarg;			/* argument types, if applicable */
+	Node	   *object;			/* in case it's some other object */
 	char	   *subname;		/* name of contained object (column, rule,
 								 * trigger, etc) */
 	char	   *newname;		/* the new name */
@@ -2656,8 +2651,7 @@ typedef struct AlterObjectDependsStmt
 	NodeTag		type;
 	ObjectType	objectType;		/* OBJECT_FUNCTION, OBJECT_TRIGGER, etc */
 	RangeVar   *relation;		/* in case a table is involved */
-	List	   *objname;		/* name of the object */
-	List	   *objargs;		/* argument types, if applicable */
+	Node	   *objname;		/* name of the object */
 	Value	   *extname;		/* extension name */
 } AlterObjectDependsStmt;
 
@@ -2670,8 +2664,7 @@ typedef struct AlterObjectSchemaStmt
 	NodeTag		type;
 	ObjectType	objectType;		/* OBJECT_TABLE, OBJECT_TYPE, etc */
 	RangeVar   *relation;		/* in case it's a table */
-	List	   *object;			/* in case it's some other object */
-	List	   *objarg;			/* argument types, if applicable */
+	Node	   *object;			/* in case it's some other object */
 	char	   *newschema;		/* the new schema */
 	bool		missing_ok;		/* skip error if missing? */
 } AlterObjectSchemaStmt;
@@ -2685,8 +2678,7 @@ typedef struct AlterOwnerStmt
 	NodeTag		type;
 	ObjectType	objectType;		/* OBJECT_TABLE, OBJECT_TYPE, etc */
 	RangeVar   *relation;		/* in case it's a table */
-	List	   *object;			/* in case it's some other object */
-	List	   *objarg;			/* argument types, if applicable */
+	Node	   *object;			/* in case it's some other object */
 	RoleSpec   *newowner;		/* the new owner */
 } AlterOwnerStmt;
 
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index e12455201e..906dcb8b31 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -80,9 +80,6 @@ create event trigger regress_event_trigger2 on ddl_command_start
    execute procedure test_event_trigger();
 -- OK
 comment on event trigger regress_event_trigger is 'test comment';
--- should fail, event triggers are not schema objects
-comment on event trigger wrong.regress_event_trigger is 'test comment';
-ERROR:  event trigger name cannot be qualified
 -- drop as non-superuser should fail
 create role regress_evt_user;
 set role regress_evt_user;
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 7e81cdd087..b1795f6916 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -287,7 +287,7 @@ WARNING:  error for function of access method,{eins,zwei,drei},{integer}: argume
 SELECT pg_get_object_address('language', '{one}', '{}');
 ERROR:  language "one" does not exist
 SELECT pg_get_object_address('language', '{one,two}', '{}');
-ERROR:  language name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('large object', '{123}', '{}');
 ERROR:  large object 123 does not exist
 SELECT pg_get_object_address('large object', '{123,456}', '{}');
@@ -297,39 +297,39 @@ ERROR:  invalid input syntax for type oid: "blargh"
 SELECT pg_get_object_address('schema', '{one}', '{}');
 ERROR:  schema "one" does not exist
 SELECT pg_get_object_address('schema', '{one,two}', '{}');
-ERROR:  schema name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('role', '{one}', '{}');
 ERROR:  role "one" does not exist
 SELECT pg_get_object_address('role', '{one,two}', '{}');
-ERROR:  role name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('database', '{one}', '{}');
 ERROR:  database "one" does not exist
 SELECT pg_get_object_address('database', '{one,two}', '{}');
-ERROR:  database name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('tablespace', '{one}', '{}');
 ERROR:  tablespace "one" does not exist
 SELECT pg_get_object_address('tablespace', '{one,two}', '{}');
-ERROR:  tablespace name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('foreign-data wrapper', '{one}', '{}');
 ERROR:  foreign-data wrapper "one" does not exist
 SELECT pg_get_object_address('foreign-data wrapper', '{one,two}', '{}');
-ERROR:  foreign-data wrapper name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('server', '{one}', '{}');
 ERROR:  server "one" does not exist
 SELECT pg_get_object_address('server', '{one,two}', '{}');
-ERROR:  server name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('extension', '{one}', '{}');
 ERROR:  extension "one" does not exist
 SELECT pg_get_object_address('extension', '{one,two}', '{}');
-ERROR:  extension name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('event trigger', '{one}', '{}');
 ERROR:  event trigger "one" does not exist
 SELECT pg_get_object_address('event trigger', '{one,two}', '{}');
-ERROR:  event trigger name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('access method', '{one}', '{}');
 ERROR:  access method "one" does not exist
 SELECT pg_get_object_address('access method', '{one,two}', '{}');
-ERROR:  access method name cannot be qualified
+ERROR:  name list length must be exactly 1
 -- test successful cases
 WITH objects (type, name, args) AS (VALUES
 				('table', '{addr_nsp, gentable}'::text[], '{}'::text[]),
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 534f532a9e..b65bf3ec66 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -82,9 +82,6 @@
 -- OK
 comment on event trigger regress_event_trigger is 'test comment';
 
--- should fail, event triggers are not schema objects
-comment on event trigger wrong.regress_event_trigger is 'test comment';
-
 -- drop as non-superuser should fail
 create role regress_evt_user;
 set role regress_evt_user;
-- 
2.11.0

