From b3317fe19c74fae5a301bcd3a21212ddf9d77b30 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 v2 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, renamed to
object, 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 ObjectWithArgs node type.  Some of the more obscure object
types still use somewhat arbitrary nested lists.
---
 src/backend/catalog/objectaddress.c          | 447 +++++++++++++++------------
 src/backend/commands/alter.c                 |  33 +-
 src/backend/commands/comment.c               |  11 +-
 src/backend/commands/dropcmds.c              | 175 +++++------
 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                |  16 +-
 src/backend/nodes/equalfuncs.c               |  16 +-
 src/backend/parser/gram.y                    | 436 ++++++++++++--------------
 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 |  24 +-
 src/test/regress/sql/event_trigger.sql       |   3 -
 18 files changed, 608 insertions(+), 633 deletions(-)

diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index cc636e2e3e..b6b3ff3db1 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -707,31 +707,31 @@ 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,
+							   List *object, Relation *relp,
 							   LOCKMODE lockmode, bool missing_ok);
 static ObjectAddress get_object_address_relobject(ObjectType objtype,
-							 List *objname, Relation *relp, bool missing_ok);
+							 List *object, Relation *relp, bool missing_ok);
 static ObjectAddress get_object_address_attribute(ObjectType objtype,
-							 List *objname, Relation *relp,
+							 List *object, Relation *relp,
 							 LOCKMODE lockmode, bool missing_ok);
 static ObjectAddress get_object_address_attrdef(ObjectType objtype,
-						   List *objname, Relation *relp, LOCKMODE lockmode,
+						   List *object, Relation *relp, LOCKMODE lockmode,
 						   bool missing_ok);
 static ObjectAddress get_object_address_type(ObjectType objtype,
-						ListCell *typecell, bool missing_ok);
-static ObjectAddress get_object_address_opcf(ObjectType objtype, List *objname,
+						TypeName *typename, bool missing_ok);
+static ObjectAddress get_object_address_opcf(ObjectType objtype, List *object,
 						bool missing_ok);
 static ObjectAddress get_object_address_opf_member(ObjectType objtype,
-							  List *objname, List *objargs, bool missing_ok);
+							  List *object, bool missing_ok);
 
-static ObjectAddress get_object_address_usermapping(List *objname,
-							   List *objargs, bool missing_ok);
-static ObjectAddress get_object_address_publication_rel(List *objname,
-								   List *objargs, Relation *relp,
+static ObjectAddress get_object_address_usermapping(List *object,
+							   bool missing_ok);
+static ObjectAddress get_object_address_publication_rel(List *object,
+								   Relation *relp,
 								   bool missing_ok);
-static ObjectAddress get_object_address_defacl(List *objname, List *objargs,
+static ObjectAddress get_object_address_defacl(List *object,
 						  bool missing_ok);
 static const ObjectPropertyType *get_object_property_data(Oid class_id);
 
@@ -741,8 +741,8 @@ static void getRelationTypeDescription(StringInfo buffer, Oid relid,
 						   int32 objectSubId);
 static void getProcedureTypeDescription(StringInfo buffer, Oid procid);
 static void getConstraintTypeDescription(StringInfo buffer, Oid constroid);
-static void getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **objname);
-static void getRelationIdentity(StringInfo buffer, Oid relid, List **objname);
+static void getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **object);
+static void getRelationIdentity(StringInfo buffer, Oid relid, List **object);
 
 /*
  * Translate an object name and arguments (as passed by the parser) to an
@@ -776,7 +776,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 *object,
 				   Relation *relp, LOCKMODE lockmode, bool missing_ok)
 {
 	ObjectAddress address;
@@ -806,19 +806,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, castNode(List, object),
 												   &relation, lockmode,
 												   missing_ok);
 				break;
 			case OBJECT_COLUMN:
 				address =
-					get_object_address_attribute(objtype, objname,
+					get_object_address_attribute(objtype, castNode(List, object),
 												 &relation, lockmode,
 												 missing_ok);
 				break;
 			case OBJECT_DEFAULT:
 				address =
-					get_object_address_attrdef(objtype, objname,
+					get_object_address_attrdef(objtype, castNode(List, object),
 											   &relation, lockmode,
 											   missing_ok);
 				break;
@@ -826,17 +826,20 @@ 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, castNode(List, object),
 													   &relation, missing_ok);
 				break;
 			case OBJECT_DOMCONSTRAINT:
 				{
+					List	   *objlist;
 					ObjectAddress domaddr;
 					char	   *constrname;
 
+					objlist = castNode(List, object);
 					domaddr = get_object_address_type(OBJECT_DOMAIN,
-											 list_head(objname), missing_ok);
-					constrname = strVal(linitial(objargs));
+													  castNode(TypeName, linitial(objlist)),
+													  missing_ok);
+					constrname = strVal(lsecond(objlist));
 
 					address.classId = ConstraintRelationId;
 					address.objectId = get_domain_constraint_oid(domaddr.objectId,
@@ -858,57 +861,64 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 			case OBJECT_PUBLICATION:
 			case OBJECT_SUBSCRIPTION:
 				address = get_object_address_unqualified(objtype,
-														 objname, missing_ok);
+														 (Value *) object, 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, castNode(TypeName, object), missing_ok);
 				break;
 			case OBJECT_AGGREGATE:
-				address.classId = ProcedureRelationId;
-				address.objectId =
-					LookupAggNameTypeNames(objname, objargs, missing_ok);
-				address.objectSubId = 0;
-				break;
+				{
+					ObjectWithArgs *owa = castNode(ObjectWithArgs, object);
+					address.classId = ProcedureRelationId;
+					address.objectId =
+						LookupAggNameTypeNames(owa->objname, owa->objargs, missing_ok);
+					address.objectSubId = 0;
+					break;
+				}
 			case OBJECT_FUNCTION:
-				address.classId = ProcedureRelationId;
-				address.objectId =
-					LookupFuncNameTypeNames(objname, objargs, missing_ok);
-				address.objectSubId = 0;
-				break;
+				{
+					ObjectWithArgs *owa = castNode(ObjectWithArgs, object);
+					address.classId = ProcedureRelationId;
+					address.objectId =
+						LookupFuncNameTypeNames(owa->objname, owa->objargs, 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;
+				{
+					ObjectWithArgs *owa = castNode(ObjectWithArgs, object);
+					address.classId = OperatorRelationId;
+					Assert(list_length(owa->objargs) == 2);
+					address.objectId =
+						LookupOperNameTypeNames(NULL, owa->objname,
+												castNode(TypeName, linitial(owa->objargs)),
+												castNode(TypeName, lsecond(owa->objargs)),
+												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(castNode(List, object), 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(castNode(List, object), 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, castNode(List, object), 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, castNode(List, object), missing_ok);
 				break;
 			case OBJECT_LARGEOBJECT:
-				Assert(list_length(objname) == 1);
 				address.classId = LargeObjectRelationId;
-				address.objectId = oidparse(linitial(objname));
+				address.objectId = oidparse(object);
 				address.objectSubId = 0;
 				if (!LargeObjectExists(address.objectId))
 				{
@@ -921,8 +931,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 = castNode(TypeName, linitial(castNode(List, object)));
+					TypeName   *targettype = castNode(TypeName, lsecond(castNode(List, object)));
 					Oid			sourcetypeid;
 					Oid			targettypeid;
 
@@ -936,8 +946,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 = castNode(TypeName, linitial(castNode(List, object)));
+					char	   *langname = strVal(lsecond(castNode(List, object)));
 					Oid			type_id = LookupTypeNameOid(NULL, typename, missing_ok);
 					Oid			lang_id = get_language_oid(langname, missing_ok);
 
@@ -949,35 +959,35 @@ 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(castNode(List, object), 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(castNode(List, object), 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(castNode(List, object), 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(castNode(List, object), missing_ok);
 				address.objectSubId = 0;
 				break;
 			case OBJECT_USER_MAPPING:
-				address = get_object_address_usermapping(objname, objargs,
+				address = get_object_address_usermapping(castNode(List, object),
 														 missing_ok);
 				break;
 			case OBJECT_PUBLICATION_REL:
-				address = get_object_address_publication_rel(objname, objargs,
+				address = get_object_address_publication_rel(castNode(List, object),
 															 &relation,
 															 missing_ok);
 				break;
 			case OBJECT_DEFACL:
-				address = get_object_address_defacl(objname, objargs,
+				address = get_object_address_defacl(castNode(List, object),
 													missing_ok);
 				break;
 			default:
@@ -1068,25 +1078,25 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 /*
  * Return an ObjectAddress based on a RangeVar and an object name. The
  * name of the relation identified by the RangeVar is prepended to the
- * (possibly empty) list passed in as objname. This is useful to find
+ * (possibly empty) list passed in as object. This is useful to find
  * the ObjectAddress of objects that depend on a relation. All other
  * considerations are exactly as for get_object_address above.
  */
 ObjectAddress
