Skip to content

Commit f8d5a5a

Browse files
committed
Postgres Pro Enterprise compatibility fixes by Victor Wagner (@vbwagner)
1 parent c871c0b commit f8d5a5a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/include/compat/pg_compat.h

+12
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,18 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
626626
#endif
627627

628628

629+
/*
630+
* HeapTupleGetXmin()
631+
* Vanilla PostgreSQL has HeaptTupleHeaderGetXmin, but for 64-bit xid
632+
* we need access to entire tuple, not just its header.
633+
*/
634+
#ifdef XID_IS_64BIT
635+
# define HeapTupleGetXminCompat(htup) HeapTupleGetXmin(htup)
636+
#else
637+
# define HeapTupleGetXminCompat(htup) HeapTupleHeaderGetXmin((htup)->t_data)
638+
#endif
639+
640+
629641
/*
630642
* -------------
631643
* Common code

src/init.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ pathman_config_contains_relation(Oid relid, Datum *values, bool *isnull,
675675

676676
/* Set xmin if necessary */
677677
if (xmin)
678-
*xmin = HeapTupleHeaderGetXmin(htup->t_data);
678+
*xmin = HeapTupleGetXminCompat(htup);
679679

680680
/* Set ItemPointer if necessary */
681681
if (iptr)

0 commit comments

Comments
 (0)