mirror of https://github.com/citusdata/citus.git
Fix crash when upgrading to Citus 6
Between restart (running the new code) and ALTER EXTENSION citus UPGRADE there was an inconsistency where we assumed that pg_dist_partition had the repmodel column set. Now we give it a default value if the column doesn't exist yet.pull/1938/head
parent
c3b10e84ba
commit
c9809da4d7
|
@ -338,7 +338,15 @@ LookupDistTableCacheEntry(Oid relationId)
|
||||||
Anum_pg_dist_partition_repmodel,
|
Anum_pg_dist_partition_repmodel,
|
||||||
tupleDescriptor,
|
tupleDescriptor,
|
||||||
&isNull);
|
&isNull);
|
||||||
Assert(!isNull);
|
|
||||||
|
if (isNull)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* repmodel is NOT NULL but before ALTER EXTENSION citus UPGRADE the column
|
||||||
|
* doesn't exist
|
||||||
|
*/
|
||||||
|
replicationModelDatum = CharGetDatum('c');
|
||||||
|
}
|
||||||
|
|
||||||
oldContext = MemoryContextSwitchTo(CacheMemoryContext);
|
oldContext = MemoryContextSwitchTo(CacheMemoryContext);
|
||||||
partitionKeyString = TextDatumGetCString(partitionKeyDatum);
|
partitionKeyString = TextDatumGetCString(partitionKeyDatum);
|
||||||
|
|
Loading…
Reference in New Issue