diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c
index 256486c..e7ec7e2 100644
--- a/src/backend/catalog/dependency.c
+++ b/src/backend/catalog/dependency.c
@@ -2142,6 +2142,31 @@ object_address_present_add_flags(const ObjectAddress *object,
 				 */
 				return true;
 			}
+			if (object->objectSubId == 0)
+			{
+				/*
+				 * If we got here, it means that we are dropping table whose
+				 * columns are already in the object list, since we assume
+				 * later on that there are no subobjects of object present
+				 * in the list, we should remove those.
+				 *
+				 * Note that this is very rare occasion that normally happens
+				 * only when dropping extension which had some of its table
+				 * columns ALTERed after CREATE with custom types or
+				 * collations.
+				 */
+				if (i < addrs->numrefs - 1)
+				{
+					ObjectAddressExtra *thisextra = addrs->extras + i;
+
+					memmove(thisobj, thisobj + 1,
+							(addrs->numrefs - 1 - i) * sizeof(ObjectAddress));
+					memmove(thisextra, thisextra + 1,
+							(addrs->numrefs - 1 - i) * sizeof(ObjectAddressExtra));
+				}
+				addrs->numrefs--;
+				continue;
+			}
 		}
 	}
 
