@@ -620,6 +620,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
620
620
Snapshot snapshot ;
621
621
HeapTuple htup ;
622
622
bool contains_rel = false;
623
+ TupleDesc tupleDescr ;
623
624
624
625
ScanKeyInit (& key [0 ],
625
626
Anum_pathman_config_partrel ,
@@ -628,13 +629,15 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
628
629
629
630
/* Open PATHMAN_CONFIG with latest snapshot available */
630
631
rel = heap_open (get_pathman_config_relid (false), AccessShareLock );
632
+ tupleDescr = RelationGetDescr (rel );
631
633
632
634
/* Check that 'partrel' column is of regclass type */
633
- Assert (TupleDescAttr (RelationGetDescr ( rel ) ,
635
+ Assert (TupleDescAttr (tupleDescr ,
634
636
Anum_pathman_config_partrel - 1 )-> atttypid == REGCLASSOID );
635
637
636
638
/* 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 );
638
641
639
642
snapshot = RegisterSnapshot (GetLatestSnapshot ());
640
643
scan = heap_beginscan (rel , snapshot , 1 , key );
@@ -647,7 +650,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
647
650
if (values && isnull )
648
651
{
649
652
htup = heap_copytuple (htup );
650
- heap_deform_tuple (htup , RelationGetDescr ( rel ) , values , isnull );
653
+ heap_deform_tuple (htup , tupleDescr , values , isnull );
651
654
652
655
/* Perform checks for non-NULL columns */
653
656
Assert (!isnull [Anum_pathman_config_partrel - 1 ]);
0 commit comments