1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Remove support for PostgreSQL 9.0/9.1/9.2.

Our new policy is to support ten versions of PostgreSQL, the five supported releases and the last five EOL releases. As of PostgreSQL 15, that means 9.0/9.1/9.2 are no longer supported by pgBackRest.

Remove all logic associated with 9.0/9.1/9.2 and update the tests.

Document the new support policy.

Update InfoPg to read/write control versions for the history in backup.info, since we can no longer rely on the mappings being available. In theory this could have been an issue after removing 8.3/8.4 if anybody was using a version that old.
This commit is contained in:
David Steele
2022-12-20 12:20:47 +07:00
committed by GitHub
parent 17ce738ff7
commit 77c721eb63
50 changed files with 461 additions and 1450 deletions

View File

@ -442,30 +442,23 @@ pgTimelineFromWalSegment(const String *const walSegment)
/**********************************************************************************************************************************/
StringList *
pgLsnRangeToWalSegmentList(
const unsigned int pgVersion, const uint32_t timeline, const uint64_t lsnStart, const uint64_t lsnStop,
const unsigned int walSegmentSize)
const uint32_t timeline, const uint64_t lsnStart, const uint64_t lsnStop, const unsigned int walSegmentSize)
{
FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(UINT, pgVersion);
FUNCTION_TEST_PARAM(UINT, timeline);
FUNCTION_TEST_PARAM(UINT64, lsnStart);
FUNCTION_TEST_PARAM(UINT64, lsnStop);
FUNCTION_TEST_PARAM(UINT, walSegmentSize);
FUNCTION_TEST_END();
ASSERT(pgVersion != 0);
ASSERT(timeline != 0);
ASSERT(lsnStart <= lsnStop);
ASSERT(walSegmentSize != 0);
ASSERT(pgVersion > PG_VERSION_92 || walSegmentSize == PG_WAL_SEGMENT_SIZE_DEFAULT);
StringList *const result = strLstNew();
MEM_CONTEXT_TEMP_BEGIN()
{
// Skip the FF segment when PostgreSQL <= 9.2 (in this case segment size should always be 16MB)
const bool skipFF = pgVersion <= PG_VERSION_92;
// Calculate the start and stop segments
unsigned int startMajor = (unsigned int)(lsnStart >> 32);
unsigned int startMinor = (unsigned int)(lsnStart & 0xFFFFFFFF) / walSegmentSize;
@ -482,7 +475,7 @@ pgLsnRangeToWalSegmentList(
{
startMinor++;
if ((skipFF && startMinor == 0xFF) || (!skipFF && startMinor > minorPerMajor))
if (startMinor > minorPerMajor)
{
startMajor++;
startMinor = 0;

View File

@ -143,7 +143,7 @@ String *pgVersionToStr(unsigned int version);
PgWal pgWalFromFile(const String *walFile, const Storage *storage);
PgWal pgWalFromBuffer(const Buffer *walBuffer);
// Get the tablespace identifier used to distinguish versions in a tablespace directory, e.g. PG_9.0_201008051
// Get the tablespace identifier used to distinguish versions in a tablespace directory, e.g. PG_15_202209061
String *pgTablespaceId(unsigned int pgVersion, unsigned int pgCatalogVersion);
// Convert a string to an lsn and vice versa
@ -158,8 +158,7 @@ uint64_t pgLsnFromWalSegment(const String *walSegment, unsigned int walSegmentSi
uint32_t pgTimelineFromWalSegment(const String *walSegment);
// Convert a timeline and lsn range to a list of wal segments
StringList *pgLsnRangeToWalSegmentList(
unsigned int pgVersion, uint32_t timeline, uint64_t lsnStart, uint64_t lsnStop, unsigned int walSegmentSize);
StringList *pgLsnRangeToWalSegmentList(uint32_t timeline, uint64_t lsnStart, uint64_t lsnStop, unsigned int walSegmentSize);
// Get name used for lsn in functions (this was changed in PostgreSQL 10 for consistency since lots of names were changing)
const String *pgLsnName(unsigned int pgVersion);

View File

@ -16,7 +16,7 @@ alpha/beta/rc period without needing to be updated, unless of course the actual
***********************************************************************************************************************************/
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
#ifdef CATALOG_VERSION_NO_MAX
@ -75,28 +75,6 @@ Read the version specific pg_control into a general data structure
}; \
}
#elif PG_VERSION >= PG_VERSION_90
#define PG_INTERFACE_CONTROL(version) \
static PgControl \
pgInterfaceControl##version(const unsigned char *controlFile) \
{ \
ASSERT(controlFile != NULL); \
ASSERT(pgInterfaceControlIs##version(controlFile)); \
\
return (PgControl) \
{ \
.systemId = ((ControlFileData *)controlFile)->system_identifier, \
.catalogVersion = ((ControlFileData *)controlFile)->catalog_version_no, \
.checkpoint = \
(uint64_t)((ControlFileData *)controlFile)->checkPoint.xlogid << 32 | \
((ControlFileData *)controlFile)->checkPoint.xrecoff, \
.timeline = ((ControlFileData *)controlFile)->checkPointCopy.ThisTimeLineID, \
.pageSize = ((ControlFileData *)controlFile)->blcksz, \
.walSegmentSize = ((ControlFileData *)controlFile)->xlog_seg_size, \
}; \
}
#endif
/***********************************************************************************************************************************
@ -104,7 +82,7 @@ Get the control version
***********************************************************************************************************************************/
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
#define PG_INTERFACE_CONTROL_VERSION(version) \
static uint32_t \
@ -120,7 +98,7 @@ Determine if the supplied WAL is for this version of PostgreSQL
***********************************************************************************************************************************/
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
#define PG_INTERFACE_WAL_IS(version) \
static bool \
@ -138,7 +116,7 @@ Read the version specific WAL header into a general data structure
***********************************************************************************************************************************/
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
#define PG_INTERFACE_WAL(version) \
static PgWal \

View File

@ -31,7 +31,7 @@ Types from src/include/c.h
// ---------------------------------------------------------------------------------------------------------------------------------
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
typedef int64_t int64;
@ -41,7 +41,7 @@ typedef int64_t int64;
// ---------------------------------------------------------------------------------------------------------------------------------
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
/* MultiXactId must be equivalent to TransactionId, to fit in t_xmax */
typedef TransactionId MultiXactId;
@ -52,7 +52,7 @@ typedef TransactionId MultiXactId;
// ---------------------------------------------------------------------------------------------------------------------------------
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
typedef uint32 MultiXactOffset;
@ -66,7 +66,7 @@ Types from src/include/pgtime.h
// ---------------------------------------------------------------------------------------------------------------------------------
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
/*
* The API of this library is generally similar to the corresponding
@ -85,7 +85,7 @@ Types from src/include/postgres_ext.h
// ---------------------------------------------------------------------------------------------------------------------------------
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
/*
* Object ID is a fundamental type in Postgres.
@ -106,7 +106,7 @@ Types from src/include/port/pg_crc32.h
typedef uint32 pg_crc32c;
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
typedef uint32 pg_crc32;
@ -128,36 +128,13 @@ Types from src/include/access/xlogdefs.h
*/
typedef uint64 XLogRecPtr;
#elif PG_VERSION >= PG_VERSION_90
/*
* Pointer to a location in the XLOG. These pointers are 64 bits wide,
* because we don't want them ever to overflow.
*
* NOTE: xrecoff == 0 is used to indicate an invalid pointer. This is OK
* because we use page headers in the XLOG, so no XLOG record can start
* right at the beginning of a file.
*
* NOTE: the "log file number" is somewhat misnamed, since the actual files
* making up the XLOG are much smaller than 4Gb. Each actual file is an
* XLogSegSize-byte "segment" of a logical log file having the indicated
* xlogid. The log file number and segment number together identify a
* physical XLOG file. Segment number and offset within the physical file
* are computed from xrecoff div and mod XLogSegSize.
*/
typedef struct XLogRecPtr
{
uint32 xlogid; /* log file #, 0 based */
uint32 xrecoff; /* byte offset of location in log file */
} XLogRecPtr;
#endif
// TimeLineID type
// ---------------------------------------------------------------------------------------------------------------------------------
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
/*
* TimeLineID (TLI) - identifies different database histories to prevent
@ -310,45 +287,6 @@ Types from src/include/catalog/catversion.h
/* yyyymmddN */
#define CATALOG_VERSION_NO 201306121
#elif PG_VERSION >= PG_VERSION_92
/*
* We could use anything we wanted for version numbers, but I recommend
* following the "YYYYMMDDN" style often used for DNS zone serial numbers.
* YYYYMMDD are the date of the change, and N is the number of the change
* on that day. (Hopefully we'll never commit ten independent sets of
* catalog changes on the same day...)
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 201204301
#elif PG_VERSION >= PG_VERSION_91
/*
* We could use anything we wanted for version numbers, but I recommend
* following the "YYYYMMDDN" style often used for DNS zone serial numbers.
* YYYYMMDD are the date of the change, and N is the number of the change
* on that day. (Hopefully we'll never commit ten independent sets of
* catalog changes on the same day...)
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 201105231
#elif PG_VERSION >= PG_VERSION_90
/*
* We could use anything we wanted for version numbers, but I recommend
* following the "YYYYMMDDN" style often used for DNS zone serial numbers.
* YYYYMMDD are the date of the change, and N is the number of the change
* on that day. (Hopefully we'll never commit ten independent sets of
* catalog changes on the same day...)
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 201008051
#endif
/***********************************************************************************************************************************
@ -416,16 +354,6 @@ Types from src/include/catalog/pg_control.h
/* Version identifier for this pg_control format */
#define PG_CONTROL_VERSION 937
#elif PG_VERSION >= PG_VERSION_92
/* Version identifier for this pg_control format */
#define PG_CONTROL_VERSION 922
#elif PG_VERSION >= PG_VERSION_90
/* Version identifier for this pg_control format */
#define PG_CONTROL_VERSION 903
#endif
// MOCK_AUTH_NONCE_LEN define
@ -632,74 +560,13 @@ typedef struct CheckPoint
TransactionId oldestActiveXid;
} CheckPoint;
#elif PG_VERSION >= PG_VERSION_92
/*
* Body of CheckPoint XLOG records. This is declared here because we keep
* a copy of the latest one in pg_control for possible disaster recovery.
* Changing this struct requires a PG_CONTROL_VERSION bump.
*/
typedef struct CheckPoint
{
XLogRecPtr redo; /* next RecPtr available when we began to
* create CheckPoint (i.e. REDO start point) */
TimeLineID ThisTimeLineID; /* current TLI */
bool fullPageWrites; /* current full_page_writes */
uint32 nextXidEpoch; /* higher-order bits of nextXid */
TransactionId nextXid; /* next free XID */
Oid nextOid; /* next free OID */
MultiXactId nextMulti; /* next free MultiXactId */
MultiXactOffset nextMultiOffset; /* next free MultiXact offset */
TransactionId oldestXid; /* cluster-wide minimum datfrozenxid */
Oid oldestXidDB; /* database with minimum datfrozenxid */
pg_time_t time; /* time stamp of checkpoint */
/*
* Oldest XID still running. This is only needed to initialize hot standby
* mode from an online checkpoint, so we only bother calculating this for
* online checkpoints and only when wal_level is hot_standby. Otherwise
* it's set to InvalidTransactionId.
*/
TransactionId oldestActiveXid;
} CheckPoint;
#elif PG_VERSION >= PG_VERSION_90
/*
* Body of CheckPoint XLOG records. This is declared here because we keep
* a copy of the latest one in pg_control for possible disaster recovery.
* Changing this struct requires a PG_CONTROL_VERSION bump.
*/
typedef struct CheckPoint
{
XLogRecPtr redo; /* next RecPtr available when we began to
* create CheckPoint (i.e. REDO start point) */
TimeLineID ThisTimeLineID; /* current TLI */
uint32 nextXidEpoch; /* higher-order bits of nextXid */
TransactionId nextXid; /* next free XID */
Oid nextOid; /* next free OID */
MultiXactId nextMulti; /* next free MultiXactId */
MultiXactOffset nextMultiOffset; /* next free MultiXact offset */
TransactionId oldestXid; /* cluster-wide minimum datfrozenxid */
Oid oldestXidDB; /* database with minimum datfrozenxid */
pg_time_t time; /* time stamp of checkpoint */
/*
* Oldest XID still running. This is only needed to initialize hot standby
* mode from an online checkpoint, so we only bother calculating this for
* online checkpoints and only when wal_level is hot_standby. Otherwise
* it's set to InvalidTransactionId.
*/
TransactionId oldestActiveXid;
} CheckPoint;
#endif
// DBState enum
// ---------------------------------------------------------------------------------------------------------------------------------
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_91
#elif PG_VERSION >= PG_VERSION_93
/*
* System status indicator. Note this is stored in pg_control; if you change
@ -716,19 +583,6 @@ typedef enum DBState
DB_IN_PRODUCTION
} DBState;
#elif PG_VERSION >= PG_VERSION_90
/* System status indicator */
typedef enum DBState
{
DB_STARTUP = 0,
DB_SHUTDOWNED,
DB_SHUTDOWNING,
DB_IN_CRASH_RECOVERY,
DB_IN_ARCHIVE_RECOVERY,
DB_IN_PRODUCTION
} DBState;
#endif
// ControlFileData type
@ -1843,252 +1697,6 @@ typedef struct ControlFileData
pg_crc32 crc;
} ControlFileData;
#elif PG_VERSION >= PG_VERSION_92
/*
* Contents of pg_control.
*
* NOTE: try to keep this under 512 bytes so that it will fit on one physical
* sector of typical disk drives. This reduces the odds of corruption due to
* power failure midway through a write.
*/
typedef struct ControlFileData
{
/*
* Unique system identifier --- to ensure we match up xlog files with the
* installation that produced them.
*/
uint64 system_identifier;
/*
* Version identifier information. Keep these fields at the same offset,
* especially pg_control_version; they won't be real useful if they move
* around. (For historical reasons they must be 8 bytes into the file
* rather than immediately at the front.)
*
* pg_control_version identifies the format of pg_control itself.
* catalog_version_no identifies the format of the system catalogs.
*
* There are additional version identifiers in individual files; for
* example, WAL logs contain per-page magic numbers that can serve as
* version cues for the WAL log.
*/
uint32 pg_control_version; /* PG_CONTROL_VERSION */
uint32 catalog_version_no; /* see catversion.h */
/*
* System status data
*/
DBState state; /* see enum above */
pg_time_t time; /* time stamp of last pg_control update */
XLogRecPtr checkPoint; /* last check point record ptr */
XLogRecPtr prevCheckPoint; /* previous check point record ptr */
CheckPoint checkPointCopy; /* copy of last check point record */
/*
* These two values determine the minimum point we must recover up to
* before starting up:
*
* minRecoveryPoint is updated to the latest replayed LSN whenever we
* flush a data change during archive recovery. That guards against
* starting archive recovery, aborting it, and restarting with an earlier
* stop location. If we've already flushed data changes from WAL record X
* to disk, we mustn't start up until we reach X again. Zero when not
* doing archive recovery.
*
* backupStartPoint is the redo pointer of the backup start checkpoint, if
* we are recovering from an online backup and haven't reached the end of
* backup yet. It is reset to zero when the end of backup is reached, and
* we mustn't start up before that. A boolean would suffice otherwise, but
* we use the redo pointer as a cross-check when we see an end-of-backup
* record, to make sure the end-of-backup record corresponds the base
* backup we're recovering from.
*
* backupEndPoint is the backup end location, if we are recovering from an
* online backup which was taken from the standby and haven't reached the
* end of backup yet. It is initialized to the minimum recovery point in
* pg_control which was backed up last. It is reset to zero when the end
* of backup is reached, and we mustn't start up before that.
*
* If backupEndRequired is true, we know for sure that we're restoring
* from a backup, and must see a backup-end record before we can safely
* start up. If it's false, but backupStartPoint is set, a backup_label
* file was found at startup but it may have been a leftover from a stray
* pg_start_backup() call, not accompanied by pg_stop_backup().
*/
XLogRecPtr minRecoveryPoint;
XLogRecPtr backupStartPoint;
XLogRecPtr backupEndPoint;
bool backupEndRequired;
/*
* Parameter settings that determine if the WAL can be used for archival
* or hot standby.
*/
int wal_level;
int MaxConnections;
int max_prepared_xacts;
int max_locks_per_xact;
/*
* This data is used to check for hardware-architecture compatibility of
* the database and the backend executable. We need not check endianness
* explicitly, since the pg_control version will surely look wrong to a
* machine of different endianness, but we do need to worry about MAXALIGN
* and floating-point format. (Note: storage layout nominally also
* depends on SHORTALIGN and INTALIGN, but in practice these are the same
* on all architectures of interest.)
*
* Testing just one double value is not a very bulletproof test for
* floating-point compatibility, but it will catch most cases.
*/
uint32 maxAlign; /* alignment requirement for tuples */
double floatFormat; /* constant 1234567.0 */
#define FLOATFORMAT_VALUE 1234567.0
/*
* This data is used to make sure that configuration of this database is
* compatible with the backend executable.
*/
uint32 blcksz; /* data block size for this DB */
uint32 relseg_size; /* blocks per segment of large relation */
uint32 xlog_blcksz; /* block size within WAL files */
uint32 xlog_seg_size; /* size of each WAL segment */
uint32 nameDataLen; /* catalog name field width */
uint32 indexMaxKeys; /* max number of columns in an index */
uint32 toast_max_chunk_size; /* chunk size in TOAST tables */
/* flag indicating internal format of timestamp, interval, time */
bool enableIntTimes; /* int64 storage enabled? */
/* flags indicating pass-by-value status of various types */
bool float4ByVal; /* float4 pass-by-value? */
bool float8ByVal; /* float8, int8, etc pass-by-value? */
/* CRC of all above ... MUST BE LAST! */
pg_crc32 crc;
} ControlFileData;
#elif PG_VERSION >= PG_VERSION_90
/*
* Contents of pg_control.
*
* NOTE: try to keep this under 512 bytes so that it will fit on one physical
* sector of typical disk drives. This reduces the odds of corruption due to
* power failure midway through a write.
*/
typedef struct ControlFileData
{
/*
* Unique system identifier --- to ensure we match up xlog files with the
* installation that produced them.
*/
uint64 system_identifier;
/*
* Version identifier information. Keep these fields at the same offset,
* especially pg_control_version; they won't be real useful if they move
* around. (For historical reasons they must be 8 bytes into the file
* rather than immediately at the front.)
*
* pg_control_version identifies the format of pg_control itself.
* catalog_version_no identifies the format of the system catalogs.
*
* There are additional version identifiers in individual files; for
* example, WAL logs contain per-page magic numbers that can serve as
* version cues for the WAL log.
*/
uint32 pg_control_version; /* PG_CONTROL_VERSION */
uint32 catalog_version_no; /* see catversion.h */
/*
* System status data
*/
DBState state; /* see enum above */
pg_time_t time; /* time stamp of last pg_control update */
XLogRecPtr checkPoint; /* last check point record ptr */
XLogRecPtr prevCheckPoint; /* previous check point record ptr */
CheckPoint checkPointCopy; /* copy of last check point record */
/*
* These two values determine the minimum point we must recover up to
* before starting up:
*
* minRecoveryPoint is updated to the latest replayed LSN whenever we
* flush a data change during archive recovery. That guards against
* starting archive recovery, aborting it, and restarting with an earlier
* stop location. If we've already flushed data changes from WAL record X
* to disk, we mustn't start up until we reach X again. Zero when not
* doing archive recovery.
*
* backupStartPoint is the redo pointer of the backup start checkpoint, if
* we are recovering from an online backup and haven't reached the end of
* backup yet. It is reset to zero when the end of backup is reached, and
* we mustn't start up before that. A boolean would suffice otherwise, but
* we use the redo pointer as a cross-check when we see an end-of-backup
* record, to make sure the end-of-backup record corresponds the base
* backup we're recovering from.
*/
XLogRecPtr minRecoveryPoint;
XLogRecPtr backupStartPoint;
/*
* Parameter settings that determine if the WAL can be used for archival
* or hot standby.
*/
int wal_level;
int MaxConnections;
int max_prepared_xacts;
int max_locks_per_xact;
/*
* This data is used to check for hardware-architecture compatibility of
* the database and the backend executable. We need not check endianness
* explicitly, since the pg_control version will surely look wrong to a
* machine of different endianness, but we do need to worry about MAXALIGN
* and floating-point format. (Note: storage layout nominally also
* depends on SHORTALIGN and INTALIGN, but in practice these are the same
* on all architectures of interest.)
*
* Testing just one double value is not a very bulletproof test for
* floating-point compatibility, but it will catch most cases.
*/
uint32 maxAlign; /* alignment requirement for tuples */
double floatFormat; /* constant 1234567.0 */
#define FLOATFORMAT_VALUE 1234567.0
/*
* This data is used to make sure that configuration of this database is
* compatible with the backend executable.
*/
uint32 blcksz; /* data block size for this DB */
uint32 relseg_size; /* blocks per segment of large relation */
uint32 xlog_blcksz; /* block size within WAL files */
uint32 xlog_seg_size; /* size of each WAL segment */
uint32 nameDataLen; /* catalog name field width */
uint32 indexMaxKeys; /* max number of columns in an index */
uint32 toast_max_chunk_size; /* chunk size in TOAST tables */
/* flag indicating internal format of timestamp, interval, time */
bool enableIntTimes; /* int64 storage enabled? */
/* flags indicating pass-by-value status of various types */
bool float4ByVal; /* float4 pass-by-value? */
bool float8ByVal; /* float8, int8, etc pass-by-value? */
/* CRC of all above ... MUST BE LAST! */
pg_crc32 crc;
} ControlFileData;
#endif
/***********************************************************************************************************************************
@ -2139,18 +1747,6 @@ Types from src/include/access/xlog_internal.h
#define XLOG_PAGE_MAGIC 0xD075 /* can be used as WAL version indicator */
#elif PG_VERSION >= PG_VERSION_92
#define XLOG_PAGE_MAGIC 0xD071 /* can be used as WAL version indicator */
#elif PG_VERSION >= PG_VERSION_91
#define XLOG_PAGE_MAGIC 0xD066 /* can be used as WAL version indicator */
#elif PG_VERSION >= PG_VERSION_90
#define XLOG_PAGE_MAGIC 0xD064 /* can be used as WAL version indicator */
#endif
// XLogPageHeaderData type
@ -2202,26 +1798,13 @@ typedef struct XLogPageHeaderData
uint32 xlp_rem_len; /* total len of remaining data for record */
} XLogPageHeaderData;
#elif PG_VERSION >= PG_VERSION_90
/*
* Each page of XLOG file has a header like this:
*/
typedef struct XLogPageHeaderData
{
uint16 xlp_magic; /* magic value for correctness checks */
uint16 xlp_info; /* flag bits, see below */
TimeLineID xlp_tli; /* TimeLineID of first record on page */
XLogRecPtr xlp_pageaddr; /* XLOG address of this page */
} XLogPageHeaderData;
#endif
// XLogLongPageHeaderData type
// ---------------------------------------------------------------------------------------------------------------------------------
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
/*
* When the XLP_LONG_HEADER flag is set, we store additional fields in the
@ -2242,7 +1825,7 @@ typedef struct XLogLongPageHeaderData
// ---------------------------------------------------------------------------------------------------------------------------------
#if PG_VERSION > PG_VERSION_MAX
#elif PG_VERSION >= PG_VERSION_90
#elif PG_VERSION >= PG_VERSION_93
/* This flag indicates a "long" page header */
#define XLP_LONG_HEADER 0x0002

View File

@ -12,9 +12,6 @@ PostgreSQL name
/***********************************************************************************************************************************
PostgreSQL version constants
***********************************************************************************************************************************/
#define PG_VERSION_90 90000
#define PG_VERSION_91 90100
#define PG_VERSION_92 90200
#define PG_VERSION_93 90300
#define PG_VERSION_94 90400
#define PG_VERSION_95 90500
@ -31,18 +28,6 @@ PostgreSQL version constants
/***********************************************************************************************************************************
Version where various PostgreSQL capabilities were introduced
***********************************************************************************************************************************/
// pg_is_in_recovery() supported
#define PG_VERSION_HOT_STANDBY PG_VERSION_91
// pg_create_restore_point() supported
#define PG_VERSION_RESTORE_POINT PG_VERSION_91
// pause_at_recovery_target is supported
#define PG_VERSION_RECOVERY_TARGET_PAUSE PG_VERSION_91
// Backup from standby is supported
#define PG_VERSION_BACKUP_STANDBY PG_VERSION_92
// tablespace_map is created during backup
#define PG_VERSION_TABLESPACE_MAP PG_VERSION_95
@ -61,9 +46,6 @@ Version where various PostgreSQL capabilities were introduced
/***********************************************************************************************************************************
PostgreSQL version string constants for use in error messages
***********************************************************************************************************************************/
#define PG_VERSION_90_STR "9.0"
#define PG_VERSION_91_STR "9.1"
#define PG_VERSION_92_STR "9.2"
#define PG_VERSION_93_STR "9.3"
#define PG_VERSION_94_STR "9.4"
#define PG_VERSION_95_STR "9.5"