@@ -648,6 +648,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
648648Snapshot snapshot ;
649649HeapTuple htup ;
650650bool contains_rel = false;
651+ TupleDesc tupleDescr ;
651652
652653ScanKeyInit (& key [0 ],
653654Anum_pathman_config_partrel ,
@@ -656,13 +657,15 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
656657
657658/* Open PATHMAN_CONFIG with latest snapshot available */
658659rel = heap_open (get_pathman_config_relid (false),AccessShareLock );
660+ tupleDescr = RelationGetDescr (rel );
659661
660662/* Check that 'partrel' column is of regclass type */
661- Assert (TupleDescAttr (RelationGetDescr ( rel ) ,
663+ Assert (TupleDescAttr (tupleDescr ,
662664Anum_pathman_config_partrel - 1 )-> atttypid == REGCLASSOID );
663665
664666/* Check that number of columns == Natts_pathman_config */
665- Assert (RelationGetDescr (rel )-> natts == Natts_pathman_config );
667+ Assert (tupleDescr -> natts == Natts_pathman_config
668+ || tupleDescr -> natts == Natts_pathman_config_historic );
666669
667670snapshot = RegisterSnapshot (GetLatestSnapshot ());
668671#if PG_VERSION_NUM >=120000
@@ -679,7 +682,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
679682if (values && isnull )
680683{
681684htup = heap_copytuple (htup );
682- heap_deform_tuple (htup ,RelationGetDescr ( rel ) ,values ,isnull );
685+ heap_deform_tuple (htup ,tupleDescr ,values ,isnull );
683686
684687/* Perform checks for non-NULL columns */
685688Assert (!isnull [Anum_pathman_config_partrel - 1 ]);