On 11/23/16 5:04 PM, Tom Lane wrote:
> I looked at this briefly.  I agree that 0001-0003 are simple cleanup of
> the grammar and could be pushed without further ado.

Done.

> However, starting
> with 0004 I begin to get queasy.  The plan seems to be that instead of
> "objname" always being a List of strings, for functions (and then
> aggregates and operators) it will be a one-element List of some new struct
> that has then got a name list inside it.

I think the original idea of representing an object by a list of name
components plus optionally a list of arguments has accumulated too many
warts and should be replaced.  For example: A Typename isn't a list, so
it has to be packed into a List to be able to pass it around.  Some
objects only have a single-component string as a name.  For a cast, we
arbitrarily put the source type into a the name list and the target type
into the argument list.  For an operator class on the other hand we
create a cons of name and access method.  The pending logical
replication patch has more such arbitrary examples.  This pattern has to
be repeated consistently in gram.y for all cases where the object is
referenced (ALTER EXTENSION, DROP, COMMENT, RENAME, SET SCHEMA, OWNER
TO) and then consistently unpacked in objectaddress.c.

I think it would be better to get rid of objargs and have objname be a
general Node that can contain more specific node types so that there is
some amount of type tracking.  FuncWithArgs would be one such type,
Typename would be another, Value would be used for simple strings, and
we could create some other ones, or stick with lcons for some simple
cases.  But then we don't have to make stuff into one-item lists to just
to satisfy the currently required List.

That's the general idea.  But that's a rather big change that I would
rather break down into smaller pieces.  I have a separate patch in
progress for that, which I have attached here.  It breaks some
regression tests in object_address.sql, which I haven't evaluated yet,
but that's the idea.

However, in these current patches I just wanted to take the first step
to normalize the representation of functions so that actual
functionality changes could be built in top of that.

> It leads to code with random changes of data representation at seemingly
> random places, like this bit from 0005:
>  
> +             if (stmt->removeType == OBJECT_AGGREGATE || stmt->removeType == 
> OBJECT_FUNCTION)
> +                     objname = list_make1(objname);

Yeah, the reason for that is that when we want to store something as
objname, it needs to be a list, and the convention is to wrap non-lists
into a single-member list.  So then objectaddress.c is coded to linitial
such lists when working on object types such as functions or types.
RemoveObjects() takes the list it gets from the grammar and passes each
element to get_object_address().  But a function_with_argtypes_list is a
list of FuncWithArgs, so we have to make those into single-member lists
first.  The reason this works for types is that type_name_list looks
like this:

type_name_list:
    Typename                       { $$ = list_make1(list_make1($1)); }
  | type_name_list ',' Typename    { $$ = lappend($1, list_make1($3)); }

I suppose we could make function_with_argtypes look like that as well
(and later change it back if we redesign it as discussed above).  I
think if we did it that way, it would get rid of the warts in this patch
set.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From 3af0716745895bfe24b5e2e7ab1f0d4aaa3ec011 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pete...@gmx.net>
Date: Sat, 12 Nov 2016 12:00:00 -0500
Subject: [PATCH] Remove objargs

WIP
---
 src/backend/catalog/objectaddress.c |  92 +++++++++++++-----------
 src/backend/commands/alter.c        |   9 ++-
 src/backend/commands/comment.c      |   4 +-
 src/backend/commands/dropcmds.c     |  50 ++++++-------
 src/backend/commands/extension.c    |   4 +-
 src/backend/commands/seclabel.c     |   4 +-
 src/backend/commands/tablecmds.c    |   1 -
 src/backend/nodes/copyfuncs.c       |   8 ---
 src/backend/nodes/equalfuncs.c      |   8 ---
 src/backend/parser/gram.y           | 136 ++++++++----------------------------
 src/backend/parser/parse_utilcmd.c  |   2 -
 src/include/catalog/objectaddress.h |   6 +-
 src/include/nodes/parsenodes.h      |   8 ---
 13 files changed, 117 insertions(+), 215 deletions(-)

diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index d531d17..58d04fa 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -684,11 +684,11 @@ static ObjectAddress get_object_address_type(ObjectType objtype,
 static ObjectAddress get_object_address_opcf(ObjectType objtype, List *objname,
 						bool missing_ok);
 static ObjectAddress get_object_address_opf_member(ObjectType objtype,
-							  List *objname, List *objargs, bool missing_ok);
+							  List *objname, bool missing_ok);
 
 static ObjectAddress get_object_address_usermapping(List *objname,
-							   List *objargs, bool missing_ok);
-static ObjectAddress get_object_address_defacl(List *objname, List *objargs,
+							   bool missing_ok);
+static ObjectAddress get_object_address_defacl(List *objname,
 						  bool missing_ok);
 static const ObjectPropertyType *get_object_property_data(Oid class_id);
 
@@ -733,7 +733,7 @@ static void getRelationIdentity(StringInfo buffer, Oid relid, List **objname);
  * better to add some support for that in this function.
  */
 ObjectAddress
