1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-16 23:47:38 +02:00

Refactor PostgreSQL interface to remove most code duplication.

Having a copy per version worked well until it was time to add new features or modify existing functions.  Then it was necessary to modify every version and try to keep them all in sync.

Consolidate all the PostgreSQL types into a single file using #if for type versions.  Many types do not change or change infrequently so this cuts down on duplication.  In addition, it is far easier to see what has changed when a new version is added.

Use macros to write the interface functions.  There is still duplication here since some changes require a new copy of the macro, but it is far less than before.
This commit is contained in:
David Steele
2019-03-21 21:11:36 +04:00
parent e938a89250
commit 7cf7373761
42 changed files with 2359 additions and 4911 deletions

View File

@ -33,6 +33,11 @@ testRun(void)
// *****************************************************************************************************************************
if (testBegin("pgControlFromBuffer() and pgControlFromFile()"))
{
// Sanity test to ensure PG_VERSION_MAX has been updated
//--------------------------------------------------------------------------------------------------------------------------
TEST_RESULT_UINT(pgInterface[0].version, PG_VERSION_MAX, "check max version");
//--------------------------------------------------------------------------------------------------------------------------
String *controlFile = strNew(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL);
// Create a bogus control file