-get_object_address_rv(ObjectType objtype, RangeVar *rel, List *objname,
-					  List *objargs, Relation *relp, LOCKMODE lockmode,
+get_object_address_rv(ObjectType objtype, RangeVar *rel, List *object,
+					  Relation *relp, LOCKMODE lockmode,
 					  bool missing_ok)
 {
 	if (rel)
 	{
-		objname = lcons(makeString(rel->relname), objname);
+		object = lcons(makeString(rel->relname), object);
 		if (rel->schemaname)
-			objname = lcons(makeString(rel->schemaname), objname);
+			object = lcons(makeString(rel->schemaname), object);
 		if (rel->catalogname)
-			objname = lcons(makeString(rel->catalogname), objname);
+			object = lcons(makeString(rel->catalogname), object);
 	}
 
-	return get_object_address(objtype, objname, objargs,
+	return get_object_address(objtype, (Node *) object,
 							  relp, lockmode, missing_ok);
 }
 
@@ -1096,68 +1106,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;
-			case OBJECT_PUBLICATION:
-				msg = gettext_noop("publication name cannot be qualified");
-				break;
-			case OBJECT_SUBSCRIPTION:
-				msg = gettext_noop("subscription 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)
@@ -1237,7 +1191,7 @@ get_object_address_unqualified(ObjectType objtype,
  * Locate a relation by qualified name.
  */
 static ObjectAddress
-get_relation_by_qualified_name(ObjectType objtype, List *objname,
+get_relation_by_qualified_name(ObjectType objtype, List *object,
 							   Relation *relp, LOCKMODE lockmode,
 							   bool missing_ok)
 {
@@ -1248,7 +1202,7 @@ get_relation_by_qualified_name(ObjectType objtype, List *objname,
 	address.objectId = InvalidOid;
 	address.objectSubId = 0;
 
-	relation = relation_openrv_extended(makeRangeVarFromNameList(objname),
+	relation = relation_openrv_extended(makeRangeVarFromNameList(object),
 										lockmode, missing_ok);
 	if (!relation)
 		return address;
@@ -1318,7 +1272,7 @@ get_relation_by_qualified_name(ObjectType objtype, List *objname,
  * mode for the object itself, not the relation to which it is attached.
  */
 static ObjectAddress
-get_object_address_relobject(ObjectType objtype, List *objname,
+get_object_address_relobject(ObjectType objtype, List *object,
 							 Relation *relp, bool missing_ok)
 {
 	ObjectAddress address;
@@ -1329,17 +1283,17 @@ get_object_address_relobject(ObjectType objtype, List *objname,
 	Oid			reloid;
 
 	/* Extract name of dependent object. */
-	depname = strVal(llast(objname));
+	depname = strVal(llast(object));
 
 	/* Separate relation name from dependent object name. */
-	nnames = list_length(objname);
+	nnames = list_length(object);
 	if (nnames < 2)
 		ereport(ERROR,
 				(errcode(ERRCODE_SYNTAX_ERROR),
 				 errmsg("must specify relation and object name")));
 
 	/* Extract relation name and open relation. */
-	relname = list_truncate(list_copy(objname), nnames - 1);
+	relname = list_truncate(list_copy(object), nnames - 1);
 	relation = heap_openrv_extended(makeRangeVarFromNameList(relname),
 									AccessShareLock,
 									missing_ok);
@@ -1397,7 +1351,7 @@ get_object_address_relobject(ObjectType objtype, List *objname,
  * Find the ObjectAddress for an attribute.
  */
 static ObjectAddress
-get_object_address_attribute(ObjectType objtype, List *objname,
+get_object_address_attribute(ObjectType objtype, List *object,
 							 Relation *relp, LOCKMODE lockmode,
 							 bool missing_ok)
 {
@@ -1409,12 +1363,12 @@ get_object_address_attribute(ObjectType objtype, List *objname,
 	AttrNumber	attnum;
 
 	/* Extract relation name and open relation. */
-	if (list_length(objname) < 2)
+	if (list_length(object) < 2)
 		ereport(ERROR,
 				(errcode(ERRCODE_SYNTAX_ERROR),
 				 errmsg("column name must be qualified")));
-	attname = strVal(lfirst(list_tail(objname)));
-	relname = list_truncate(list_copy(objname), list_length(objname) - 1);
+	attname = strVal(lfirst(list_tail(object)));
+	relname = list_truncate(list_copy(object), list_length(object) - 1);
 	/* XXX no missing_ok support here */
 	relation = relation_openrv(makeRangeVarFromNameList(relname), lockmode);
 	reloid = RelationGetRelid(relation);
@@ -1448,7 +1402,7 @@ get_object_address_attribute(ObjectType objtype, List *objname,
  * Find the ObjectAddress for an attribute's default value.
  */
 static ObjectAddress
-get_object_address_attrdef(ObjectType objtype, List *objname,
+get_object_address_attrdef(ObjectType objtype, List *object,
 						   Relation *relp, LOCKMODE lockmode,
 						   bool missing_ok)
 {
@@ -1462,12 +1416,12 @@ get_object_address_attrdef(ObjectType objtype, List *objname,
 	Oid			defoid;
 
 	/* Extract relation name and open relation. */
-	if (list_length(objname) < 2)
+	if (list_length(object) < 2)
 		ereport(ERROR,
 				(errcode(ERRCODE_SYNTAX_ERROR),
 				 errmsg("column name must be qualified")));
-	attname = strVal(llast(objname));
-	relname = list_truncate(list_copy(objname), list_length(objname) - 1);
+	attname = strVal(llast(object));
+	relname = list_truncate(list_copy(object), list_length(object) - 1);
 	/* XXX no missing_ok support here */
 	relation = relation_openrv(makeRangeVarFromNameList(relname), lockmode);
 	reloid = RelationGetRelid(relation);
@@ -1530,14 +1484,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;
@@ -1572,25 +1523,25 @@ get_object_address_type(ObjectType objtype, ListCell *typecell, bool missing_ok)
  * Find the ObjectAddress for an opclass or opfamily.
  */
 static ObjectAddress
-get_object_address_opcf(ObjectType objtype, List *objname, bool missing_ok)
+get_object_address_opcf(ObjectType objtype, List *object, bool missing_ok)
 {
 	Oid			amoid;
 	ObjectAddress address;
 
 	/* XXX no missing_ok support here */
-	amoid = get_index_am_oid(strVal(linitial(objname)), false);
-	objname = list_copy_tail(objname, 1);
+	amoid = get_index_am_oid(strVal(linitial(object)), false);
+	object = list_copy_tail(object, 1);
 
 	switch (objtype)
 	{
 		case OBJECT_OPCLASS:
 			address.classId = OperatorClassRelationId;
-			address.objectId = get_opclass_oid(amoid, objname, missing_ok);
+			address.objectId = get_opclass_oid(amoid, object, missing_ok);
 			address.objectSubId = 0;
 			break;
 		case OBJECT_OPFAMILY:
 			address.classId = OperatorFamilyRelationId;
-			address.objectId = get_opfamily_oid(amoid, objname, missing_ok);
+			address.objectId = get_opfamily_oid(amoid, object, missing_ok);
 			address.objectSubId = 0;
 			break;
 		default:
@@ -1611,7 +1562,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 *object, bool missing_ok)
 {
 	ObjectAddress famaddr;
 	ObjectAddress address;
@@ -1623,24 +1574,24 @@ get_object_address_opf_member(ObjectType objtype,
 	int			i;
 
 	/*
-	 * The last element of the objname list contains the strategy or procedure
+	 * The last element of the object list contains the strategy or procedure
 	 * 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(object))));
+	copy = list_truncate(list_copy(linitial(object)), list_length(linitial(object)) - 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(object))
 	{
 		ObjectAddress typaddr;
 
 		typenames[i] = strVal(lfirst(cell));
-		typaddr = get_object_address_type(OBJECT_TYPE, cell, missing_ok);
+		typaddr = get_object_address_type(OBJECT_TYPE, castNode(TypeName, lfirst(cell)), missing_ok);
 		typeoids[i] = typaddr.objectId;
 		if (++i >= 2)
 			break;
@@ -1716,7 +1667,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 *object, bool missing_ok)
 {
 	ObjectAddress address;
 	Oid			userid;
@@ -1728,8 +1679,8 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
 	ObjectAddressSet(address, UserMappingRelationId, InvalidOid);
 
 	/* fetch string names from input lists, for error messages */
-	username = strVal(linitial(objname));
-	servername = strVal(linitial(objargs));
+	username = strVal(linitial(object));
+	servername = strVal(lsecond(object));
 
 	/* look up pg_authid OID of mapped user; InvalidOid if PUBLIC */
 	if (strcmp(username, "public") == 0)
@@ -1782,27 +1733,30 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
 }
 
 /*
- * Find the ObjectAddress for a publication relation.  The objname parameter
- * is the relation name; objargs contains the publication name.
+ * Find the ObjectAddress for a publication relation.  The first element of
+ * the object parameter is the relation name, the second is the
+ * publication name.
  */
 static ObjectAddress
-get_object_address_publication_rel(List *objname, List *objargs,
+get_object_address_publication_rel(List *object,
 								   Relation *relp, bool missing_ok)
 {
 	ObjectAddress address;
 	Relation	relation;
+	List	   *relname;
 	char	   *pubname;
 	Publication *pub;
 
 	ObjectAddressSet(address, PublicationRelRelationId, InvalidOid);
 
-	relation = relation_openrv_extended(makeRangeVarFromNameList(objname),
+	relname = linitial(object);
+	relation = relation_openrv_extended(makeRangeVarFromNameList(relname),
 										 AccessShareLock, missing_ok);
 	if (!relation)
 		return address;
 
 	/* fetch publication name from input list */
-	pubname = strVal(linitial(objargs));
+	pubname = strVal(lsecond(object));
 
 	/* Now look up the pg_publication tuple */
 	pub = GetPublicationByName(pubname, missing_ok);
@@ -1836,7 +1790,7 @@ get_object_address_publication_rel(List *objname, List *objargs,
  * 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 *object, bool missing_ok)
 {
 	HeapTuple	tp;
 	Oid			userid;
@@ -1853,9 +1807,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(object));
+	if (list_length(object) >= 3)
+		schema = (char *) strVal(lthird(object));
 	else
 		schema = NULL;
 
@@ -1863,7 +1817,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(object)))[0];
 	switch (objtype)
 	{
 		case DEFACLOBJ_RELATION:
@@ -1978,8 +1932,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];
@@ -2017,7 +1973,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)
 	{
@@ -2035,7 +1991,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
 	{
@@ -2123,7 +2079,96 @@ 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_PUBLICATION:
+		case OBJECT_ROLE:
+		case OBJECT_SCHEMA:
+		case OBJECT_SUBSCRIPTION:
+		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_PUBLICATION_REL:
+			objnode = (Node *) list_make2(name, 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:
+		{
+			ObjectWithArgs *owa = makeNode(ObjectWithArgs);
+
+			owa->objname = name;
+			owa->objargs = args;
+			objnode = (Node *) owa;
+			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 */
@@ -2156,7 +2201,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 *object, Relation relation)
 {
 	switch (objtype)
 	{
@@ -2178,7 +2223,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 *) object));
 			break;
 		case OBJECT_TYPE:
 		case OBJECT_DOMAIN:
@@ -2191,62 +2236,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((castNode(ObjectWithArgs, object))->objname));
 			break;
 		case OBJECT_OPERATOR:
 			if (!pg_oper_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_OPER,
-							   NameListToString(objname));
+							   NameListToString((castNode(ObjectWithArgs, object))->objname));
 			break;
 		case OBJECT_SCHEMA:
 			if (!pg_namespace_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_NAMESPACE,
-							   NameListToString(objname));
+							   strVal((Value *) object));
 			break;
 		case OBJECT_COLLATION:
 			if (!pg_collation_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_COLLATION,
-							   NameListToString(objname));
+							   NameListToString(castNode(List, object)));
 			break;
 		case OBJECT_CONVERSION:
 			if (!pg_conversion_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_CONVERSION,
-							   NameListToString(objname));
+							   NameListToString(castNode(List, object)));
 			break;
 		case OBJECT_EXTENSION:
 			if (!pg_extension_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_EXTENSION,
-							   NameListToString(objname));
+							   strVal((Value *) object));
 			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 *) object));
 			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 *) object));
 			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 *) object));
 			break;
 		case OBJECT_LANGUAGE:
 			if (!pg_language_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_LANGUAGE,
-							   NameListToString(objname));
+							   strVal((Value *) object));
 			break;
 		case OBJECT_OPCLASS:
 			if (!pg_opclass_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_OPCLASS,
-							   NameListToString(objname));
+							   NameListToString(castNode(List, object)));
 			break;
 		case OBJECT_OPFAMILY:
 			if (!pg_opfamily_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_OPFAMILY,
-							   NameListToString(objname));
+							   NameListToString(castNode(List, object)));
 			break;
 		case OBJECT_LARGEOBJECT:
 			if (!lo_compat_privileges &&
@@ -2259,8 +2304,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 = castNode(TypeName, linitial(castNode(List, object)));
+				TypeName   *targettype = castNode(TypeName, lsecond(castNode(List, object)));
 				Oid			sourcetypeid = typenameTypeId(NULL, sourcetype);
 				Oid			targettypeid = typenameTypeId(NULL, targettype);
 
@@ -2276,16 +2321,16 @@ check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
 		case OBJECT_PUBLICATION:
 			if (!pg_publication_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_PUBLICATION,
-							   NameListToString(objname));
+							   strVal((Value *) object));
 			break;
 		case OBJECT_SUBSCRIPTION:
 			if (!pg_subscription_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_SUBSCRIPTION,
-							   NameListToString(objname));
+							   strVal((Value *) object));
 			break;
 		case OBJECT_TRANSFORM:
 			{
-				TypeName   *typename = (TypeName *) linitial(objname);
+				TypeName   *typename = castNode(TypeName, linitial(castNode(List, object)));
 				Oid			typeid = typenameTypeId(NULL, typename);
 
 				if (!pg_type_ownercheck(typeid, roleid))
@@ -2295,17 +2340,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 *) object));
 			break;
 		case OBJECT_TSDICTIONARY:
 			if (!pg_ts_dict_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TSDICTIONARY,
-							   NameListToString(objname));
+							   NameListToString(castNode(List, object)));
 			break;
 		case OBJECT_TSCONFIGURATION:
 			if (!pg_ts_config_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TSCONFIGURATION,
-							   NameListToString(objname));
+							   NameListToString(castNode(List, object)));
 			break;
 		case OBJECT_ROLE:
 
@@ -4868,7 +4913,7 @@ getObjectIdentityParts(const ObjectAddress *object,
 }
 
 static void
-getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **objname)
+getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **object)
 {
 	HeapTuple	opfTup;
 	Form_pg_opfamily opfForm;
@@ -4893,8 +4938,8 @@ getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **objname)
 												NameStr(opfForm->opfname)),
 					 NameStr(amForm->amname));
 