-get_object_address(ObjectType objtype, List *objname, List *objargs,
+get_object_address(ObjectType objtype, List *objname,
 				   Relation *relp, LOCKMODE lockmode, bool missing_ok)
 {
 	ObjectAddress address;
@@ -793,7 +793,7 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 
 					domaddr = get_object_address_type(OBJECT_DOMAIN,
 											 list_head(objname), missing_ok);
-					constrname = strVal(linitial(objargs));
+					constrname = strVal(lsecond(objname));
 
 					address.classId = ConstraintRelationId;
 					address.objectId = get_domain_constraint_oid(domaddr.objectId,
@@ -822,22 +822,22 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 			case OBJECT_AGGREGATE:
 				address.classId = ProcedureRelationId;
 				address.objectId =
-					LookupAggNameTypeNames(objname, objargs, missing_ok);
+					LookupAggNameTypeNames(linitial(objname), lsecond(objname), missing_ok);
 				address.objectSubId = 0;
 				break;
 			case OBJECT_FUNCTION:
 				address.classId = ProcedureRelationId;
 				address.objectId =
-					LookupFuncNameTypeNames(objname, objargs, missing_ok);
+					LookupFuncNameTypeNames(linitial(objname), lsecond(objname), missing_ok);
 				address.objectSubId = 0;
 				break;
 			case OBJECT_OPERATOR:
-				Assert(list_length(objargs) == 2);
+				Assert(list_length(lsecond(objname)) == 2);
 				address.classId = OperatorRelationId;
 				address.objectId =
-					LookupOperNameTypeNames(NULL, objname,
-											(TypeName *) linitial(objargs),
-											(TypeName *) lsecond(objargs),
+					LookupOperNameTypeNames(NULL, linitial(objname),
+											(TypeName *) linitial(lsecond(objname)),
+											(TypeName *) lsecond(lsecond(objname)),
 											missing_ok, -1);
 				address.objectSubId = 0;
 				break;
@@ -857,8 +857,7 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 				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, objname, missing_ok);
 				break;
 			case OBJECT_LARGEOBJECT:
 				Assert(list_length(objname) == 1);
@@ -877,7 +876,7 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 			case OBJECT_CAST:
 				{
 					TypeName   *sourcetype = (TypeName *) linitial(objname);
-					TypeName   *targettype = (TypeName *) linitial(objargs);
+					TypeName   *targettype = (TypeName *) lsecond(objname);
 					Oid			sourcetypeid;
 					Oid			targettypeid;
 
@@ -892,7 +891,7 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 			case OBJECT_TRANSFORM:
 				{
 					TypeName   *typename = (TypeName *) linitial(objname);
-					char	   *langname = strVal(linitial(objargs));
+					char	   *langname = strVal(lsecond(objname));
 					Oid			type_id = LookupTypeNameOid(NULL, typename, missing_ok);
 					Oid			lang_id = get_language_oid(langname, missing_ok);
 
@@ -923,11 +922,11 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
 				address.objectSubId = 0;
 				break;
 			case OBJECT_USER_MAPPING:
-				address = get_object_address_usermapping(objname, objargs,
+				address = get_object_address_usermapping(objname,
 														 missing_ok);
 				break;
 			case OBJECT_DEFACL:
-				address = get_object_address_defacl(objname, objargs,
+				address = get_object_address_defacl(objname,
 													missing_ok);
 				break;
 			default:
@@ -1024,7 +1023,7 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
  */
 ObjectAddress
 get_object_address_rv(ObjectType objtype, RangeVar *rel, List *objname,
-					  List *objargs, Relation *relp, LOCKMODE lockmode,
+					  Relation *relp, LOCKMODE lockmode,
 					  bool missing_ok)
 {
 	if (rel)
@@ -1036,7 +1035,7 @@ get_object_address_rv(ObjectType objtype, RangeVar *rel, List *objname,
 			objname = lcons(makeString(rel->catalogname), objname);
 	}
 
-	return get_object_address(objtype, objname, objargs,
+	return get_object_address(objtype, objname,
 							  relp, lockmode, missing_ok);
 }
 
@@ -1572,7 +1571,7 @@ get_object_address_opcf(ObjectType objtype, List *objname, bool missing_ok)
  */
 static ObjectAddress
 get_object_address_opf_member(ObjectType objtype,
-							  List *objname, List *objargs, bool missing_ok)
+							  List *objname, bool missing_ok)
 {
 	ObjectAddress famaddr;
 	ObjectAddress address;
@@ -1583,20 +1582,22 @@ get_object_address_opf_member(ObjectType objtype,
 	int			membernum;
 	int			i;
 
+	Assert(objtype == OBJECT_AMOP || objtype == OBJECT_AMPROC);
+
 	/*
 	 * The last element of the objname 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(objname))));
+	copy = list_truncate(list_copy(linitial(objname)), list_length(linitial(objname)) - 1);
 
 	/* no missing_ok support here */
 	famaddr = get_object_address_opcf(OBJECT_OPFAMILY, copy, false);
 
 	/* find out left/right type names and OIDs */
 	i = 0;
-	foreach(cell, objargs)
+	foreach(cell, lsecond(objname))
 	{
 		ObjectAddress typaddr;
 
@@ -1677,7 +1678,7 @@ get_object_address_opf_member(ObjectType objtype,
  * Find the ObjectAddress for a user mapping.
  */
 static ObjectAddress
-get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
+get_object_address_usermapping(List *objname, bool missing_ok)
 {
 	ObjectAddress address;
 	Oid			userid;
@@ -1690,7 +1691,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
 
 	/* fetch string names from input lists, for error messages */
 	username = strVal(linitial(objname));
-	servername = strVal(linitial(objargs));
+	servername = strVal(lsecond(objname));
 
 	/* look up pg_authid OID of mapped user; InvalidOid if PUBLIC */
 	if (strcmp(username, "public") == 0)
@@ -1746,7 +1747,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
  * Find the ObjectAddress for a default ACL.
  */
 static ObjectAddress
-get_object_address_defacl(List *objname, List *objargs, bool missing_ok)
+get_object_address_defacl(List *objname, bool missing_ok)
 {
 	HeapTuple	tp;
 	Oid			userid;
@@ -1763,9 +1764,9 @@ get_object_address_defacl(List *objname, List *objargs, bool missing_ok)
 	 * First figure out the textual attributes so that they can be used for
 	 * error reporting.
 	 */
-	username = strVal(linitial(objname));
-	if (list_length(objname) >= 2)
-		schema = (char *) strVal(lsecond(objname));
+	username = strVal(lsecond(objname));
+	if (list_length(objname) >= 3)
+		schema = (char *) strVal(lthird(objname));
 	else
 		schema = NULL;
 
@@ -1773,7 +1774,7 @@ get_object_address_defacl(List *objname, List *objargs, bool missing_ok)
 	 * Decode defaclobjtype.  Only first char is considered; the rest of the
 	 * string, if any, is blissfully ignored.
 	 */
-	objtype = ((char *) strVal(linitial(objargs)))[0];
+	objtype = ((char *) strVal(linitial(objname)))[0];
 	switch (objtype)
 	{
 		case DEFACLOBJ_RELATION:
@@ -2032,7 +2033,13 @@ pg_get_object_address(PG_FUNCTION_ARGS)
 			break;
 	}
 
-	addr = get_object_address(type, name, args,
+	if (type == OBJECT_AGGREGATE || type == OBJECT_FUNCTION || type == OBJECT_CAST || type == OBJECT_USER_MAPPING || type == OBJECT_TRANSFORM)
+		name = list_make2(name, args);
+
+	if (type == OBJECT_DEFACL)
+		name = lcons(args, name);
+
+	addr = get_object_address(type, name,
 							  &relation, AccessShareLock, false);
 
 	/* We don't need the relcache entry, thank you very much */
@@ -2065,7 +2072,7 @@ pg_get_object_address(PG_FUNCTION_ARGS)
  */
 void
 check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
-					   List *objname, List *objargs, Relation relation)
+					   List *objname, Relation relation)
 {
 	switch (objtype)
 	{
@@ -2100,12 +2107,12 @@ 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(linitial(objname)));
 			break;
 		case OBJECT_OPERATOR:
 			if (!pg_oper_ownercheck(address.objectId, roleid))
 				aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_OPER,
-							   NameListToString(objname));
+							   NameListToString(linitial(objname)));
 			break;
 		case OBJECT_SCHEMA:
 			if (!pg_namespace_ownercheck(address.objectId, roleid))
@@ -2169,7 +2176,7 @@ check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
 			{
 				/* We can only check permissions on the source/target types */
 				TypeName   *sourcetype = (TypeName *) linitial(objname);
-				TypeName   *targettype = (TypeName *) linitial(objargs);
+				TypeName   *targettype = (TypeName *) lsecond(objname);
 				Oid			sourcetypeid = typenameTypeId(NULL, sourcetype);
 				Oid			targettypeid = typenameTypeId(NULL, targettype);
 
@@ -2290,18 +2297,23 @@ get_object_namespace(const ObjectAddress *address)
 int
 read_objtype_from_string(const char *objtype)
 {
+	ObjectType	type;
 	int			i;
 
 	for (i = 0; i < lengthof(ObjectTypeMap); i++)
 	{
 		if (strcmp(ObjectTypeMap[i].tm_name, objtype) == 0)
-			return ObjectTypeMap[i].tm_type;
+		{
+			type = ObjectTypeMap[i].tm_type;
+			break;
+		}
 	}
-	ereport(ERROR,
-			(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-			 errmsg("unrecognized object type \"%s\"", objtype)));
+	if (i >= lengthof(ObjectTypeMap))
+		ereport(ERROR,
+				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				 errmsg("unrecognized object type \"%s\"", objtype)));
 
-	return -1;					/* keep compiler quiet */
+	return type;
 }
 
 /*
diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c
index 03c0433..caa92c8 100644
--- a/src/backend/commands/alter.c
+++ b/src/backend/commands/alter.c
@@ -369,7 +369,7 @@ ExecRenameStmt(RenameStmt *stmt)
 				Relation	relation;
 
 				address = get_object_address(stmt->renameType,
-											 stmt->object, stmt->objarg,
+											 stmt->object,
 											 &relation,
 											 AccessExclusiveLock, false);
 				Assert(relation == NULL);
@@ -406,7 +406,7 @@ ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddre
 
 	address =
 		get_object_address_rv(stmt->objectType, stmt->relation, stmt->objname,
-							stmt->objargs, &rel, AccessExclusiveLock, false);
+							&rel, AccessExclusiveLock, false);
 
 	/*
 	 * If a relation was involved, it would have been opened and locked. We
@@ -416,7 +416,7 @@ ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddre
 		heap_close(rel, NoLock);
 
 	refAddr = get_object_address(OBJECT_EXTENSION, list_make1(stmt->extname),
-								 NULL, &rel, AccessExclusiveLock, false);
+								 &rel, AccessExclusiveLock, false);
 	Assert(rel == NULL);
 	if (refAddress)
 		*refAddress = refAddr;
@@ -485,7 +485,6 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt,
 
 				address = get_object_address(stmt->objectType,
 											 stmt->object,
-											 stmt->objarg,
 											 &relation,
 											 AccessExclusiveLock,
 											 false);
@@ -757,6 +756,7 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
 		case OBJECT_TYPE:
 		case OBJECT_DOMAIN:		/* same as TYPE */
 			return AlterTypeOwner(stmt->object, newowner, stmt->objectType);
+			break;
 
 		case OBJECT_FDW:
 			return AlterForeignDataWrapperOwner(strVal(linitial(stmt->object)),
@@ -791,7 +791,6 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
 
 				address = get_object_address(stmt->objectType,
 											 stmt->object,
-											 stmt->objarg,
 											 &relation,
 											 AccessExclusiveLock,
 											 false);
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c
index a0d3f8d..5e79c8a 100644
--- a/src/backend/commands/comment.c
+++ b/src/backend/commands/comment.c
@@ -70,12 +70,12 @@ CommentObject(CommentStmt *stmt)
 	 * does not exist, and will also acquire a lock on the target to guard
 	 * against concurrent DROP operations.
 	 */
-	address = get_object_address(stmt->objtype, stmt->objname, stmt->objargs,
+	address = get_object_address(stmt->objtype, stmt->objname,
 								 &relation, ShareUpdateExclusiveLock, false);
 
 	/* Require ownership of the target object. */
 	check_object_ownership(GetUserId(), stmt->objtype, address,
-						   stmt->objname, stmt->objargs, relation);
+						   stmt->objname, relation);
 
 	/* Perform other integrity checks as needed. */
 	switch (stmt->objtype)
diff --git a/src/backend/commands/dropcmds.c b/src/backend/commands/dropcmds.c
index 61ff8f2..440c31d 100644
--- a/src/backend/commands/dropcmds.c
+++ b/src/backend/commands/dropcmds.c
@@ -30,7 +30,7 @@
 
 
 static void does_not_exist_skipping(ObjectType objtype,
-						List *objname, List *objargs);
+						List *objname);
 static bool owningrel_does_not_exist_skipping(List *objname,
 								  const char **msg, char **name);
 static bool schema_does_not_exist_skipping(List *objname,
@@ -55,7 +55,6 @@ RemoveObjects(DropStmt *stmt)
 {
 	ObjectAddresses *objects;
 	ListCell   *cell1;
-	ListCell   *cell2 = NULL;
 
 	objects = new_object_addresses();
 
@@ -63,19 +62,12 @@ RemoveObjects(DropStmt *stmt)
 	{
 		ObjectAddress address;
 		List	   *objname = lfirst(cell1);
-		List	   *objargs = NIL;
 		Relation	relation = NULL;
 		Oid			namespaceId;
 
-		if (stmt->arguments)
-		{
-			cell2 = (!cell2 ? list_head(stmt->arguments) : lnext(cell2));
-			objargs = lfirst(cell2);
-		}
-
 		/* Get an ObjectAddress for the object. */
 		address = get_object_address(stmt->removeType,
-									 objname, objargs,
+									 objname,
 									 &relation,
 									 AccessExclusiveLock,
 									 stmt->missing_ok);
@@ -88,7 +80,7 @@ RemoveObjects(DropStmt *stmt)
 		if (!OidIsValid(address.objectId))
 		{
 			Assert(stmt->missing_ok);
-			does_not_exist_skipping(stmt->removeType, objname, objargs);
+			does_not_exist_skipping(stmt->removeType, objname);
 			continue;
 		}
 
@@ -121,7 +113,7 @@ RemoveObjects(DropStmt *stmt)
 		if (!OidIsValid(namespaceId) ||
 			!pg_namespace_ownercheck(namespaceId, GetUserId()))
 			check_object_ownership(GetUserId(), stmt->removeType, address,
-								   objname, objargs, relation);
+								   objname, relation);
 
 		/* Release any relcache reference count, but keep lock until commit. */
 		if (relation)
@@ -254,7 +246,7 @@ type_in_list_does_not_exist_skipping(List *typenames, const char **msg,
  * get_object_address() in RemoveObjects would have thrown an ERROR.
  */
 static void
-does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs)
+does_not_exist_skipping(ObjectType objtype, List *objname)
 {
 	const char *msg = NULL;
 	char	   *name = NULL;
@@ -329,29 +321,29 @@ does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs)
 			name = NameListToString(objname);
 			break;
 		case OBJECT_FUNCTION:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name) &&
-				!type_in_list_does_not_exist_skipping(objargs, &msg, &name))
+			if (!schema_does_not_exist_skipping(linitial(objname), &msg, &name) &&
+				!type_in_list_does_not_exist_skipping(lsecond(objname), &msg, &name))
 			{
 				msg = gettext_noop("function %s(%s) does not exist, skipping");
-				name = NameListToString(objname);
-				args = TypeNameListToString(objargs);
+				name = NameListToString(linitial(objname));
+				args = TypeNameListToString(lsecond(objname));
 			}
 			break;
 		case OBJECT_AGGREGATE:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name) &&
-				!type_in_list_does_not_exist_skipping(objargs, &msg, &name))
+			if (!schema_does_not_exist_skipping(linitial(objname), &msg, &name) &&
+				!type_in_list_does_not_exist_skipping(lsecond(objname), &msg, &name))
 			{
 				msg = gettext_noop("aggregate %s(%s) does not exist, skipping");
-				name = NameListToString(objname);
-				args = TypeNameListToString(objargs);
+				name = NameListToString(linitial(objname));
+				args = TypeNameListToString(lsecond(objname));
 			}
 			break;
 		case OBJECT_OPERATOR:
-			if (!schema_does_not_exist_skipping(objname, &msg, &name) &&
-				!type_in_list_does_not_exist_skipping(objargs, &msg, &name))
+			if (!schema_does_not_exist_skipping(linitial(objname), &msg, &name) &&
+				!type_in_list_does_not_exist_skipping(lsecond(objname), &msg, &name))
 			{
 				msg = gettext_noop("operator %s does not exist, skipping");
-				name = NameListToString(objname);
+				name = NameListToString(linitial(objname));
 			}
 			break;
 		case OBJECT_LANGUAGE:
@@ -360,22 +352,22 @@ does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs)
 			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(objname)), &msg, &name) &&
+					!type_in_list_does_not_exist_skipping(list_make1(lsecond(objname)), &msg, &name))
 				{
 					/* XXX quote or no quote? */
 					msg = gettext_noop("cast from type %s to type %s does not exist, skipping");
 					name = TypeNameToString((TypeName *) linitial(objname));
-					args = TypeNameToString((TypeName *) linitial(objargs));
+					args = TypeNameToString((TypeName *) lsecond(objname));
 				}
 			}
 			break;
 		case OBJECT_TRANSFORM:
-			if (!type_in_list_does_not_exist_skipping(objname, &msg, &name))
+			if (!type_in_list_does_not_exist_skipping(list_make1(linitial(objname)), &msg, &name))
 			{
 				msg = gettext_noop("transform for type %s language \"%s\" does not exist, skipping");
 				name = TypeNameToString((TypeName *) linitial(objname));
-				args = strVal(linitial(objargs));
+				args = strVal(lsecond(objname));
 			}
 			break;
 		case OBJECT_TRIGGER:
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index f6c2c8a..074c855 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -3194,7 +3194,7 @@ ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
 	 * does not exist, and will also acquire a lock on the object to guard
 	 * against concurrent DROP and ALTER EXTENSION ADD/DROP operations.
 	 */
-	object = get_object_address(stmt->objtype, stmt->objname, stmt->objargs,
+	object = get_object_address(stmt->objtype, stmt->objname,
 								&relation, ShareUpdateExclusiveLock, false);
 
 	Assert(object.objectSubId == 0);
@@ -3203,7 +3203,7 @@ ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
 
 	/* Permission check: must own target object, too */
 	check_object_ownership(GetUserId(), stmt->objtype, object,
-						   stmt->objname, stmt->objargs, relation);
+						   stmt->objname, relation);
 
 	/*
 	 * Check existing extension membership.
diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c
index 5bd7e12..ffc8d35 100644
--- a/src/backend/commands/seclabel.c
+++ b/src/backend/commands/seclabel.c
@@ -89,12 +89,12 @@ ExecSecLabelStmt(SecLabelStmt *stmt)
 	 * object does not exist, and will also acquire a lock on the target to
 	 * guard against concurrent modifications.
 	 */
-	address = get_object_address(stmt->objtype, stmt->objname, stmt->objargs,
+	address = get_object_address(stmt->objtype, stmt->objname,
 								 &relation, ShareUpdateExclusiveLock, false);
 
 	/* Require ownership of the target object. */
 	check_object_ownership(GetUserId(), stmt->objtype, address,
-						   stmt->objname, stmt->objargs, relation);
+						   stmt->objname, relation);
 
 	/* Perform other integrity checks as needed. */
 	switch (stmt->objtype)
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 6322fa7..412322b 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8864,7 +8864,6 @@ RebuildConstraintComment(AlteredTableInfo *tab, int pass, Oid objid,
 				   makeString(get_namespace_name(RelationGetNamespace(rel))),
 							  makeString(RelationGetRelationName(rel)),
 							  makeString(conname));
-	cmd->objargs = NIL;
 	cmd->comment = comment_str;
 
 	/* Append it to list of commands */
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 04e49b7..6954dd6 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -3079,7 +3079,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);
@@ -3107,7 +3106,6 @@ _copyCommentStmt(const CommentStmt *from)
 
 	COPY_SCALAR_FIELD(objtype);
 	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
 	COPY_STRING_FIELD(comment);
 
 	return newnode;
@@ -3120,7 +3118,6 @@ _copySecLabelStmt(const SecLabelStmt *from)
 
 	COPY_SCALAR_FIELD(objtype);
 	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
 	COPY_STRING_FIELD(provider);
 	COPY_STRING_FIELD(label);
 
@@ -3226,7 +3223,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);
@@ -3243,7 +3239,6 @@ _copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
 	COPY_SCALAR_FIELD(objectType);
 	COPY_NODE_FIELD(relation);
 	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
 	COPY_NODE_FIELD(extname);
 
 	return newnode;
@@ -3257,7 +3252,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);
 
@@ -3272,7 +3266,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;
@@ -3744,7 +3737,6 @@ _copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
 	COPY_SCALAR_FIELD(action);
 	COPY_SCALAR_FIELD(objtype);
 	COPY_NODE_FIELD(objname);
-	COPY_NODE_FIELD(objargs);
 
 	return newnode;
 }
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index 2eaf41c..d07598d 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -1203,7 +1203,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);
@@ -1227,7 +1226,6 @@ _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
 {
 	COMPARE_SCALAR_FIELD(objtype);
 	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
 	COMPARE_STRING_FIELD(comment);
 
 	return true;
@@ -1238,7 +1236,6 @@ _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
 {
 	COMPARE_SCALAR_FIELD(objtype);
 	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
 	COMPARE_STRING_FIELD(provider);
 	COMPARE_STRING_FIELD(label);
 
@@ -1330,7 +1327,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);
@@ -1345,7 +1341,6 @@ _equalAlterObjectDependsStmt(const AlterObjectDependsStmt *a, const AlterObjectD
 	COMPARE_SCALAR_FIELD(objectType);
 	COMPARE_NODE_FIELD(relation);
 	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
 	COMPARE_NODE_FIELD(extname);
 
 	return true;
@@ -1357,7 +1352,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);
 
@@ -1370,7 +1364,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;
@@ -1767,7 +1760,6 @@ _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const Alte
 	COMPARE_SCALAR_FIELD(action);
 	COMPARE_SCALAR_FIELD(objtype);
 	COMPARE_NODE_FIELD(objname);
-	COMPARE_NODE_FIELD(objargs);
 
 	return true;
 }
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 367bc2e..f418bb1 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -3775,7 +3775,6 @@ DropPLangStmt:
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_LANGUAGE;
 					n->objects = list_make1(list_make1(makeString($4)));
