From: Guillaume Lelarge Date: Thu, 28 Nov 2019 11:31:55 +0000 (+0100) Subject: Add support for PostgreSQL v12 X-Git-Tag: REL_12_0~6 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=c2fb5f790a5fb84659530c19dd3caa7e527413a4;p=pg_filedump.git Add support for PostgreSQL v12 --- diff --git a/decode.c b/decode.c index a842675..9415baa 100644 --- a/decode.c +++ b/decode.c @@ -898,7 +898,11 @@ decode_string(const char *buffer, unsigned int buff_size, unsigned int *out_size } decompress_ret = pglz_decompress(VARDATA_4B_C(buffer), len - 2 * sizeof(uint32), - decompress_tmp_buff, decompressed_len); + decompress_tmp_buff, decompressed_len +#if PG_VERSION_NUM >= 120000 + , true +#endif + ); if ((decompress_ret != decompressed_len) || (decompress_ret < 0)) { printf("WARNING: Unable to decompress a string. Data is corrupted.\n"); @@ -979,7 +983,11 @@ static int DumpCompressedString(const char *data, int32 decompressed_size) decompress_ret = pglz_decompress(TOAST_COMPRESS_RAWDATA(data), decompressed_size - TOAST_COMPRESS_HEADER_SIZE, - decompress_tmp_buff, TOAST_COMPRESS_RAWSIZE(data)); + decompress_tmp_buff, TOAST_COMPRESS_RAWSIZE(data) +#if PG_VERSION_NUM >= 120000 + , true +#endif + ); if ((decompress_ret != TOAST_COMPRESS_RAWSIZE(data)) || (decompress_ret < 0)) { diff --git a/pg_filedump.c b/pg_filedump.c index 318e4bd..a2722e1 100644 --- a/pg_filedump.c +++ b/pg_filedump.c @@ -1314,9 +1314,11 @@ FormatItem(char *buffer, unsigned int numBytes, unsigned int startIndex, HeapTupleHeaderGetRawXmax(htup), HeapTupleHeaderGetRawCommandId(htup)); +#if PG_VERSION_NUM < 120000 if (infoMask & HEAP_HASOID) printf(" OID: %u", HeapTupleHeaderGetOid(htup)); +#endif printf("\n" " Block Id: %u linp Index: %u Attributes: %d Size: %d\n", @@ -1334,8 +1336,10 @@ FormatItem(char *buffer, unsigned int numBytes, unsigned int startIndex, strcat(flagString, "HASVARWIDTH|"); if (infoMask & HEAP_HASEXTERNAL) strcat(flagString, "HASEXTERNAL|"); +#if PG_VERSION_NUM < 120000 if (infoMask & HEAP_HASOID) strcat(flagString, "HASOID|"); +#endif if (infoMask & HEAP_XMAX_KEYSHR_LOCK) strcat(flagString, "XMAX_KEYSHR_LOCK|"); if (infoMask & HEAP_COMBOCID) @@ -1380,8 +1384,10 @@ FormatItem(char *buffer, unsigned int numBytes, unsigned int startIndex, else bitmapLength = 0; +#if PG_VERSION_NUM < 120000 if (infoMask & HEAP_HASOID) oidLength += sizeof(Oid); +#endif computedLength = MAXALIGN(localBitOffset + bitmapLength + oidLength); @@ -1774,7 +1780,12 @@ FormatControl(char *buffer) #endif (uint32) (checkPoint->redo >> 32), (uint32) checkPoint->redo, checkPoint->ThisTimeLineID, +#if PG_VERSION_NUM < 120000 checkPoint->nextXidEpoch, checkPoint->nextXid, +#else + EpochFromFullTransactionId(checkPoint->nextFullXid), + XidFromFullTransactionId(checkPoint->nextFullXid), +#endif checkPoint->nextOid, checkPoint->nextMulti, checkPoint->nextMultiOffset, ctime(&cp_time),