-	if (objname)
-		*objname = list_make3(pstrdup(NameStr(amForm->amname)),
+	if (object)
+		*object = list_make3(pstrdup(NameStr(amForm->amname)),
 							  pstrdup(schema),
 							  pstrdup(NameStr(opfForm->opfname)));
 
@@ -4907,7 +4952,7 @@ getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **objname)
  * StringInfo.
  */
 static void
-getRelationIdentity(StringInfo buffer, Oid relid, List **objname)
+getRelationIdentity(StringInfo buffer, Oid relid, List **object)
 {
 	HeapTuple	relTup;
 	Form_pg_class relForm;
@@ -4923,8 +4968,8 @@ getRelationIdentity(StringInfo buffer, Oid relid, List **objname)
 	appendStringInfoString(buffer,
 						   quote_qualified_identifier(schema,
 												 NameStr(relForm->relname)));
-	if (objname)
-		*objname = list_make2(schema, pstrdup(NameStr(relForm->relname)));
+	if (object)
+		*object = list_make2(schema, pstrdup(NameStr(relForm->relname)));
 
 	ReleaseSysCache(relTup);
 }
diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c
index d6195e49f5..77ffe65b25 100644
--- a/src/backend/commands/alter.c
+++ b/src/backend/commands/alter.c
@@ -370,7 +370,7 @@ ExecRenameStmt(RenameStmt *stmt)
 				Relation	relation;
 
 				address = get_object_address(stmt->renameType,
-											 stmt->object, stmt->objarg,
+											 stmt->object,
 											 &relation,
 											 AccessExclusiveLock, false);
 				Assert(relation == NULL);
