Fix failures during pg_upgrade

- fix error in CitusHasBeenLoaded()
- allow creation of pg_catalog tables during upgrade
pull/973/head
Murat Tuncer 2016-11-08 16:00:52 -08:00
parent 5ee6a0ee3f
commit b5c1ecb684
2 changed files with 12 additions and 1 deletions

View File

@ -157,6 +157,13 @@ _PG_init(void)
/* initialize transaction callbacks */
RegisterRouterExecutorXactCallbacks();
RegisterShardPlacementXactCallbacks();
/* enable modification of pg_catalog tables during pg_upgrade */
if (IsBinaryUpgrade)
{
SetConfigOption("allow_system_table_mods", "true", PGC_POSTMASTER,
PGC_S_OVERRIDE);
}
}

View File

@ -642,7 +642,8 @@ CitusHasBeenLoaded(void)
}
}
extensionLoaded = extensionPresent && extensionScriptExecuted;
/* we disable extension features during pg_upgrade */
extensionLoaded = extensionPresent && extensionScriptExecuted && !IsBinaryUpgrade;
if (extensionLoaded)
{
@ -653,6 +654,9 @@ CitusHasBeenLoaded(void)
*
* Ensure InvalidateDistRelationCacheCallback will notice those changes
* by caching pg_dist_partition's oid.
*
* We skip these checks during upgrade since pg_dist_partition is not
* present during early stages of upgrade operation.
*/
DistPartitionRelationId();
}