You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-18 23:57:33 +02:00
Remove redundant documentation from PostgreSQL interface files and clarify ambiguous function names.
Move the documentation to postgres/interface.c so it can be updated without having to update N source files. The "is" function was not very specific so rename to "controlIs".
This commit is contained in:
@ -45,21 +45,35 @@ really old storage with 512-byte sectors. This is true across all versions of P
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL interface definitions
|
||||
|
||||
Each supported version of PostgreSQL must have interface files named postgres/interface/vXXX.c/h that implement the functions
|
||||
specified in the interface structure below. The functions are documented here rather than in the interface files so that a change
|
||||
in wording does not need to be propagated through N source files.
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct PgInterface
|
||||
{
|
||||
// Version of PostgreSQL supported by this interface
|
||||
unsigned int version;
|
||||
|
||||
// Does pg_control match this version of PostgreSQL?
|
||||
bool (*controlIs)(const Buffer *);
|
||||
|
||||
// Convert pg_control to a common data structure
|
||||
PgControl (*control)(const Buffer *);
|
||||
bool (*is)(const Buffer *);
|
||||
|
||||
#ifdef DEBUG
|
||||
// Create pg_control for testing
|
||||
void (*controlTest)(PgControl, Buffer *);
|
||||
#endif
|
||||
} PgInterface;
|
||||
|
||||
static const PgInterface pgInterface[] =
|
||||
{
|
||||
{
|
||||
.version = PG_VERSION_11,
|
||||
|
||||
.controlIs = pgInterfaceControlIs110,
|
||||
.control = pgInterfaceControl110,
|
||||
.is = pgInterfaceIs110,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest110,
|
||||
@ -67,8 +81,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_10,
|
||||
|
||||
.controlIs = pgInterfaceControlIs100,
|
||||
.control = pgInterfaceControl100,
|
||||
.is = pgInterfaceIs100,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest100,
|
||||
@ -76,8 +91,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_96,
|
||||
|
||||
.controlIs = pgInterfaceControlIs096,
|
||||
.control = pgInterfaceControl096,
|
||||
.is = pgInterfaceIs096,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest096,
|
||||
@ -85,8 +101,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_95,
|
||||
|
||||
.controlIs = pgInterfaceControlIs095,
|
||||
.control = pgInterfaceControl095,
|
||||
.is = pgInterfaceIs095,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest095,
|
||||
@ -94,8 +111,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_94,
|
||||
|
||||
.controlIs = pgInterfaceControlIs094,
|
||||
.control = pgInterfaceControl094,
|
||||
.is = pgInterfaceIs094,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest094,
|
||||
@ -103,8 +121,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_93,
|
||||
|
||||
.controlIs = pgInterfaceControlIs093,
|
||||
.control = pgInterfaceControl093,
|
||||
.is = pgInterfaceIs093,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest093,
|
||||
@ -112,8 +131,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_92,
|
||||
|
||||
.controlIs = pgInterfaceControlIs092,
|
||||
.control = pgInterfaceControl092,
|
||||
.is = pgInterfaceIs092,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest092,
|
||||
@ -121,8 +141,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_91,
|
||||
|
||||
.controlIs = pgInterfaceControlIs091,
|
||||
.control = pgInterfaceControl091,
|
||||
.is = pgInterfaceIs091,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest091,
|
||||
@ -130,8 +151,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_90,
|
||||
|
||||
.controlIs = pgInterfaceControlIs090,
|
||||
.control = pgInterfaceControl090,
|
||||
.is = pgInterfaceIs090,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest090,
|
||||
@ -139,8 +161,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_84,
|
||||
|
||||
.controlIs = pgInterfaceControlIs084,
|
||||
.control = pgInterfaceControl084,
|
||||
.is = pgInterfaceIs084,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest084,
|
||||
@ -148,8 +171,9 @@ static const PgInterface pgInterface[] =
|
||||
},
|
||||
{
|
||||
.version = PG_VERSION_83,
|
||||
|
||||
.controlIs = pgInterfaceControlIs083,
|
||||
.control = pgInterfaceControl083,
|
||||
.is = pgInterfaceIs083,
|
||||
|
||||
#ifdef DEBUG
|
||||
.controlTest = pgInterfaceControlTest083,
|
||||
@ -185,7 +209,7 @@ pgControlFromBuffer(const Buffer *controlFile)
|
||||
|
||||
for (unsigned int interfaceIdx = 0; interfaceIdx < sizeof(pgInterface) / sizeof(PgInterface); interfaceIdx++)
|
||||
{
|
||||
if (pgInterface[interfaceIdx].is(controlFile))
|
||||
if (pgInterface[interfaceIdx].controlIs(controlFile))
|
||||
{
|
||||
interface = &pgInterface[interfaceIdx];
|
||||
break;
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 8.3 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v083.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v083.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs083(const Buffer *controlFile)
|
||||
pgInterfaceControlIs083(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs083(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl083(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl083(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs083(controlFile));
|
||||
ASSERT(pgInterfaceControlIs083(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -54,11 +49,9 @@ pgInterfaceControl083(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest083(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 8.3 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs083(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs083(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl083(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 8.4 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v084.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v084.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs084(const Buffer *controlFile)
|
||||
pgInterfaceControlIs084(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs084(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl084(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl084(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs084(controlFile));
|
||||
ASSERT(pgInterfaceControlIs084(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -54,11 +49,9 @@ pgInterfaceControl084(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest084(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 8.4 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs084(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs084(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl084(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 9.0 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v090.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v090.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs090(const Buffer *controlFile)
|
||||
pgInterfaceControlIs090(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs090(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl090(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl090(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs090(controlFile));
|
||||
ASSERT(pgInterfaceControlIs090(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -54,11 +49,9 @@ pgInterfaceControl090(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest090(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 9.0 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs090(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs090(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl090(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 9.1 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v091.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v091.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs091(const Buffer *controlFile)
|
||||
pgInterfaceControlIs091(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs091(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl091(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl091(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs091(controlFile));
|
||||
ASSERT(pgInterfaceControlIs091(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -54,11 +49,9 @@ pgInterfaceControl091(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest091(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 9.1 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs091(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs091(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl091(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 9.2 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v092.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v092.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs092(const Buffer *controlFile)
|
||||
pgInterfaceControlIs092(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs092(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl092(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl092(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs092(controlFile));
|
||||
ASSERT(pgInterfaceControlIs092(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -54,11 +49,9 @@ pgInterfaceControl092(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest092(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 9.2 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs092(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs092(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl092(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 9.3 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v093.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v093.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs093(const Buffer *controlFile)
|
||||
pgInterfaceControlIs093(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs093(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl093(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl093(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs093(controlFile));
|
||||
ASSERT(pgInterfaceControlIs093(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -56,11 +51,9 @@ pgInterfaceControl093(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest093(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 9.3 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs093(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs093(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl093(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 9.4 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v094.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v094.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs094(const Buffer *controlFile)
|
||||
pgInterfaceControlIs094(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs094(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl094(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl094(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs094(controlFile));
|
||||
ASSERT(pgInterfaceControlIs094(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -56,11 +51,9 @@ pgInterfaceControl094(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest094(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 9.4 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs094(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs094(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl094(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 9.5 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v095.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v095.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs095(const Buffer *controlFile)
|
||||
pgInterfaceControlIs095(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs095(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl095(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl095(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs095(controlFile));
|
||||
ASSERT(pgInterfaceControlIs095(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -56,11 +51,9 @@ pgInterfaceControl095(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest095(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 9.5 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs095(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs095(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl095(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 9.6 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v096.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v096.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs096(const Buffer *controlFile)
|
||||
pgInterfaceControlIs096(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs096(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl096(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl096(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs096(controlFile));
|
||||
ASSERT(pgInterfaceControlIs096(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -56,11 +51,9 @@ pgInterfaceControl096(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest096(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 9.6 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs096(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs096(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl096(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 10 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v100.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v100.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs100(const Buffer *controlFile)
|
||||
pgInterfaceControlIs100(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs100(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl100(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl100(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs100(controlFile));
|
||||
ASSERT(pgInterfaceControlIs100(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -56,11 +51,9 @@ pgInterfaceControl100(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest100(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 10 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs100(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs100(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl100(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 11 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v110.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v110.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs110(const Buffer *controlFile)
|
||||
pgInterfaceControlIs110(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs110(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl110(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl110(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs110(controlFile));
|
||||
ASSERT(pgInterfaceControlIs110(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -56,11 +51,9 @@ pgInterfaceControl110(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest110(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ PostgreSQL 11 Interface
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
bool pgInterfaceIs110(const Buffer *controlFile);
|
||||
bool pgInterfaceControlIs110(const Buffer *controlFile);
|
||||
PgControl pgInterfaceControl110(const Buffer *controlFile);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
Reference in New Issue
Block a user