@@ -406,8 +406,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->object,
+							&rel, AccessExclusiveLock, false);
 
 	/*
 	 * If a relation was involved, it would have been opened and locked. We
@@ -416,8 +416,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;
@@ -446,7 +446,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;
 
@@ -461,7 +461,7 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt,
 
 		case OBJECT_DOMAIN:
 		case OBJECT_TYPE:
-			address = AlterTypeNamespace(stmt->object, stmt->newschema,
+			address = AlterTypeNamespace(castNode(List, stmt->object), stmt->newschema,
 										 stmt->objectType,
 										 oldSchemaAddr ? &oldNspOid : NULL);
 			break;
@@ -486,7 +486,6 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt,
 
 				address = get_object_address(stmt->objectType,
 											 stmt->object,
-											 stmt->objarg,
 											 &relation,
 											 AccessExclusiveLock,
 											 false);
@@ -749,33 +748,34 @@ 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(castNode(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);
 
 		case OBJECT_PUBLICATION:
-			return AlterPublicationOwner(strVal(linitial(stmt->object)),
+			return AlterPublicationOwner(strVal((Value *) stmt->object),
 										 newowner);
 
 		case OBJECT_SUBSCRIPTION:
-			return AlterSubscriptionOwner(strVal(linitial(stmt->object)),
+			return AlterSubscriptionOwner(strVal((Value *) stmt->object),
 										  newowner);
 
 			/* Generic cases */
@@ -799,7 +799,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 87ca62f240..b5569bddaf 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->object);
 
 		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->object,
 								 &relation, ShareUpdateExclusiveLock, false);
 
 	/* Require ownership of the target object. */
 	check_object_ownership(GetUserId(), stmt->objtype, address,
-						   stmt->objname, stmt->objargs, relation);
+						   stmt->object, 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 ff3108ce72..ab73fbf961 100644
--- a/src/backend/commands/dropcmds.c
+++ b/src/backend/commands/dropcmds.c
@@ -30,10 +30,10 @@
 
 
 static void does_not_exist_skipping(ObjectType objtype,
-						List *objname, List *objargs);
-static bool owningrel_does_not_exist_skipping(List *objname,
+						Node *object);
+static bool owningrel_does_not_exist_skipping(List *object,
 								  const char **msg, char **name);
-static bool schema_does_not_exist_skipping(List *objname,
+static bool schema_does_not_exist_skipping(List *object,
 							   const char **msg, char **name);
 static bool type_in_list_does_not_exist_skipping(List *typenames,
 									 const char **msg, char **name);
@@ -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	   *object = 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,
+									 object,
 									 &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, object);
 			continue;
 		}
 
@@ -110,7 +102,7 @@ RemoveObjects(DropStmt *stmt)
 				ereport(ERROR,
 						(errcode(ERRCODE_WRONG_OBJECT_TYPE),
 						 errmsg("\"%s\" is an aggregate function",
-								NameListToString(objname)),
+								NameListToString(castNode(ObjectWithArgs, object)->objname)),
 				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);
+								   object, relation);
 
 		/* Release any relcache reference count, but keep lock until commit. */
 		if (relation)
@@ -147,23 +139,23 @@ RemoveObjects(DropStmt *stmt)
  * exist, fill the error message format string and name, and return true.
  */
 static bool