-					n->arguments = NIL;
 					n->behavior = $5;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -3934,23 +3933,13 @@ alter_extension_opt_item:
  *****************************************************************************/
 
 AlterExtensionContentsStmt:
-			ALTER EXTENSION name add_drop ACCESS METHOD name
-				{
-					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
-					n->extname = $3;
-					n->action = $4;
-					n->objtype = OBJECT_ACCESS_METHOD;
-					n->objname = list_make1(makeString($7));
-					$$ = (Node *)n;
-				}
-			| ALTER EXTENSION name add_drop AGGREGATE func_name aggr_args
+			ALTER EXTENSION name add_drop AGGREGATE func_name aggr_args
 				{
 					AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $6;
-					n->objargs = extractAggrArgTypes($7);
+					n->objname = list_make2($6, extractAggrArgTypes($7));
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop CAST '(' Typename AS Typename ')'
@@ -3959,8 +3948,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_CAST;
-					n->objname = list_make1($7);
-					n->objargs = list_make1($9);
+					n->objname = list_make2($7, $9);
 					$$ = (Node *) n;
 				}
 			| ALTER EXTENSION name add_drop COLLATION any_name
@@ -3996,8 +3984,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_FUNCTION;
-					n->objname = $6->funcname;
-					n->objargs = $6->funcargs;
+					n->objname = list_make2($6->funcname, $6->funcargs);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop opt_procedural LANGUAGE name
@@ -4015,8 +4002,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_OPERATOR;
-					n->objname = $6;
-					n->objargs = $7;
+					n->objname = list_make2($6, $7);
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop OPERATOR CLASS any_name USING access_method
@@ -4160,8 +4146,7 @@ AlterExtensionContentsStmt:
 					n->extname = $3;
 					n->action = $4;
 					n->objtype = OBJECT_TRANSFORM;
