You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-27 00:21:08 +02:00
Remove most references to PostgreSQL control and catalog versions.
The control and catalog versions were stored a variety of places in the optimistic hope that they would be useful. In fact they never were. We can't remove them from the backup.info and backup.manifest files due to backwards compatibility concerns, but we can at least avoid loading and storing them in C structures. Add functions to the PostgreSQL interface which will return the control and catalog versions for any supported version of PostgreSQL to allow backwards compatibility for backup.info and backup.manifest. These functions will be useful in other ways, e.g. generating the tablespace identifier in PostgreSQL >= 9.0.
This commit is contained in:
@ -30,6 +30,18 @@ testRun(void)
|
||||
TEST_RESULT_STR(strPtr(pgVersionToStr(83456)), "8.34", "infoPgVersionToString 83456");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("pgControlVersion() and pgCatalogVersion()"))
|
||||
{
|
||||
TEST_ERROR(pgControlVersion(70300), AssertError, "invalid PostgreSQL version 70300");
|
||||
TEST_RESULT_UINT(pgControlVersion(PG_VERSION_83), 833, "8.3 control version");
|
||||
TEST_RESULT_UINT(pgControlVersion(PG_VERSION_11), 1100, "11 control version");
|
||||
|
||||
TEST_ERROR(pgCatalogVersion(70900), AssertError, "invalid PostgreSQL version 70900");
|
||||
TEST_RESULT_UINT(pgCatalogVersion(PG_VERSION_83), 200711281, "8.3 catalog version");
|
||||
TEST_RESULT_UINT(pgCatalogVersion(PG_VERSION_11), 201809051, "11 catalog version");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("pgControlFromBuffer() and pgControlFromFile()"))
|
||||
{
|
||||
@ -52,7 +64,7 @@ testRun(void)
|
||||
"unexpected control version = 501 and catalog version = 19780101\nHINT: is this version of PostgreSQL supported?");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ERROR(pgControlTestToBuffer((PgControl){.version = 0}), AssertError, "invalid version 0");
|
||||
TEST_ERROR(pgControlTestToBuffer((PgControl){.version = 0}), AssertError, "invalid PostgreSQL version 0");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
@ -62,8 +74,6 @@ testRun(void)
|
||||
PgControl info = {0};
|
||||
TEST_ASSIGN(info, pgControlFromFile(storageTest, strNew(testPath())), "get control info v11");
|
||||
TEST_RESULT_INT(info.systemId, 0xFACEFACE, " check system id");
|
||||
TEST_RESULT_INT(info.controlVersion, 1100, " check control version");
|
||||
TEST_RESULT_INT(info.catalogVersion, 201809051, " check catalog version");
|
||||
TEST_RESULT_INT(info.version, PG_VERSION_11, " check version");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@ -89,8 +99,6 @@ testRun(void)
|
||||
|
||||
TEST_ASSIGN(info, pgControlFromFile(storageTest, strNew(testPath())), "get control info v83");
|
||||
TEST_RESULT_INT(info.systemId, 0xEFEFEFEFEF, " check system id");
|
||||
TEST_RESULT_INT(info.controlVersion, 833, " check control version");
|
||||
TEST_RESULT_INT(info.catalogVersion, 200711281, " check catalog version");
|
||||
TEST_RESULT_INT(info.version, PG_VERSION_83, " check version");
|
||||
}
|
||||
|
||||
@ -126,7 +134,7 @@ testRun(void)
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
memset(bufPtr(result), 0, bufSize(result));
|
||||
TEST_ERROR(pgWalTestToBuffer((PgWal){.version = 0}, result), AssertError, "invalid version 0");
|
||||
TEST_ERROR(pgWalTestToBuffer((PgWal){.version = 0}, result), AssertError, "invalid PostgreSQL version 0");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
memset(bufPtr(result), 0, bufSize(result));
|
||||
|
Reference in New Issue
Block a user