-owningrel_does_not_exist_skipping(List *objname, const char **msg, char **name)
+owningrel_does_not_exist_skipping(List *object, const char **msg, char **name)
 {
-	List	   *parent_objname;
+	List	   *parent_object;
 	RangeVar   *parent_rel;
 
-	parent_objname = list_truncate(list_copy(objname),
-								   list_length(objname) - 1);
+	parent_object = list_truncate(list_copy(object),
+								   list_length(object) - 1);
 
-	if (schema_does_not_exist_skipping(parent_objname, msg, name))
+	if (schema_does_not_exist_skipping(parent_object, msg, name))
 		return true;
 
-	parent_rel = makeRangeVarFromNameList(parent_objname);
+	parent_rel = makeRangeVarFromNameList(parent_object);
 
 	if (!OidIsValid(RangeVarGetRelid(parent_rel, NoLock, true)))
 	{
 		*msg = gettext_noop("relation \"%s\" does not exist, skipping");
-		*name = NameListToString(parent_objname);
+		*name = NameListToString(parent_object);
 
 		return true;
 	}
@@ -183,11 +175,11 @@ owningrel_does_not_exist_skipping(List *objname, const char **msg, char **name)
  * specified schema name, and return true.
  */
 static bool
-schema_does_not_exist_skipping(List *objname, const char **msg, char **name)
+schema_does_not_exist_skipping(List *object, const char **msg, char **name)
 {
 	RangeVar   *rel;
 
-	rel = makeRangeVarFromNameList(objname);
+	rel = makeRangeVarFromNameList(object);
 
 	if (rel->schemaname != NULL &&
 		!OidIsValid(LookupNamespaceNoError(rel->schemaname)))
@@ -252,7 +244,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 *object)
 {
 	const char *msg = NULL;
 	char	   *name = NULL;
@@ -262,12 +254,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 *) object);
 			break;
 		case OBJECT_TYPE:
 		case OBJECT_DOMAIN:
 			{
-				TypeName   *typ = linitial(objname);
+				TypeName   *typ = castNode(TypeName, object);
 
 				if (!schema_does_not_exist_skipping(typ->names, &msg, &name))
 				{
@@ -277,171 +269,180 @@ 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(castNode(List, object), &msg, &name))
 			{
 				msg = gettext_noop("collation \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString(castNode(List, object));
 			}
 			break;
 		case OBJECT_CONVERSION:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping(castNode(List, object), &msg, &name))
 			{
 				msg = gettext_noop("conversion \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString(castNode(List, object));
 			}
 			break;
 		case OBJECT_SCHEMA:
 			msg = gettext_noop("schema \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) object);
 			break;
 		case OBJECT_TSPARSER:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping(castNode(List, object), &msg, &name))
 			{
 				msg = gettext_noop("text search parser \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString(castNode(List, object));
 			}
 			break;
 		case OBJECT_TSDICTIONARY:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping(castNode(List, object), &msg, &name))
 			{
 				msg = gettext_noop("text search dictionary \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString(castNode(List, object));
 			}
 			break;
 		case OBJECT_TSTEMPLATE:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping(castNode(List, object), &msg, &name))
 			{
 				msg = gettext_noop("text search template \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString(castNode(List, object));
 			}
 			break;
 		case OBJECT_TSCONFIGURATION:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name))
+			if (!schema_does_not_exist_skipping(castNode(List, object), &msg, &name))
 			{
 				msg = gettext_noop("text search configuration \"%s\" does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString(castNode(List, object));
 			}
 			break;
 		case OBJECT_EXTENSION:
 			msg = gettext_noop("extension \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) object);
 			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);
+				ObjectWithArgs *owa = castNode(ObjectWithArgs, object);
+				if (!schema_does_not_exist_skipping(owa->objname, &msg, &name) &&
+					!type_in_list_does_not_exist_skipping(owa->objargs, &msg, &name))
+				{
+					msg = gettext_noop("function %s(%s) does not exist, skipping");
+					name = NameListToString(owa->objname);
+					args = TypeNameListToString(owa->objargs);
+				}
+				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);
+				ObjectWithArgs *owa = castNode(ObjectWithArgs, object);
+				if (!schema_does_not_exist_skipping(owa->objname, &msg, &name) &&
+					!type_in_list_does_not_exist_skipping(owa->objargs, &msg, &name))
+				{
+					msg = gettext_noop("aggregate %s(%s) does not exist, skipping");
+					name = NameListToString(owa->objname);
+					args = TypeNameListToString(owa->objargs);
+				}
+				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);
+				ObjectWithArgs *owa = castNode(ObjectWithArgs, object);
+				if (!schema_does_not_exist_skipping(owa->objname, &msg, &name) &&
+					!type_in_list_does_not_exist_skipping(owa->objargs, &msg, &name))
+				{
+					msg = gettext_noop("operator %s does not exist, skipping");
+					name = NameListToString(owa->objname);
+				}
+				break;
 			}
-			break;
 		case OBJECT_LANGUAGE:
 			msg = gettext_noop("language \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) object);
 			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(castNode(List, object))), &msg, &name) &&
+					!type_in_list_does_not_exist_skipping(list_make1(lsecond(castNode(List, object))), &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(castNode(TypeName, linitial(castNode(List, object))));
+					args = TypeNameToString(castNode(TypeName, lsecond(castNode(List, object))));
 				}
 			}
 			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(castNode(List, object))), &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(castNode(TypeName, linitial(castNode(List, object))));
+				args = strVal(lsecond(castNode(List, object)));
 			}
 			break;
 		case OBJECT_TRIGGER:
-			if (!owningrel_does_not_exist_skipping(objname, &msg, &name))
+			if (!owningrel_does_not_exist_skipping(castNode(List, object), &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(castNode(List, object)));
+				args = NameListToString(list_truncate(list_copy(castNode(List, object)),
+													  list_length(castNode(List, object)) - 1));
 			}
 			break;
 		case OBJECT_POLICY:
-			if (!owningrel_does_not_exist_skipping(objname, &msg, &name))
+			if (!owningrel_does_not_exist_skipping(castNode(List, object), &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(castNode(List, object)));
+				args = NameListToString(list_truncate(list_copy(castNode(List, object)),
+													  list_length(castNode(List, object)) - 1));
 			}
 			break;
 		case OBJECT_EVENT_TRIGGER:
 			msg = gettext_noop("event trigger \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) object);
 			break;
 		case OBJECT_RULE:
-			if (!owningrel_does_not_exist_skipping(objname, &msg, &name))
+			if (!owningrel_does_not_exist_skipping(castNode(List, object), &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(castNode(List, object)));
+				args = NameListToString(list_truncate(list_copy(castNode(List, object)),
+													  list_length(castNode(List, object)) - 1));
 			}
 			break;
 		case OBJECT_FDW:
 			msg = gettext_noop("foreign-data wrapper \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) object);
 			break;
 		case OBJECT_FOREIGN_SERVER:
 			msg = gettext_noop("server \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) object);
 			break;
 		case OBJECT_OPCLASS:
 			{
-				List	   *opcname = list_copy_tail(objname, 1);
+				List	   *opcname = list_copy_tail(castNode(List, object), 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(castNode(List, object)));
 				}
 			}
 			break;
 		case OBJECT_OPFAMILY:
 			{
-				List	   *opfname = list_copy_tail(objname, 1);
+				List	   *opfname = list_copy_tail(castNode(List, object), 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(castNode(List, object)));
 				}
 			}
 			break;
 		case OBJECT_PUBLICATION:
 			msg = gettext_noop("publication \"%s\" does not exist, skipping");
-			name = NameListToString(objname);
+			name = strVal((Value *) object);
 			break;
 		default:
 			elog(ERROR, "unrecognized object type: %d", (int) objtype);
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index 325f5b74b8..585fcce98e 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -2672,9 +2672,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;
@@ -2690,12 +2689,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);
@@ -3191,7 +3184,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->object,
 								&relation, ShareUpdateExclusiveLock, false);
 
 	Assert(object.objectSubId == 0);
@@ -3200,7 +3193,7 @@ ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
 
 	/* Permission check: must own target object, too */
 	check_object_ownership(GetUserId(), stmt->objtype, object,
-						   stmt->objname, stmt->objargs, relation);
+						   stmt->object, relation);
 
 	/*
 	 * Check existing extension membership.
diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c
index 422da8b6b0..5f16d6cf1c 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->object,
 								 &relation, ShareUpdateExclusiveLock, false);
 
 	/* Require ownership of the target object. */
 	check_object_ownership(GetUserId(), stmt->objtype, address,
-						   stmt->objname, stmt->objargs, relation);
+						   stmt->object, 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 3cea220421..4421afe5ba 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -2766,7 +2766,7 @@ RenameConstraint(RenameStmt *stmt)
 		Relation	rel;
 		HeapTuple	tup;
 