-					n->objname = list_make1($7);
-					n->objargs = list_make1(makeString($9));
+					n->objname = list_make2($7, makeString($9));
 					$$ = (Node *)n;
 				}
 			| ALTER EXTENSION name add_drop TYPE_P Typename
@@ -4221,7 +4206,6 @@ 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->missing_ok = false;
 					n->behavior = $6;
 					n->concurrent = false;
@@ -4232,7 +4216,6 @@ 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->missing_ok = true;
 					n->behavior = $8;
 					n->concurrent = false;
@@ -4383,7 +4366,6 @@ 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->missing_ok = false;
 					n->behavior = $4;
 					n->concurrent = false;
@@ -4394,7 +4376,6 @@ 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->missing_ok = true;
 					n->behavior = $6;
 					n->concurrent = false;
@@ -4672,7 +4653,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;
@@ -4683,7 +4663,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;
@@ -4978,7 +4957,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;
@@ -4989,7 +4967,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;
@@ -5099,7 +5076,6 @@ DropAssertStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->objects = NIL;
-					n->arguments = NIL;
 					n->behavior = $4;
 					n->removeType = OBJECT_TRIGGER; /* XXX */
 					ereport(ERROR,
@@ -5619,7 +5595,6 @@ DropStmt:	DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior
 					n->removeType = $2;
 					n->missing_ok = TRUE;
 					n->objects = $5;
-					n->arguments = NIL;
 					n->behavior = $6;
 					n->concurrent = false;
 					$$ = (Node *)n;
@@ -5630,7 +5605,6 @@ DropStmt:	DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior
 					n->removeType = $2;
 					n->missing_ok = FALSE;
 					n->objects = $3;
-					n->arguments = NIL;
 					n->behavior = $4;
 					n->concurrent = false;
 					$$ = (Node *)n;
@@ -5681,7 +5655,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;
@@ -5692,7 +5665,6 @@ 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;
@@ -5797,7 +5769,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = $3;
 					n->objname = $4;
-					n->objargs = NIL;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -5806,7 +5777,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TYPE;
 					n->objname = list_make1($4);
-					n->objargs = NIL;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -5815,7 +5785,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_DOMAIN;
 					n->objname = list_make1($4);
-					n->objargs = NIL;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -5823,8 +5792,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $4;
-					n->objargs = extractAggrArgTypes($5);
+					n->objname = list_make2($4, extractAggrArgTypes($5));
 					n->comment = $7;
 					$$ = (Node *) n;
 				}
