@@ -648,6 +648,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
648648 Snapshot snapshot ;
649649 HeapTuple htup ;
650650 bool contains_rel = false;
651+ TupleDesc tupleDescr ;
651652
652653 ScanKeyInit (& key [0 ],
653654 Anum_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 */
658659 rel = 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 ,
662664 Anum_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
667670 snapshot = RegisterSnapshot (GetLatestSnapshot ());
668671#if PG_VERSION_NUM >= 120000
@@ -679,7 +682,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
679682 if (values && isnull )
680683 {
681684 htup = 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 */
685688 Assert (!isnull [Anum_pathman_config_partrel - 1 ]);
0 commit comments