-		typid = typenameTypeId(NULL, makeTypeNameFromNameList(stmt->object));
+		typid = typenameTypeId(NULL, makeTypeNameFromNameList(castNode(List, stmt->object)));
 		rel = heap_open(TypeRelationId, RowExclusiveLock);
 		tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
 		if (!HeapTupleIsValid(tup))
@@ -9371,11 +9371,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->object = (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 d8bd8a50dd..c765e97fa8 100644
--- a/src/backend/commands/typecmds.c
+++ b/src/backend/commands/typecmds.c
@@ -3133,7 +3133,7 @@ replace_domain_constraint_value(ParseState *pstate, ColumnRef *cref)
 ObjectAddress
 RenameType(RenameStmt *stmt)
 {
-	List	   *names = stmt->object;
+	List	   *names = castNode(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 35fec87842..598ba944a1 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -3116,7 +3116,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);
@@ -3143,8 +3142,7 @@ _copyCommentStmt(const CommentStmt *from)
 	CommentStmt *newnode = makeNode(CommentStmt);
 
 	COPY_SCALAR_FIELD(objtype);
-	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(object);
 	COPY_STRING_FIELD(comment);
 
 	return newnode;
@@ -3156,8 +3154,7 @@ _copySecLabelStmt(const SecLabelStmt *from)
 	SecLabelStmt *newnode = makeNode(SecLabelStmt);
 
 	COPY_SCALAR_FIELD(objtype);
-	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(object);
 	COPY_STRING_FIELD(provider);
 	COPY_STRING_FIELD(label);
 
@@ -3263,7 +3260,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);
@@ -3279,8 +3275,7 @@ _copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
 
 	COPY_SCALAR_FIELD(objectType);
 	COPY_NODE_FIELD(relation);
-	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(object);
 	COPY_NODE_FIELD(extname);
 
 	return newnode;
@@ -3294,7 +3289,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);
 
@@ -3309,7 +3303,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;
@@ -3780,8 +3773,7 @@ _copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
 	COPY_STRING_FIELD(extname);
 	COPY_SCALAR_FIELD(action);
 	COPY_SCALAR_FIELD(objtype);
-	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(object);
 
 	return newnode;
 }
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index e526ef96b7..876b8aabb9 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -1220,7 +1220,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);
@@ -1243,8 +1242,7 @@ static bool
 _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
 {
 	COMPARE_SCALAR_FIELD(objtype);
-	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
+	COMPARE_NODE_FIELD(object);
 	COMPARE_STRING_FIELD(comment);
 
 	return true;
@@ -1254,8 +1252,7 @@ static bool
 _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
 {
 	COMPARE_SCALAR_FIELD(objtype);
-	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
+	COMPARE_NODE_FIELD(object);
 	COMPARE_STRING_FIELD(provider);
 	COMPARE_STRING_FIELD(label);
 
@@ -1347,7 +1344,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);
@@ -1361,8 +1357,7 @@ _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(object);
 	COMPARE_NODE_FIELD(extname);
 
 	return true;
@@ -1374,7 +1369,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);
 
@@ -1387,7 +1381,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;
@@ -1783,8 +1776,7 @@ _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const Alte
 	COMPARE_STRING_FIELD(extname);
 	COMPARE_SCALAR_FIELD(action);
 	COMPARE_SCALAR_FIELD(objtype);
-	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
+	COMPARE_NODE_FIELD(object);
 
 	return true;
 }
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index d9696b0bd5..53ee3a963e 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -440,7 +440,9 @@ 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_type_any_name drop_type_name
+				comment_type_any_name comment_type_name
+				security_label_type_any_name security_label_type_name
 
 %type <node>	fetch_args limit_clause select_limit_value
 				offset_clause select_offset_value
@@ -4080,8 +4082,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;
@@ -4091,7 +4092,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;
@@ -4246,7 +4247,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_ACCESS_METHOD;
-					n->objname = list_make1(makeString($7));
+					n->object = (Node *) makeString($7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop AGGREGATE aggregate_with_argtypes
@@ -4255,8 +4256,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $6->objname;
-					n->objargs = $6->objargs;
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop CAST '(' Typename AS Typename ')'
@@ -4265,8 +4265,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_CAST;
-					n->objname = list_make1($7);
-					n->objargs = list_make1($9);
+					n->object = (Node *) list_make2($7, $9);
 					$$ = (Node *) n;
 				}
 			| ALTER EXTENSION name add_drop COLLATION any_name