@@ -5832,8 +5800,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_FUNCTION;
-					n->objname = $4;
-					n->objargs = extractArgTypes($5);
+					n->objname = list_make2($4, extractArgTypes($5));
 					n->comment = $7;
 					$$ = (Node *) n;
 				}
@@ -5841,8 +5808,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_OPERATOR;
-					n->objname = $4;
-					n->objargs = $5;
+					n->objname = list_make2($4, $5);
 					n->comment = $7;
 					$$ = (Node *) n;
 				}
@@ -5851,7 +5817,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TABCONSTRAINT;
 					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -5864,8 +5829,7 @@ CommentStmt:
 					 * there's a shift/reduce conflict if we do that, so fix it
 					 * up here.
 					 */
-					n->objname = list_make1(makeTypeNameFromNameList($7));
-					n->objargs = list_make1(makeString($4));
+					n->objname = list_make2(makeTypeNameFromNameList($7), makeString($4));
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -5874,7 +5838,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_POLICY;
 					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -5883,7 +5846,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_RULE;
 					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -5893,7 +5855,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_RULE;
 					n->objname = list_make1(makeString($4));
-					n->objargs = NIL;
 					n->comment = $6;
 					$$ = (Node *) n;
 				}
@@ -5901,8 +5862,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TRANSFORM;
-					n->objname = list_make1($5);
-					n->objargs = list_make1(makeString($7));
+					n->objname = list_make2($5, makeString($7));
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -5911,7 +5871,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_TRIGGER;
 					n->objname = lappend($6, makeString($4));
