diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index 15f5af0..8664203 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -361,6 +361,41 @@ ExecuteGrantStmt(GrantStmt *stmt)
 	}
 
 	ExecGrantStmt_oids(&istmt);
+
+	/* If INSERT or UPDATE privileges are being granted or revoked on a
+	 * relation, this extends the operation to include any sequences
+	 * owned by the relation.
+	 */
+
+	if (istmt.objtype == ACL_OBJECT_RELATION &&
+		(istmt.privileges & (ACL_INSERT | ACL_UPDATE)))
+	{
+		InternalGrant istmt_seq;
+
+		istmt_seq.is_grant = istmt.is_grant;
+		istmt_seq.objtype = ACL_OBJECT_SEQUENCE;
+		istmt_seq.grantees = istmt.grantees;
+		istmt_seq.grant_option = istmt.grant_option;
+		istmt_seq.behavior = istmt.behavior;
+		istmt_seq.all_privs = false;
+
+		istmt_seq.privileges = ACL_NO_RIGHTS;
+		if (istmt.privileges & ACL_INSERT)
+			istmt_seq.privileges |= ACL_USAGE;
+		if (istmt.privileges & ACL_UPDATE)
+			istmt_seq.privileges |= ACL_UPDATE;
+
+		istmt_seq.objects = NIL;
+		foreach (cell, istmt.objects)
+		{
+			istmt_seq.objects =
+				list_concat(istmt_seq.objects,
+							getOwnedSequences(lfirst_oid(cell)));
+		}
+
+		if (istmt_seq.objects != NIL)
+			ExecGrantStmt_oids(&istmt_seq);
+	}
 }
 
 /*