@@ -4275,7 +4274,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_COLLATION;
-					n->objname = $6;
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop CONVERSION_P any_name
@@ -4284,7 +4283,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_CONVERSION;
-					n->objname = $6;
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop DOMAIN_P Typename
@@ -4293,7 +4292,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_DOMAIN;
-					n->objname = list_make1($6);
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop FUNCTION function_with_argtypes
@@ -4302,8 +4301,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_FUNCTION;
-					n->objname = $6->objname;
-					n->objargs = $6->objargs;
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop opt_procedural LANGUAGE name
@@ -4312,7 +4310,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_LANGUAGE;
-					n->objname = list_make1(makeString($7));
+					n->object = (Node *) makeString($7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop OPERATOR operator_with_argtypes
@@ -4321,8 +4319,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_OPERATOR;
-					n->objname = $6->objname;
-					n->objargs = $6->objargs;
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop OPERATOR CLASS any_name USING access_method
@@ -4331,7 +4328,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_OPCLASS;
-					n->objname = lcons(makeString($9), $7);
+					n->object = (Node *) lcons(makeString($9), $7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop OPERATOR FAMILY any_name USING access_method
@@ -4340,7 +4337,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_OPFAMILY;
-					n->objname = lcons(makeString($9), $7);
+					n->object = (Node *) lcons(makeString($9), $7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop SCHEMA name
@@ -4349,7 +4346,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_SCHEMA;
-					n->objname = list_make1(makeString($6));
+					n->object = (Node *) makeString($6);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop EVENT TRIGGER name
@@ -4358,7 +4355,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_EVENT_TRIGGER;
-					n->objname = list_make1(makeString($7));
+					n->object = (Node *) makeString($7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TABLE any_name
@@ -4367,7 +4364,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TABLE;
-					n->objname = $6;
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TEXT_P SEARCH PARSER any_name
@@ -4376,7 +4373,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TSPARSER;
-					n->objname = $8;
+					n->object = (Node *) $8;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TEXT_P SEARCH DICTIONARY any_name
@@ -4385,7 +4382,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TSDICTIONARY;
-					n->objname = $8;
+					n->object = (Node *) $8;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TEXT_P SEARCH TEMPLATE any_name
@@ -4394,7 +4391,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TSTEMPLATE;
-					n->objname = $8;
+					n->object = (Node *) $8;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TEXT_P SEARCH CONFIGURATION any_name
@@ -4403,7 +4400,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TSCONFIGURATION;
-					n->objname = $8;
+					n->object = (Node *) $8;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop SEQUENCE any_name
@@ -4412,7 +4409,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_SEQUENCE;
-					n->objname = $6;
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop VIEW any_name
@@ -4421,7 +4418,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_VIEW;
-					n->objname = $6;
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop MATERIALIZED VIEW any_name
@@ -4430,7 +4427,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_MATVIEW;
-					n->objname = $7;
+					n->object = (Node *) $7;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop FOREIGN TABLE any_name
@@ -4439,7 +4436,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_FOREIGN_TABLE;
-					n->objname = $7;
+					n->object = (Node *) $7;
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop FOREIGN DATA_P WRAPPER name
@@ -4448,7 +4445,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_FDW;
-					n->objname = list_make1(makeString($8));
+					n->object = (Node *) makeString($8);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop SERVER name
@@ -4457,7 +4454,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_FOREIGN_SERVER;
-					n->objname = list_make1(makeString($6));
+					n->object = (Node *) makeString($6);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TRANSFORM FOR Typename LANGUAGE name
@@ -4466,8 +4463,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TRANSFORM;
-					n->objname = list_make1($7);
-					n->objargs = list_make1(makeString($9));
+					n->object = (Node *) list_make2($7, makeString($9));
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TYPE_P Typename
@@ -4476,7 +4472,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TYPE;
-					n->objname = list_make1($6);
+					n->object = (Node *) $6;
 					$$ = (Node *)n;
 				}
 		;
@@ -4526,8 +4522,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;
@@ -4537,8 +4532,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;
@@ -4688,8 +4682,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;
@@ -4699,8 +4692,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;
@@ -5024,7 +5016,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;
@@ -5035,7 +5026,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;
@@ -5348,7 +5338,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;
@@ -5359,7 +5348,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;
@@ -5469,7 +5457,6 @@ DropAssertStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->objects = NIL;
-					n->arguments = NIL;
 					n->behavior = $4;
 					n->removeType = OBJECT_TRIGGER; /* XXX */
 					ereport(ERROR,
@@ -6008,24 +5995,42 @@ ReassignOwnedStmt:
  *
  *****************************************************************************/
 
-DropStmt:	DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior
+DropStmt:	DROP drop_type_any_name 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_type_any_name 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_type_name 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_type_name 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;
@@ -6076,7 +6081,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;
@@ -6087,31 +6091,35 @@ 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_type_any_name:
+			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_type_name:
+			ACCESS METHOD							{ $$ = OBJECT_ACCESS_METHOD; }
+			| EVENT TRIGGER							{ $$ = OBJECT_EVENT_TRIGGER; }
+			| EXTENSION								{ $$ = OBJECT_EXTENSION; }
 			| PUBLICATION							{ $$ = OBJECT_PUBLICATION; }
+			| SCHEMA								{ $$ = OBJECT_SCHEMA; }
 		;
 
 any_name_list:
@@ -6130,8 +6138,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); }
 
 /*****************************************************************************
  *
@@ -6188,12 +6196,19 @@ opt_restart_seqs:
  *****************************************************************************/
 
 CommentStmt:
-			COMMENT ON comment_type any_name IS comment_text
+			COMMENT ON comment_type_any_name any_name IS comment_text
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = $3;
-					n->objname = $4;
-					n->objargs = NIL;
+					n->object = (Node *) $4;
+					n->comment = $6;
+					$$ = (Node *) n;
+				}
+			| COMMENT ON comment_type_name name IS comment_text
+				{
+					CommentStmt *n = makeNode(CommentStmt);
+					n->objtype = $3;
+					n->object = (Node *) makeString($4);
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6201,8 +6216,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TYPE;
-					n->objname = list_make1($4);
-					n->objargs = NIL;
+					n->object = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6210,8 +6224,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_DOMAIN;
-					n->objname = list_make1($4);
-					n->objargs = NIL;
+					n->object = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6219,8 +6232,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $4->objname;
-					n->objargs = $4->objargs;
+					n->object = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6228,8 +6240,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_FUNCTION;
-					n->objname = $4->objname;
-					n->objargs = $4->objargs;
+					n->object = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6237,8 +6248,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_OPERATOR;
-					n->objname = $4->objname;
-					n->objargs = $4->objargs;
+					n->object = (Node *) $4;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -6246,8 +6256,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TABCONSTRAINT;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
+					n->object = (Node *) lappend($6, makeString($4));
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -6260,8 +6269,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->object = (Node *) list_make2(makeTypeNameFromNameList($7), makeString($4));
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -6269,8 +6277,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_POLICY;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
+					n->object = (Node *) lappend($6, makeString($4));
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -6278,8 +6285,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_RULE;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
+					n->object = (Node *) lappend($6, makeString($4));
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -6287,8 +6293,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TRANSFORM;
-					n->objname = list_make1($5);
-					n->objargs = list_make1(makeString($7));
+					n->object = (Node *) list_make2($5, makeString($7));
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -6296,8 +6301,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TRIGGER;
-					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
+					n->object = (Node *) lappend($6, makeString($4));
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -6305,7 +6309,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_OPCLASS;
-					n->objname = lcons(makeString($7), $5);
+					n->object = (Node *) lcons(makeString($7), $5);
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -6313,8 +6317,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_OPFAMILY;
-					n->objname = lcons(makeString($7), $5);
-					n->objargs = NIL;
+					n->object = (Node *) lcons(makeString($7), $5);
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -6322,8 +6325,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_LARGEOBJECT;
-					n->objname = list_make1($5);
-					n->objargs = NIL;
+					n->object = (Node *) $5;
 					n->comment = $7;
 					$$ = (Node *) n;
 				}
@@ -6331,27 +6333,15 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_CAST;
-					n->objname = list_make1($5);
-					n->objargs = list_make1($7);
+					n->object = (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_type_any_name:
+			COLUMN								{ $$ = OBJECT_COLUMN; }
 			| INDEX								{ $$ = OBJECT_INDEX; }
 			| SEQUENCE							{ $$ = OBJECT_SEQUENCE; }
 			| TABLE								{ $$ = OBJECT_TABLE; }
@@ -6359,19 +6349,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_type_name:
+			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; }
@@ -6388,14 +6386,23 @@ comment_text:
  *****************************************************************************/
 
 SecLabelStmt:
-			SECURITY LABEL opt_provider ON security_label_type any_name
+			SECURITY LABEL opt_provider ON security_label_type_any_name any_name
 			IS security_label
 				{
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = $5;
-					n->objname = $6;
-					n->objargs = NIL;
+					n->object = (Node *) $6;
+					n->label = $8;
+					$$ = (Node *) n;
+				}
+			| SECURITY LABEL opt_provider ON security_label_type_name name
+			  IS security_label
+				{
+					SecLabelStmt *n = makeNode(SecLabelStmt);
+					n->provider = $3;
+					n->objtype = $5;
+					n->object = (Node *) makeString($6);
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6405,8 +6412,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_TYPE;
-					n->objname = list_make1($6);
-					n->objargs = NIL;
+					n->object = (Node *) $6;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6416,8 +6422,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_TYPE;
-					n->objname = list_make1($6);
-					n->objargs = NIL;
+					n->object = (Node *) $6;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6427,8 +6432,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $6->objname;
-					n->objargs = $6->objargs;
+					n->object = (Node *) $6;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6438,8 +6442,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_FUNCTION;
-					n->objname = $6->objname;
-					n->objargs = $6->objargs;
+					n->object = (Node *) $6;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6449,19 +6452,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->object = (Node *) $7;
 					n->label = $9;
 					$$ = (Node *) n;
 				}
@@ -6471,20 +6462,26 @@ opt_provider:	FOR NonReservedWord_or_Sconst	{ $$ = $2; }
 				| /* empty */					{ $$ = NULL; }
 		;
 
-security_label_type:
+/* object types taking any_name */
+security_label_type_any_name:
 			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_type_name:
+			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; }
 		;
@@ -7684,8 +7681,7 @@ RemoveFuncStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FUNCTION;
-					n->objects = list_make1($3->objname);
-					n->arguments = list_make1($3->objargs);
+					n->objects = list_make1($3);
 					n->behavior = $4;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -7695,8 +7691,7 @@ RemoveFuncStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FUNCTION;
-					n->objects = list_make1($5->objname);
-					n->arguments = list_make1($5->objargs);
+					n->objects = list_make1($5);
 					n->behavior = $6;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -7709,8 +7704,7 @@ RemoveAggrStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_AGGREGATE;
