1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-27 00:21:08 +02:00

Add function to generate PostgreSQL tablespace identifier.

In PostgreSQL >= 9.0 each tablespace data is stored in a specially named directory so different major versions can share the same tablespace path.
This commit is contained in:
David Steele
2019-09-08 06:53:23 -04:00
parent 051128ed9e
commit d957acb36b
3 changed files with 35 additions and 1 deletions

View File

@ -103,8 +103,13 @@ testRun(void)
}
// *****************************************************************************************************************************
if (testBegin("pgWalName()"))
if (testBegin("pgTablespaceId() and pgWalName()"))
{
TEST_RESULT_STR_Z(pgTablespaceId(PG_VERSION_84), NULL, "check 8.4 tablespace id");
TEST_RESULT_STR_Z(pgTablespaceId(PG_VERSION_90), "PG_9.0_201008051", "check 9.0 tablespace id");
TEST_RESULT_STR_Z(pgTablespaceId(PG_VERSION_94), "PG_9.4_201409291", "check 9.4 tablespace id");
TEST_RESULT_STR_Z(pgTablespaceId(PG_VERSION_11), "PG_11_201809051", "check 11 tablespace id");
TEST_RESULT_STR(strPtr(pgWalName(PG_VERSION_96)), "xlog", "check xlog name");
TEST_RESULT_STR(strPtr(pgWalName(PG_VERSION_10)), "wal", "check wal name");
}