*** a/src/backend/commands/tablecmds.c
--- b/src/backend/commands/tablecmds.c
***************
*** 2939,2945 **** AlterTableGetLockLevel(List *cmds)
  
  				/*
  				 * These subcommands affect implicit row type conversion. They
! 				 * have affects similar to CREATE/DROP CAST on queries.
  				 * don't provide for invalidating parse trees as a result of
  				 * such changes, so we keep these at AccessExclusiveLock.
  				 */
--- 2939,2945 ----
  
  				/*
  				 * These subcommands affect implicit row type conversion. They
! 				 * have affects similar to CREATE/DROP CAST on queries.  We
  				 * don't provide for invalidating parse trees as a result of
  				 * such changes, so we keep these at AccessExclusiveLock.
  				 */
*** a/src/backend/utils/cache/relcache.c
--- b/src/backend/utils/cache/relcache.c
***************
*** 1889,1895 **** RelationDestroyRelation(Relation relation, bool remember_tupdesc)
  	if (--relation->rd_att->tdrefcount == 0)
  	{
  		/*
! 		 * If we Rebuilt a relcache entry during a transaction then its
  		 * possible we did that because the TupDesc changed as the result
  		 * of an ALTER TABLE that ran at less than AccessExclusiveLock.
  		 * It's possible someone copied that TupDesc, in which case the
--- 1889,1895 ----
  	if (--relation->rd_att->tdrefcount == 0)
  	{
  		/*
! 		 * If we Rebuilt a relcache entry during a transaction then it's
  		 * possible we did that because the TupDesc changed as the result
  		 * of an ALTER TABLE that ran at less than AccessExclusiveLock.
  		 * It's possible someone copied that TupDesc, in which case the
