@@ -620,6 +620,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
620620 Snapshot snapshot ;
621621 HeapTuple htup ;
622622 bool contains_rel = false;
623+ TupleDesc tupleDescr ;
623624
624625 ScanKeyInit (& key [0 ],
625626 Anum_pathman_config_partrel ,
@@ -628,13 +629,15 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
628629
629630 /* Open PATHMAN_CONFIG with latest snapshot available */
630631 rel = heap_open (get_pathman_config_relid (false), AccessShareLock );
632+ tupleDescr = RelationGetDescr (rel );
631633
632634 /* Check that 'partrel' column is of regclass type */
633- Assert (TupleDescAttr (RelationGetDescr ( rel ) ,
635+ Assert (TupleDescAttr (tupleDescr ,
634636 Anum_pathman_config_partrel - 1 )-> atttypid == REGCLASSOID );
635637
636638 /* Check that number of columns == Natts_pathman_config */
637- Assert (RelationGetDescr (rel )-> natts == Natts_pathman_config );
639+ Assert (tupleDescr -> natts == Natts_pathman_config
640+ || tupleDescr -> natts == Natts_pathman_config_historic );
638641
639642 snapshot = RegisterSnapshot (GetLatestSnapshot ());
640643 scan = heap_beginscan (rel , snapshot , 1 , key );
@@ -647,7 +650,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
647650 if (values && isnull )
648651 {
649652 htup = heap_copytuple (htup );
650- heap_deform_tuple (htup , RelationGetDescr ( rel ) , values , isnull );
653+ heap_deform_tuple (htup , tupleDescr , values , isnull );
651654
652655 /* Perform checks for non-NULL columns */
653656 Assert (!isnull [Anum_pathman_config_partrel - 1 ]);
0 commit comments