-					n->objects = list_make1($3->objname);
-					n->arguments = list_make1($3->objargs);
+					n->objects = list_make1($3);
 					n->behavior = $4;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -7720,8 +7714,7 @@ RemoveAggrStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_AGGREGATE;
-					n->objects = list_make1($5->objname);
-					n->arguments = list_make1($5->objargs);
+					n->objects = list_make1($5);
 					n->behavior = $6;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -7734,8 +7727,7 @@ RemoveOperStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_OPERATOR;
-					n->objects = list_make1($3->objname);
-					n->arguments = list_make1($3->objargs);
+					n->objects = list_make1($3);
 					n->behavior = $4;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -7745,8 +7737,7 @@ RemoveOperStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_OPERATOR;
-					n->objects = list_make1($5->objname);
-					n->arguments = list_make1($5->objargs);
+					n->objects = list_make1($5);
 					n->behavior = $6;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -7872,8 +7863,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;
@@ -7927,8 +7917,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;
@@ -8035,8 +8024,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_AGGREGATE;
-					n->object = $3->objname;
-					n->objarg = $3->objargs;
+					n->object = (Node *) $3;
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8045,7 +8033,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;
@@ -8054,7 +8042,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;
@@ -8072,7 +8060,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;
@@ -8081,7 +8069,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;
@@ -8090,7 +8078,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;
@@ -8099,8 +8087,7 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_FUNCTION;
-					n->object = $3->objname;
-					n->objarg = $3->objargs;
+					n->object = (Node *) $3;
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8118,7 +8105,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;
@@ -8127,7 +8114,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;
@@ -8136,7 +8123,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;
@@ -8174,7 +8161,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;
@@ -8409,7 +8396,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;
 				}
@@ -8444,7 +8431,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;
@@ -8453,7 +8440,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;
@@ -8462,7 +8449,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;
@@ -8471,7 +8458,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;
@@ -8480,7 +8467,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;
@@ -8518,9 +8505,7 @@ AlterObjectDependsStmt:
 				{
 					AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
 					n->objectType = OBJECT_FUNCTION;
-					n->relation = NULL;
-					n->objname = $3->objname;
-					n->objargs = $3->objargs;
+					n->object = (Node *) $3;
 					n->extname = makeString($7);
 					$$ = (Node *)n;
 				}
@@ -8529,8 +8514,7 @@ AlterObjectDependsStmt:
 					AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
 					n->objectType = OBJECT_TRIGGER;
 					n->relation = $5;
-					n->objname = list_make1(makeString($3));
-					n->objargs = NIL;
+					n->object = (Node *) list_make1(makeString($3));
 					n->extname = makeString($9);
 					$$ = (Node *)n;
 				}
@@ -8539,8 +8523,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;
 				}
@@ -8549,8 +8531,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;
 				}
@@ -8567,8 +8547,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_AGGREGATE;
-					n->object = $3->objname;
-					n->objarg = $3->objargs;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8577,7 +8556,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;
@@ -8586,7 +8565,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;
@@ -8595,16 +8574,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;
@@ -8613,8 +8592,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_FUNCTION;
-					n->object = $3->objname;
-					n->objarg = $3->objargs;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8623,8 +8601,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_OPERATOR;
-					n->object = $3->objname;
-					n->objarg = $3->objargs;
+					n->object = (Node *) $3;
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8633,7 +8610,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;
@@ -8642,7 +8619,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;
@@ -8669,7 +8646,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;
@@ -8678,7 +8655,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;
@@ -8687,7 +8664,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;
@@ -8696,7 +8673,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;
@@ -8777,7 +8754,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;
@@ -8821,8 +8798,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_AGGREGATE;
-					n->object = $3->objname;
-					n->objarg = $3->objargs;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8830,7 +8806,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;
 				}
@@ -8838,7 +8814,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;
 				}
@@ -8846,7 +8822,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;
 				}
@@ -8854,7 +8830,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;
 				}
@@ -8862,8 +8838,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_FUNCTION;
-					n->object = $3->objname;
-					n->objarg = $3->objargs;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8871,7 +8846,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;
 				}
@@ -8879,7 +8854,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;
 				}
@@ -8887,8 +8862,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_OPERATOR;
-					n->object = $3->objname;
-					n->objarg = $3->objargs;
+					n->object = (Node *) $3;
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8896,7 +8870,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;
 				}
@@ -8904,7 +8878,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;
 				}
@@ -8912,7 +8886,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;
 				}
@@ -8920,7 +8894,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;
 				}
@@ -8928,7 +8902,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;
 				}
@@ -8936,7 +8910,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;
 				}
@@ -8944,7 +8918,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;
 				}
@@ -8952,7 +8926,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;
 				}
@@ -8960,7 +8934,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;
 				}
@@ -8968,7 +8942,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;
 				}
@@ -8976,7 +8950,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_PUBLICATION;
-					n->object = list_make1(makeString($3));
+					n->object = (Node *) makeString($3);
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8984,7 +8958,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_SUBSCRIPTION;
-					n->object = list_make1(makeString($3));
+					n->object = (Node *) makeString($3);
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -9279,7 +9253,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;
@@ -9290,7 +9263,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 ff2bab6551..673276a9d3 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -947,10 +947,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->object = (Node *) list_make3(makeString(cxt->relation->schemaname),
+											   makeString(cxt->relation->relname),
+											   makeString(def->colname));
 			stmt->comment = comment;
 
 			cxt->alist = lappend(cxt->alist, stmt);
@@ -1013,10 +1012,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->object = (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 1a5afe1bed..406c38bc73 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 *object,
+				   Relation *relp,
 				   LOCKMODE lockmode, bool missing_ok);
 
 extern ObjectAddress get_object_address_rv(ObjectType objtype, RangeVar *rel,
-					  List *objname, List *objargs, Relation *relp,
+					  List *object, 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 *object, 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 3f14c90267..7f027d9dc7 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 97993f5198..7c7530bd3f 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -2076,8 +2076,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	   *object;			/* Qualified name of the object */
 } AlterExtensionContentsStmt;
 
 /* ----------------------
@@ -2462,8 +2461,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? */
@@ -2490,8 +2488,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	   *object;			/* Qualified name of the object */
 	char	   *comment;		/* Comment to insert, or NULL to remove */
 } CommentStmt;
 
@@ -2503,8 +2500,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	   *object;			/* Qualified name of the object */
 	char	   *provider;		/* Label provider (or NULL) */
 	char	   *label;			/* New security label to be assigned */
 } SecLabelStmt;
@@ -2678,8 +2674,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 */
@@ -2696,8 +2691,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	   *object;			/* name of the object */
 	Value	   *extname;		/* extension name */
 } AlterObjectDependsStmt;
 
@@ -2710,8 +2704,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;
@@ -2725,8 +2718,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 4766975746..fc9f1cb2ff 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -296,7 +296,7 @@ WARNING:  error for publication relation,{eins,zwei,drei},{integer}: cross-datab
 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}', '{}');
@@ -306,47 +306,47 @@ 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
 SELECT pg_get_object_address('publication', '{one}', '{}');
 ERROR:  publication "one" does not exist
 SELECT pg_get_object_address('publication', '{one,two}', '{}');
-ERROR:  publication name cannot be qualified
+ERROR:  name list length must be exactly 1
 SELECT pg_get_object_address('subscription', '{one}', '{}');
 ERROR:  subscription "one" does not exist
 SELECT pg_get_object_address('subscription', '{one,two}', '{}');
-ERROR:  subscription 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.1