-					n->objargs = NIL;
 					n->comment = $8;
 					$$ = (Node *) n;
 				}
@@ -5928,7 +5887,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_OPFAMILY;
 					n->objname = lcons(makeString($7), $5);
-					n->objargs = NIL;
 					n->comment = $9;
 					$$ = (Node *) n;
 				}
@@ -5937,7 +5895,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_LARGEOBJECT;
 					n->objname = list_make1($5);
-					n->objargs = NIL;
 					n->comment = $7;
 					$$ = (Node *) n;
 				}
@@ -5945,8 +5902,7 @@ CommentStmt:
 				{
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_CAST;
-					n->objname = list_make1($5);
-					n->objargs = list_make1($7);
+					n->objname = list_make2($5, $7);
 					n->comment = $10;
 					$$ = (Node *) n;
 				}
@@ -5955,7 +5911,6 @@ CommentStmt:
 					CommentStmt *n = makeNode(CommentStmt);
 					n->objtype = OBJECT_LANGUAGE;
 					n->objname = $5;
-					n->objargs = NIL;
 					n->comment = $7;
 					$$ = (Node *) n;
 				}
@@ -6009,7 +5964,6 @@ SecLabelStmt:
 					n->provider = $3;
 					n->objtype = $5;
 					n->objname = $6;
