1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-07 00:35:37 +02:00

Remove dependency on pg_database.datlastsysoid.

This column has been removed in PostgreSQL 15. Rather than add a lot of special handling, it seems better just to update all versions to not depend on this column.

Add centralized functions to identify the type of database (i.e. system or user) by name and use FirstNormalObjectId when a name is not available.

The new query in the db module will still return the prior result for PostgreSQL <= 15, which will be stored in the manifest. This is important to preserve behavior when downgrading pgBackRest. There are no concerns here for PostgreSQL 15 since older versions of pgBackRest won't be able to restore backups for PostgreSQL 15 anyway.
This commit is contained in:
David Steele
2022-05-04 08:22:45 -04:00
committed by GitHub
parent 302e0c0921
commit 692fe496bd
14 changed files with 159 additions and 46 deletions

View File

@ -740,10 +740,10 @@ testRun(void)
#define TEST_MANIFEST_DB \
"\n" \
"[db]\n" \
"mail={\"db-id\":16456,\"db-last-system-id\":12168}\n" \
"postgres={\"db-id\":12173,\"db-last-system-id\":12168}\n" \
"template0={\"db-id\":12168,\"db-last-system-id\":12168}\n" \
"template1={\"db-id\":1,\"db-last-system-id\":12168}\n" \
"mail={\"db-id\":16456,\"db-last-system-id\":99999}\n" \
"postgres={\"db-id\":12173,\"db-last-system-id\":99999}\n" \
"template0={\"db-id\":12168,\"db-last-system-id\":99999}\n" \
"template1={\"db-id\":1,\"db-last-system-id\":99999}\n" \
#define TEST_MANIFEST_FILE \
"\n" \
@ -1765,8 +1765,8 @@ testRun(void)
#define TEST_MANIFEST_NO_DB \
"\n" \
"[db]\n" \
"template0={\"db-id\":12168,\"db-last-system-id\":12168}\n" \
"template1={\"db-id\":1,\"db-last-system-id\":12168}\n" \
"template0={\"db-id\":12168,\"db-last-system-id\":99999}\n" \
"template1={\"db-id\":1,\"db-last-system-id\":99999}\n" \
#define TEST_MANIFEST_FILE_NO_CHECKSUM_ERROR \
"\n" \