mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-04-15 11:36:40 +02:00
Add pg-database option.
In some rare cases there is no postgres database so this option may be used to specify an alternate database.
This commit is contained in:
parent
1913ecee63
commit
b0ea337965
@ -298,6 +298,7 @@ use constant CFGOPT_PG_HOST_CONFIG_PATH => CFGOPT_PG
|
|||||||
use constant CFGOPT_PG_HOST_PORT => CFGOPT_PG_HOST . '-port';
|
use constant CFGOPT_PG_HOST_PORT => CFGOPT_PG_HOST . '-port';
|
||||||
use constant CFGOPT_PG_HOST_USER => CFGOPT_PG_HOST . '-user';
|
use constant CFGOPT_PG_HOST_USER => CFGOPT_PG_HOST . '-user';
|
||||||
|
|
||||||
|
use constant CFGOPT_PG_DATABASE => CFGDEF_PREFIX_PG . '-database';
|
||||||
use constant CFGOPT_PG_PATH => CFGDEF_PREFIX_PG . '-path';
|
use constant CFGOPT_PG_PATH => CFGDEF_PREFIX_PG . '-path';
|
||||||
use constant CFGOPT_PG_PORT => CFGDEF_PREFIX_PG . '-port';
|
use constant CFGOPT_PG_PORT => CFGDEF_PREFIX_PG . '-port';
|
||||||
use constant CFGOPT_PG_SOCKET_PATH => CFGDEF_PREFIX_PG . '-socket-path';
|
use constant CFGOPT_PG_SOCKET_PATH => CFGDEF_PREFIX_PG . '-socket-path';
|
||||||
@ -2736,6 +2737,16 @@ my %hConfigDefine =
|
|||||||
&CFGDEF_REQUIRED => false,
|
&CFGDEF_REQUIRED => false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
&CFGOPT_PG_DATABASE =>
|
||||||
|
{
|
||||||
|
&CFGDEF_GROUP => CFGOPTGRP_PG,
|
||||||
|
&CFGDEF_SECTION => CFGDEF_SECTION_STANZA,
|
||||||
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
||||||
|
&CFGDEF_DEFAULT => 'postgres',
|
||||||
|
&CFGDEF_COMMAND => CFGOPT_PG_PORT,
|
||||||
|
&CFGDEF_DEPEND => CFGOPT_PG_PORT,
|
||||||
|
},
|
||||||
|
|
||||||
&CFGOPT_PG_PATH =>
|
&CFGOPT_PG_PATH =>
|
||||||
{
|
{
|
||||||
&CFGDEF_GROUP => CFGOPTGRP_PG,
|
&CFGDEF_GROUP => CFGOPTGRP_PG,
|
||||||
|
@ -1062,6 +1062,17 @@
|
|||||||
<example>1</example>
|
<example>1</example>
|
||||||
</config-key>
|
</config-key>
|
||||||
|
|
||||||
|
<!-- ======================================================================================================= -->
|
||||||
|
<config-key id="pg-database" name="PostgreSQL Database">
|
||||||
|
<summary><postgres/> database.</summary>
|
||||||
|
|
||||||
|
<text>The database name used when connecting to <postgres/>. The default is usually best but some installations may not contain this database.
|
||||||
|
|
||||||
|
Note that for legacy reasons the setting of the <id>PGDATABASE</id> environment variable will be ignored.</text>
|
||||||
|
|
||||||
|
<example>backupdb</example>
|
||||||
|
</config-key>
|
||||||
|
|
||||||
<!-- CONFIG - STANZA SECTION - PG-PATH KEY -->
|
<!-- CONFIG - STANZA SECTION - PG-PATH KEY -->
|
||||||
<config-key id="pg-path" name="PostgreSQL Path">
|
<config-key id="pg-path" name="PostgreSQL Path">
|
||||||
<summary><postgres/> data directory.</summary>
|
<summary><postgres/> data directory.</summary>
|
||||||
|
@ -66,6 +66,14 @@
|
|||||||
|
|
||||||
<p>Add <br-option>repo-azure-endpoint</br-option> option.</p>
|
<p>Add <br-option>repo-azure-endpoint</br-option> option.</p>
|
||||||
</release-item>
|
</release-item>
|
||||||
|
|
||||||
|
<release-item>
|
||||||
|
<release-item-contributor-list>
|
||||||
|
<release-item-reviewer id="cynthia.shang"/>
|
||||||
|
</release-item-contributor-list>
|
||||||
|
|
||||||
|
<p>Add <br-option>pg-database</br-option> option.</p>
|
||||||
|
</release-item>
|
||||||
</release-feature-list>
|
</release-feature-list>
|
||||||
|
|
||||||
<release-improvement-list>
|
<release-improvement-list>
|
||||||
|
@ -656,6 +656,14 @@ static ConfigOptionData configOptionData[CFG_OPTION_TOTAL] = CONFIG_OPTION_LIST
|
|||||||
CONFIG_OPTION_NAME("pg")
|
CONFIG_OPTION_NAME("pg")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
CONFIG_OPTION
|
||||||
|
(
|
||||||
|
CONFIG_OPTION_NAME("pg-database")
|
||||||
|
CONFIG_OPTION_GROUP(true)
|
||||||
|
CONFIG_OPTION_GROUP_ID(cfgOptGrpPg)
|
||||||
|
)
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------------------------------------
|
||||||
CONFIG_OPTION
|
CONFIG_OPTION
|
||||||
(
|
(
|
||||||
|
@ -203,7 +203,7 @@ Option constants
|
|||||||
#define CFGOPT_TYPE "type"
|
#define CFGOPT_TYPE "type"
|
||||||
STRING_DECLARE(CFGOPT_TYPE_STR);
|
STRING_DECLARE(CFGOPT_TYPE_STR);
|
||||||
|
|
||||||
#define CFG_OPTION_TOTAL 125
|
#define CFG_OPTION_TOTAL 126
|
||||||
|
|
||||||
/***********************************************************************************************************************************
|
/***********************************************************************************************************************************
|
||||||
Command enum
|
Command enum
|
||||||
@ -291,6 +291,7 @@ typedef enum
|
|||||||
cfgOptOnline,
|
cfgOptOnline,
|
||||||
cfgOptOutput,
|
cfgOptOutput,
|
||||||
cfgOptPg,
|
cfgOptPg,
|
||||||
|
cfgOptPgDatabase,
|
||||||
cfgOptPgHost,
|
cfgOptPgHost,
|
||||||
cfgOptPgHostCmd,
|
cfgOptPgHostCmd,
|
||||||
cfgOptPgHostConfig,
|
cfgOptPgHostConfig,
|
||||||
|
@ -2276,6 +2276,44 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------------------------
|
||||||
|
CFGDEFDATA_OPTION
|
||||||
|
(
|
||||||
|
CFGDEFDATA_OPTION_NAME("pg-database")
|
||||||
|
CFGDEFDATA_OPTION_REQUIRED(true)
|
||||||
|
CFGDEFDATA_OPTION_SECTION(cfgDefSectionStanza)
|
||||||
|
CFGDEFDATA_OPTION_TYPE(cfgDefOptTypeString)
|
||||||
|
CFGDEFDATA_OPTION_INTERNAL(false)
|
||||||
|
|
||||||
|
CFGDEFDATA_OPTION_INDEX_TOTAL(8)
|
||||||
|
CFGDEFDATA_OPTION_SECURE(false)
|
||||||
|
|
||||||
|
CFGDEFDATA_OPTION_HELP_SECTION("stanza")
|
||||||
|
CFGDEFDATA_OPTION_HELP_SUMMARY("PostgreSQL database.")
|
||||||
|
CFGDEFDATA_OPTION_HELP_DESCRIPTION
|
||||||
|
(
|
||||||
|
"The database name used when connecting to PostgreSQL. The default is usually best but some installations may not "
|
||||||
|
"contain this database.\n"
|
||||||
|
"\n"
|
||||||
|
"Note that for legacy reasons the setting of the PGDATABASE environment variable will be ignored."
|
||||||
|
)
|
||||||
|
|
||||||
|
CFGDEFDATA_OPTION_COMMAND_LIST
|
||||||
|
(
|
||||||
|
CFGDEFDATA_OPTION_COMMAND(cfgCmdBackup)
|
||||||
|
CFGDEFDATA_OPTION_COMMAND(cfgCmdCheck)
|
||||||
|
CFGDEFDATA_OPTION_COMMAND(cfgCmdStanzaCreate)
|
||||||
|
CFGDEFDATA_OPTION_COMMAND(cfgCmdStanzaDelete)
|
||||||
|
CFGDEFDATA_OPTION_COMMAND(cfgCmdStanzaUpgrade)
|
||||||
|
)
|
||||||
|
|
||||||
|
CFGDEFDATA_OPTION_OPTIONAL_LIST
|
||||||
|
(
|
||||||
|
CFGDEFDATA_OPTION_OPTIONAL_DEPEND(cfgOptPgPath)
|
||||||
|
CFGDEFDATA_OPTION_OPTIONAL_DEFAULT("postgres")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------------------------------
|
||||||
CFGDEFDATA_OPTION
|
CFGDEFDATA_OPTION
|
||||||
(
|
(
|
||||||
|
@ -542,6 +542,81 @@ static const struct option optionList[] =
|
|||||||
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | cfgOptPg,
|
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | cfgOptPg,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// pg-database option
|
||||||
|
// -----------------------------------------------------------------------------------------------------------------------------
|
||||||
|
{
|
||||||
|
.name = "pg1-database",
|
||||||
|
.has_arg = required_argument,
|
||||||
|
.val = PARSE_OPTION_FLAG | (0 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "reset-pg1-database",
|
||||||
|
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | (0 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "pg2-database",
|
||||||
|
.has_arg = required_argument,
|
||||||
|
.val = PARSE_OPTION_FLAG | (1 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "reset-pg2-database",
|
||||||
|
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | (1 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "pg3-database",
|
||||||
|
.has_arg = required_argument,
|
||||||
|
.val = PARSE_OPTION_FLAG | (2 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "reset-pg3-database",
|
||||||
|
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | (2 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "pg4-database",
|
||||||
|
.has_arg = required_argument,
|
||||||
|
.val = PARSE_OPTION_FLAG | (3 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "reset-pg4-database",
|
||||||
|
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | (3 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "pg5-database",
|
||||||
|
.has_arg = required_argument,
|
||||||
|
.val = PARSE_OPTION_FLAG | (4 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "reset-pg5-database",
|
||||||
|
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | (4 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "pg6-database",
|
||||||
|
.has_arg = required_argument,
|
||||||
|
.val = PARSE_OPTION_FLAG | (5 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "reset-pg6-database",
|
||||||
|
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | (5 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "pg7-database",
|
||||||
|
.has_arg = required_argument,
|
||||||
|
.val = PARSE_OPTION_FLAG | (6 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "reset-pg7-database",
|
||||||
|
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | (6 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "pg8-database",
|
||||||
|
.has_arg = required_argument,
|
||||||
|
.val = PARSE_OPTION_FLAG | (7 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "reset-pg8-database",
|
||||||
|
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | (7 << PARSE_KEY_IDX_SHIFT) | cfgOptPgDatabase,
|
||||||
|
},
|
||||||
|
|
||||||
// pg-host option and deprecations
|
// pg-host option and deprecations
|
||||||
// -----------------------------------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
@ -2850,6 +2925,7 @@ static const ConfigOption optionResolveOrder[] =
|
|||||||
cfgOptArchiveCheck,
|
cfgOptArchiveCheck,
|
||||||
cfgOptArchiveCopy,
|
cfgOptArchiveCopy,
|
||||||
cfgOptForce,
|
cfgOptForce,
|
||||||
|
cfgOptPgDatabase,
|
||||||
cfgOptPgHost,
|
cfgOptPgHost,
|
||||||
cfgOptPgHostCmd,
|
cfgOptPgHostCmd,
|
||||||
cfgOptPgHostConfig,
|
cfgOptPgHostConfig,
|
||||||
|
@ -30,8 +30,9 @@ dbGetIdx(unsigned int pgIdx)
|
|||||||
{
|
{
|
||||||
result = dbNew(
|
result = dbNew(
|
||||||
pgClientNew(
|
pgClientNew(
|
||||||
cfgOptionIdxStrNull(cfgOptPgSocketPath, pgIdx), cfgOptionIdxUInt(cfgOptPgPort, pgIdx), PG_DB_POSTGRES_STR,
|
cfgOptionIdxStrNull(cfgOptPgSocketPath, pgIdx), cfgOptionIdxUInt(cfgOptPgPort, pgIdx),
|
||||||
cfgOptionIdxStrNull(cfgOptPgUser, pgIdx), (TimeMSec)(cfgOptionDbl(cfgOptDbTimeout) * MSEC_PER_SEC)),
|
cfgOptionIdxStr(cfgOptPgDatabase, pgIdx), cfgOptionIdxStrNull(cfgOptPgUser, pgIdx),
|
||||||
|
(TimeMSec)(cfgOptionDbl(cfgOptDbTimeout) * MSEC_PER_SEC)),
|
||||||
NULL, applicationName);
|
NULL, applicationName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -64,7 +64,7 @@ dbProtocol(const String *command, const VariantList *paramList, ProtocolServer *
|
|||||||
{
|
{
|
||||||
// Only a single db is passed to the remote
|
// Only a single db is passed to the remote
|
||||||
PgClient *pgClient = pgClientNew(
|
PgClient *pgClient = pgClientNew(
|
||||||
cfgOptionStrNull(cfgOptPgSocketPath), cfgOptionUInt(cfgOptPgPort), PG_DB_POSTGRES_STR,
|
cfgOptionStrNull(cfgOptPgSocketPath), cfgOptionUInt(cfgOptPgPort), cfgOptionStr(cfgOptPgDatabase),
|
||||||
cfgOptionStrNull(cfgOptPgUser), (TimeMSec)(cfgOptionDbl(cfgOptDbTimeout) * MSEC_PER_SEC));
|
cfgOptionStrNull(cfgOptPgUser), (TimeMSec)(cfgOptionDbl(cfgOptDbTimeout) * MSEC_PER_SEC));
|
||||||
pgClientOpen(pgClient);
|
pgClientOpen(pgClient);
|
||||||
|
|
||||||
|
@ -49,11 +49,6 @@ really old storage with 512-byte sectors. This is true across all versions of P
|
|||||||
#define PG_CONTROL_SIZE ((unsigned int)(8 * 1024))
|
#define PG_CONTROL_SIZE ((unsigned int)(8 * 1024))
|
||||||
#define PG_CONTROL_DATA_SIZE ((unsigned int)(512))
|
#define PG_CONTROL_DATA_SIZE ((unsigned int)(512))
|
||||||
|
|
||||||
/***********************************************************************************************************************************
|
|
||||||
Name of default PostgreSQL database used for running all queries and commands
|
|
||||||
***********************************************************************************************************************************/
|
|
||||||
STRING_EXTERN(PG_DB_POSTGRES_STR, PG_DB_POSTGRES);
|
|
||||||
|
|
||||||
/***********************************************************************************************************************************
|
/***********************************************************************************************************************************
|
||||||
PostgreSQL interface definitions
|
PostgreSQL interface definitions
|
||||||
|
|
||||||
|
@ -60,12 +60,6 @@ Defines for various Postgres paths and files
|
|||||||
#define PG_NAME_XLOG "xlog"
|
#define PG_NAME_XLOG "xlog"
|
||||||
STRING_DECLARE(PG_NAME_XLOG_STR);
|
STRING_DECLARE(PG_NAME_XLOG_STR);
|
||||||
|
|
||||||
/***********************************************************************************************************************************
|
|
||||||
Name of default PostgreSQL database used for running all queries and commands
|
|
||||||
***********************************************************************************************************************************/
|
|
||||||
#define PG_DB_POSTGRES "postgres"
|
|
||||||
STRING_DECLARE(PG_DB_POSTGRES_STR);
|
|
||||||
|
|
||||||
/***********************************************************************************************************************************
|
/***********************************************************************************************************************************
|
||||||
Define default page size
|
Define default page size
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ testRun(void)
|
|||||||
StringList *argList = strLstNew();
|
StringList *argList = strLstNew();
|
||||||
strLstAddZ(argList, "--stanza=test1");
|
strLstAddZ(argList, "--stanza=test1");
|
||||||
strLstAddZ(argList, "--pg1-path=/path/to/pg");
|
strLstAddZ(argList, "--pg1-path=/path/to/pg");
|
||||||
|
strLstAddZ(argList, "--pg1-database=testdb");
|
||||||
strLstAddZ(argList, "--" CFGOPT_REMOTE_TYPE "=" PROTOCOL_REMOTE_TYPE_PG);
|
strLstAddZ(argList, "--" CFGOPT_REMOTE_TYPE "=" PROTOCOL_REMOTE_TYPE_PG);
|
||||||
strLstAddZ(argList, "--process=0");
|
strLstAddZ(argList, "--process=0");
|
||||||
harnessCfgLoadRole(cfgCmdBackup, cfgCmdRoleRemote, argList);
|
harnessCfgLoadRole(cfgCmdBackup, cfgCmdRoleRemote, argList);
|
||||||
@ -79,13 +80,13 @@ testRun(void)
|
|||||||
// Set script
|
// Set script
|
||||||
harnessPqScriptSet((HarnessPq [])
|
harnessPqScriptSet((HarnessPq [])
|
||||||
{
|
{
|
||||||
HRNPQ_MACRO_OPEN(1, "dbname='postgres' port=5432"),
|
HRNPQ_MACRO_OPEN(1, "dbname='testdb' port=5432"),
|
||||||
HRNPQ_MACRO_SET_SEARCH_PATH(1),
|
HRNPQ_MACRO_SET_SEARCH_PATH(1),
|
||||||
HRNPQ_MACRO_SET_CLIENT_ENCODING(1),
|
HRNPQ_MACRO_SET_CLIENT_ENCODING(1),
|
||||||
HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_84, "/pgdata", NULL, NULL),
|
HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_84, "/pgdata", NULL, NULL),
|
||||||
HRNPQ_MACRO_CLOSE(1),
|
HRNPQ_MACRO_CLOSE(1),
|
||||||
|
|
||||||
HRNPQ_MACRO_OPEN(1, "dbname='postgres' port=5432"),
|
HRNPQ_MACRO_OPEN(1, "dbname='testdb' port=5432"),
|
||||||
HRNPQ_MACRO_SET_SEARCH_PATH(1),
|
HRNPQ_MACRO_SET_SEARCH_PATH(1),
|
||||||
HRNPQ_MACRO_SET_CLIENT_ENCODING(1),
|
HRNPQ_MACRO_SET_CLIENT_ENCODING(1),
|
||||||
HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_84, "/pgdata", NULL, NULL),
|
HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_84, "/pgdata", NULL, NULL),
|
||||||
@ -143,6 +144,7 @@ testRun(void)
|
|||||||
strLstAddZ(argList, "--stanza=test1");
|
strLstAddZ(argList, "--stanza=test1");
|
||||||
strLstAddZ(argList, "--repo1-retention-full=1");
|
strLstAddZ(argList, "--repo1-retention-full=1");
|
||||||
strLstAddZ(argList, "--pg1-path=/pg1");
|
strLstAddZ(argList, "--pg1-path=/pg1");
|
||||||
|
strLstAddZ(argList, "--pg1-database=backupdb");
|
||||||
harnessCfgLoad(cfgCmdBackup, argList);
|
harnessCfgLoad(cfgCmdBackup, argList);
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -151,7 +153,7 @@ testRun(void)
|
|||||||
harnessPqScriptSet((HarnessPq [])
|
harnessPqScriptSet((HarnessPq [])
|
||||||
{
|
{
|
||||||
// Connect to primary
|
// Connect to primary
|
||||||
HRNPQ_MACRO_OPEN(1, "dbname='postgres' port=5432"),
|
HRNPQ_MACRO_OPEN(1, "dbname='backupdb' port=5432"),
|
||||||
HRNPQ_MACRO_SET_SEARCH_PATH(1),
|
HRNPQ_MACRO_SET_SEARCH_PATH(1),
|
||||||
HRNPQ_MACRO_SET_CLIENT_ENCODING(1),
|
HRNPQ_MACRO_SET_CLIENT_ENCODING(1),
|
||||||
|
|
||||||
@ -199,7 +201,7 @@ testRun(void)
|
|||||||
harnessPqScriptSet((HarnessPq [])
|
harnessPqScriptSet((HarnessPq [])
|
||||||
{
|
{
|
||||||
// Connect to primary
|
// Connect to primary
|
||||||
HRNPQ_MACRO_OPEN_LE_91(1, "dbname='postgres' port=5432", PG_VERSION_83, "/pg1", NULL, NULL),
|
HRNPQ_MACRO_OPEN_LE_91(1, "dbname='backupdb' port=5432", PG_VERSION_83, "/pg1", NULL, NULL),
|
||||||
|
|
||||||
// Get advisory lock
|
// Get advisory lock
|
||||||
HRNPQ_MACRO_ADVISORY_LOCK(1, true),
|
HRNPQ_MACRO_ADVISORY_LOCK(1, true),
|
||||||
@ -226,7 +228,7 @@ testRun(void)
|
|||||||
harnessPqScriptSet((HarnessPq [])
|
harnessPqScriptSet((HarnessPq [])
|
||||||
{
|
{
|
||||||
// Connect to primary
|
// Connect to primary
|
||||||
HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_95, "/pg1", false, NULL, NULL),
|
HRNPQ_MACRO_OPEN_GE_92(1, "dbname='backupdb' port=5432", PG_VERSION_95, "/pg1", false, NULL, NULL),
|
||||||
|
|
||||||
// Get start time
|
// Get start time
|
||||||
HRNPQ_MACRO_TIME_QUERY(1, 1000),
|
HRNPQ_MACRO_TIME_QUERY(1, 1000),
|
||||||
@ -282,7 +284,7 @@ testRun(void)
|
|||||||
harnessPqScriptSet((HarnessPq [])
|
harnessPqScriptSet((HarnessPq [])
|
||||||
{
|
{
|
||||||
// Connect to primary
|
// Connect to primary
|
||||||
HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_95, "/pg1", false, NULL, NULL),
|
HRNPQ_MACRO_OPEN_GE_92(1, "dbname='backupdb' port=5432", PG_VERSION_95, "/pg1", false, NULL, NULL),
|
||||||
|
|
||||||
// Start backup when backup is in progress
|
// Start backup when backup is in progress
|
||||||
HRNPQ_MACRO_ADVISORY_LOCK(1, true),
|
HRNPQ_MACRO_ADVISORY_LOCK(1, true),
|
||||||
@ -321,7 +323,7 @@ testRun(void)
|
|||||||
harnessPqScriptSet((HarnessPq [])
|
harnessPqScriptSet((HarnessPq [])
|
||||||
{
|
{
|
||||||
// Connect to primary
|
// Connect to primary
|
||||||
HRNPQ_MACRO_OPEN_GE_96(1, "dbname='postgres' port=5432", PG_VERSION_96, "/pg1", false, NULL, NULL),
|
HRNPQ_MACRO_OPEN_GE_96(1, "dbname='backupdb' port=5432", PG_VERSION_96, "/pg1", false, NULL, NULL),
|
||||||
|
|
||||||
// Start backup
|
// Start backup
|
||||||
HRNPQ_MACRO_ADVISORY_LOCK(1, true),
|
HRNPQ_MACRO_ADVISORY_LOCK(1, true),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user