-					n->objargs = NIL;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6020,7 +5974,6 @@ SecLabelStmt:
 					n->provider = $3;
 					n->objtype = OBJECT_TYPE;
 					n->objname = list_make1($6);
-					n->objargs = NIL;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6031,7 +5984,6 @@ SecLabelStmt:
 					n->provider = $3;
 					n->objtype = OBJECT_TYPE;
 					n->objname = list_make1($6);
-					n->objargs = NIL;
 					n->label = $8;
 					$$ = (Node *) n;
 				}
@@ -6041,8 +5993,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_AGGREGATE;
-					n->objname = $6;
-					n->objargs = extractAggrArgTypes($7);
+					n->objname = list_make2($6, extractAggrArgTypes($7));
 					n->label = $9;
 					$$ = (Node *) n;
 				}
@@ -6052,8 +6003,7 @@ SecLabelStmt:
 					SecLabelStmt *n = makeNode(SecLabelStmt);
 					n->provider = $3;
 					n->objtype = OBJECT_FUNCTION;
-					n->objname = $6;
-					n->objargs = extractArgTypes($7);
+					n->objname = list_make2($6, extractArgTypes($7));
 					n->label = $9;
 					$$ = (Node *) n;
 				}
@@ -6064,7 +6014,6 @@ SecLabelStmt:
 					n->provider = $3;
 					n->objtype = OBJECT_LARGEOBJECT;
 					n->objname = list_make1($7);
-					n->objargs = NIL;
 					n->label = $9;
 					$$ = (Node *) n;
 				}
@@ -6075,7 +6024,6 @@ SecLabelStmt:
 					n->provider = $3;
 					n->objtype = OBJECT_LANGUAGE;
 					n->objname = $7;
-					n->objargs = NIL;
 					n->label = $9;
 					$$ = (Node *) n;
 				}
@@ -7288,8 +7236,7 @@ RemoveFuncStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FUNCTION;
-					n->objects = list_make1($3);
-					n->arguments = list_make1(extractArgTypes($4));
+					n->objects = list_make1(list_make2($3, extractArgTypes($4)));
 					n->behavior = $5;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -7299,8 +7246,7 @@ RemoveFuncStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_FUNCTION;
-					n->objects = list_make1($5);
-					n->arguments = list_make1(extractArgTypes($6));
+					n->objects = list_make1(list_make2($5, extractArgTypes($6)));
 					n->behavior = $7;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -7313,8 +7259,7 @@ RemoveAggrStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_AGGREGATE;
-					n->objects = list_make1($3);
-					n->arguments = list_make1(extractAggrArgTypes($4));
+					n->objects = list_make1(list_make2($3, extractAggrArgTypes($4)));
 					n->behavior = $5;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -7324,8 +7269,7 @@ RemoveAggrStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_AGGREGATE;
-					n->objects = list_make1($5);
-					n->arguments = list_make1(extractAggrArgTypes($6));
+					n->objects = list_make1(list_make2($5, extractAggrArgTypes($6)));
 					n->behavior = $7;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -7338,8 +7282,7 @@ RemoveOperStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_OPERATOR;
-					n->objects = list_make1($3);
-					n->arguments = list_make1($4);
+					n->objects = list_make1(list_make2($3, $4));
 					n->behavior = $5;
 					n->missing_ok = false;
 					n->concurrent = false;
@@ -7349,8 +7292,7 @@ RemoveOperStmt:
 				{
 					DropStmt *n = makeNode(DropStmt);
 					n->removeType = OBJECT_OPERATOR;
-					n->objects = list_make1($5);
-					n->arguments = list_make1($6);
+					n->objects = list_make1(list_make2($5, $6));
 					n->behavior = $7;
 					n->missing_ok = true;
 					n->concurrent = false;
@@ -7466,8 +7408,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;
@@ -7521,8 +7462,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;
@@ -7629,8 +7569,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_AGGREGATE;
-					n->object = $3;
-					n->objarg = extractAggrArgTypes($4);
+					n->object = list_make2($3, extractAggrArgTypes($4));
 					n->newname = $7;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -7693,8 +7632,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
 				{
 					RenameStmt *n = makeNode(RenameStmt);
 					n->renameType = OBJECT_FUNCTION;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = list_make2($3->funcname, $3->funcargs);
 					n->newname = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8113,8 +8051,7 @@ AlterObjectDependsStmt:
 					AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt);
 					n->objectType = OBJECT_FUNCTION;
 					n->relation = NULL;
-					n->objname = $3->funcname;
-					n->objargs = $3->funcargs;
+					n->objname = list_make2($3->funcname, $3->funcargs);
 					n->extname = makeString($7);
 					$$ = (Node *)n;
 				}
@@ -8124,7 +8061,6 @@ AlterObjectDependsStmt:
 					n->objectType = OBJECT_TRIGGER;
 					n->relation = $5;
 					n->objname = list_make1(makeString($3));
-					n->objargs = NIL;
 					n->extname = makeString($9);
 					$$ = (Node *)n;
 				}
@@ -8134,7 +8070,6 @@ AlterObjectDependsStmt:
 					n->objectType = OBJECT_MATVIEW;
 					n->relation = $4;
 					n->objname = NIL;
-					n->objargs = NIL;
 					n->extname = makeString($8);
 					$$ = (Node *)n;
 				}
