diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index 574b46a281..0ddc87da99 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -1729,6 +1729,12 @@ process_owned_by(Relation seqrel, List *owned_by, bool for_identity)
 		depobject.objectId = RelationGetRelid(seqrel);
 		depobject.objectSubId = 0;
 		recordDependencyOn(&depobject, &refobject, deptype);
+
+		/*
+		 * Make dependency visible, which matters for identity sequences
+		 * created with an internal dependency to the object it refers to.
+		 */
+		CommandCounterIncrement();
 	}
 
 	/* Done, but hold lock until commit */
