1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-01 00:25:06 +02:00

Add pgWalPath() to return version-specific WAL path.

Also update the manifest module to use the new function.
This commit is contained in:
David Steele
2019-12-12 16:11:09 -05:00
parent 94cb9540f1
commit 676be2c773
4 changed files with 23 additions and 2 deletions

View File

@ -30,6 +30,10 @@ STRING_EXTERN(PG_PATH_GLOBAL_STR, PG_PATH_GLOB
STRING_EXTERN(PG_NAME_WAL_STR, PG_NAME_WAL);
STRING_EXTERN(PG_NAME_XLOG_STR, PG_NAME_XLOG);
// Wal path names depending on version
STRING_STATIC(PG_PATH_PGWAL_STR, "pg_wal");
STRING_STATIC(PG_PATH_PGXLOG_STR, "pg_xlog");
// Transaction commit log path names depending on version
STRING_STATIC(PG_PATH_PGCLOG_STR, "pg_clog");
STRING_STATIC(PG_PATH_PGXACT_STR, "pg_xact");
@ -642,6 +646,17 @@ pgWalName(unsigned int pgVersion)
FUNCTION_TEST_RETURN(pgVersion >= PG_VERSION_WAL_RENAME ? PG_NAME_WAL_STR : PG_NAME_XLOG_STR);
}
/**********************************************************************************************************************************/
const String *
pgWalPath(unsigned int pgVersion)
{
FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(UINT, pgVersion);
FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(pgVersion >= PG_VERSION_WAL_RENAME ? PG_PATH_PGWAL_STR : PG_PATH_PGXLOG_STR);
}
/**********************************************************************************************************************************/
const String *
pgXactPath(unsigned int pgVersion)

View File

@ -137,6 +137,9 @@ const String *pgLsnName(unsigned int pgVersion);
const String *pgWalName(unsigned int pgVersion);
// Get wal path (this was changed in PostgreSQL 10 to avoid including "log" in the name)
const String *pgWalPath(unsigned int pgVersion);
// Get transaction commit log path (this was changed in PostgreSQL 10 to avoid including "log" in the name)
const String *pgXactPath(unsigned int pgVersion);