@@ -8144,7 +8079,6 @@ AlterObjectDependsStmt:
 					n->objectType = OBJECT_INDEX;
 					n->relation = $3;
 					n->objname = NIL;
-					n->objargs = NIL;
 					n->extname = makeString($7);
 					$$ = (Node *)n;
 				}
@@ -8161,8 +8095,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_AGGREGATE;
-					n->object = $3;
-					n->objarg = extractAggrArgTypes($4);
+					n->object = list_make2($3, extractAggrArgTypes($4));
 					n->newschema = $7;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8207,8 +8140,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_FUNCTION;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = list_make2($3->funcname, $3->funcargs);
 					n->newschema = $6;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8217,8 +8149,7 @@ AlterObjectSchemaStmt:
 				{
 					AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
 					n->objectType = OBJECT_OPERATOR;
-					n->object = $3;
-					n->objarg = $4;
+					n->object = list_make2($3, $4);
 					n->newschema = $7;
 					n->missing_ok = false;
 					$$ = (Node *)n;
@@ -8415,8 +8346,7 @@ AlterOwnerStmt: ALTER AGGREGATE func_name aggr_args OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_AGGREGATE;
-					n->object = $3;
-					n->objarg = extractAggrArgTypes($4);
+					n->object = list_make2($3, extractAggrArgTypes($4));
 					n->newowner = $7;
 					$$ = (Node *)n;
 				}
@@ -8456,8 +8386,7 @@ AlterOwnerStmt: ALTER AGGREGATE func_name aggr_args OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_FUNCTION;
-					n->object = $3->funcname;
-					n->objarg = $3->funcargs;
+					n->object = list_make2($3->funcname, $3->funcargs);
 					n->newowner = $6;
 					$$ = (Node *)n;
 				}
@@ -8481,8 +8410,7 @@ AlterOwnerStmt: ALTER AGGREGATE func_name aggr_args OWNER TO RoleSpec
 				{
 					AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
 					n->objectType = OBJECT_OPERATOR;
-					n->object = $3;
-					n->objarg = $4;
+					n->object = list_make2($3, $4);
 					n->newowner = $7;
 					$$ = (Node *)n;
 				}
@@ -8645,7 +8573,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;
@@ -8656,7 +8583,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 0670bc2..61b3d17 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -895,7 +895,6 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
 			stmt->objname = list_make3(makeString(cxt->relation->schemaname),
 									   makeString(cxt->relation->relname),
 									   makeString(def->colname));
-			stmt->objargs = NIL;
 			stmt->comment = comment;
 
 			cxt->alist = lappend(cxt->alist, stmt);
@@ -961,7 +960,6 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
 				stmt->objname = list_make3(makeString(cxt->relation->schemaname),
 										   makeString(cxt->relation->relname),
 										   makeString(n->conname));
-				stmt->objargs = NIL;
 				stmt->comment = comment;
 
 				cxt->alist = lappend(cxt->alist, stmt);
diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h
index 583a120..fd1391e 100644
--- a/src/include/catalog/objectaddress.h
+++ b/src/include/catalog/objectaddress.h
@@ -41,16 +41,16 @@ extern const ObjectAddress InvalidObjectAddress;
 	ObjectAddressSubSet(addr, class_id, object_id, 0)
 
 extern ObjectAddress get_object_address(ObjectType objtype, List *objname,
-				   List *objargs, Relation *relp,
+				   Relation *relp,
 				   LOCKMODE lockmode, bool missing_ok);
 
 extern ObjectAddress get_object_address_rv(ObjectType objtype, RangeVar *rel,
-					  List *objname, List *objargs, Relation *relp,
+					  List *objname, Relation *relp,
 					  LOCKMODE lockmode, bool missing_ok);
 
 extern void check_object_ownership(Oid roleid,
 					   ObjectType objtype, ObjectAddress address,
-					   List *objname, List *objargs, Relation relation);
+					   List *objname, Relation relation);
 
 extern Oid	get_object_namespace(const ObjectAddress *address);
 
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 04b1c2f..13c8cef 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -1955,7 +1955,6 @@ typedef struct AlterExtensionContentsStmt
 	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) */
 } AlterExtensionContentsStmt;
 
 /* ----------------------
@@ -2338,7 +2337,6 @@ typedef struct DropStmt
 {
 	NodeTag		type;
 	List	   *objects;		/* list of sublists of names (as Values) */
-	List	   *arguments;		/* list of sublists of arguments (as Values) */
 	ObjectType	removeType;		/* object type */
 	DropBehavior behavior;		/* RESTRICT or CASCADE behavior */
 	bool		missing_ok;		/* skip error if object is missing? */
@@ -2366,7 +2364,6 @@ 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) */
 	char	   *comment;		/* Comment to insert, or NULL to remove */
 } CommentStmt;
 
@@ -2379,7 +2376,6 @@ 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) */
 	char	   *provider;		/* Label provider (or NULL) */
 	char	   *label;			/* New security label to be assigned */
 } SecLabelStmt;
@@ -2554,7 +2550,6 @@ typedef struct RenameStmt
 	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 */
 	char	   *subname;		/* name of contained object (column, rule,
 								 * trigger, etc) */
 	char	   *newname;		/* the new name */
@@ -2572,7 +2567,6 @@ typedef struct AlterObjectDependsStmt
 	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 */
 	Value	   *extname;		/* extension name */
 } AlterObjectDependsStmt;
 
@@ -2586,7 +2580,6 @@ typedef struct AlterObjectSchemaStmt
 	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 */
 	char	   *newschema;		/* the new schema */
 	bool		missing_ok;		/* skip error if missing? */
 } AlterObjectSchemaStmt;
@@ -2601,7 +2594,6 @@ typedef struct AlterOwnerStmt
 	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	   *newowner;		/* the new owner */
 } AlterOwnerStmt;
 
-- 
2.10.2

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to