diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c
new file mode 100644
index f50ae3e..3e309a0
*** a/src/backend/catalog/catalog.c
--- b/src/backend/catalog/catalog.c
*************** IsSharedRelation(Oid relationId)
*** 258,264 ****
  		relationId == PgDbRoleSettingToastTable ||
  		relationId == PgDbRoleSettingToastIndex ||
  		relationId == PgShseclabelToastTable ||
! 		relationId == PgShseclabelToastIndex)
  		return true;
  	return false;
  }
--- 258,270 ----
  		relationId == PgDbRoleSettingToastTable ||
  		relationId == PgDbRoleSettingToastIndex ||
  		relationId == PgShseclabelToastTable ||
! 		relationId == PgShseclabelToastIndex ||
! 		relationId == PgDatabaseToastTable ||
! 		relationId == PgDatabaseToastIndex ||
! 		relationId == PgPlTemplateToastTable ||
! 		relationId == PgPlTemplateToastIndex ||
! 		relationId == PgTablespaceToastTable ||
! 		relationId == PgTablespaceToastIndex)
  		return true;
  	return false;
  }
diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c
new file mode 100644
index b7e1e4b..f62b128
*** a/src/bin/pg_upgrade/check.c
--- b/src/bin/pg_upgrade/check.c
*************** check_new_cluster_is_empty(void)
*** 381,387 ****
  			 relnum++)
  		{
  			/* pg_largeobject and its index should be skipped */
! 			if (strcmp(rel_arr->rels[relnum].nspname, "pg_catalog") != 0)
  				pg_fatal("New cluster database \"%s\" is not empty\n",
  						 new_cluster.dbarr.dbs[dbnum].db_name);
  		}
--- 381,388 ----
  			 relnum++)
  		{
  			/* pg_largeobject and its index should be skipped */
! 			if (strcmp(rel_arr->rels[relnum].nspname, "pg_catalog") != 0 &&
! 				strcmp(rel_arr->rels[relnum].nspname, "pg_toast") != 0)
  				pg_fatal("New cluster database \"%s\" is not empty\n",
  						 new_cluster.dbarr.dbs[dbnum].db_name);
  		}
diff --git a/src/include/catalog/toasting.h b/src/include/catalog/toasting.h
new file mode 100644
index f82a799..4e45809
*** a/src/include/catalog/toasting.h
--- b/src/include/catalog/toasting.h
*************** DECLARE_TOAST(pg_seclabel, 3598, 3599);
*** 55,60 ****
--- 55,71 ----
  DECLARE_TOAST(pg_statistic, 2840, 2841);
  DECLARE_TOAST(pg_statistic_ext, 3439, 3440);
  DECLARE_TOAST(pg_trigger, 2336, 2337);
+ /* declare all the normal catalogs with ACLs as toast too */
+ DECLARE_TOAST(pg_attribute, 9001, 9002);
+ DECLARE_TOAST(pg_class, 9003, 9004);
+ DECLARE_TOAST(pg_default_acl, 9007, 9008);
+ DECLARE_TOAST(pg_foreign_data_wrapper, 9009, 9010);
+ DECLARE_TOAST(pg_foreign_server, 9011, 9012);
+ DECLARE_TOAST(pg_init_privs, 9013, 9014);
+ DECLARE_TOAST(pg_language, 9015, 9016);
+ DECLARE_TOAST(pg_largeobject_metadata, 9017, 9018);
+ DECLARE_TOAST(pg_namespace, 9019, 9020);
+ DECLARE_TOAST(pg_type, 9025, 9026);
  
  /* shared catalogs */
  DECLARE_TOAST(pg_shdescription, 2846, 2847);
*************** DECLARE_TOAST(pg_db_role_setting, 2966, 
*** 66,70 ****
--- 77,91 ----
  DECLARE_TOAST(pg_shseclabel, 4060, 4061);
  #define PgShseclabelToastTable 4060
  #define PgShseclabelToastIndex 4061
+ /* declare all the shared catalogs with ACLs as toast too */
+ DECLARE_TOAST(pg_database, 9005, 9006);
+ #define PgDatabaseToastTable 9005
+ #define PgDatabaseToastIndex 9006
+ DECLARE_TOAST(pg_pltemplate, 9027, 9028);
+ #define PgPlTemplateToastTable 9027
+ #define PgPlTemplateToastIndex 9028
+ DECLARE_TOAST(pg_tablespace, 9023, 9024);
+ #define PgTablespaceToastTable 9023
+ #define PgTablespaceToastIndex 9024
  
  #endif							/* TOASTING_H */
