You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-29 00:21:56 +02:00
Rename db-* options to pg-* and backup-* options to repo-* to improve consistency.
* repo-* options are now indexed although only one is allowed. * List deprecated option names in documentation and command-line help.
This commit is contained in:
@ -32,31 +32,31 @@ sub run
|
||||
################################################################################################################################
|
||||
if ($self->begin("${strModule}::walPath()"))
|
||||
{
|
||||
my $strDbPath = '/db';
|
||||
my $strPgPath = '/db';
|
||||
my $strWalFileRelative = 'pg_wal/000000010000000100000001';
|
||||
my $strWalFileAbsolute = "${strDbPath}/${strWalFileRelative}";
|
||||
my $strWalFileAbsolute = "${strPgPath}/${strWalFileRelative}";
|
||||
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
$self->testException(
|
||||
sub {walPath($strWalFileRelative, undef, cfgCommandName(CFGCMD_ARCHIVE_GET))}, ERROR_OPTION_REQUIRED,
|
||||
"option 'db-path' must be specified when relative wal paths are used\n" .
|
||||
"option 'pg1-path' must be specified when relative wal paths are used\n" .
|
||||
"HINT: Is \%f passed to " . cfgCommandName(CFGCMD_ARCHIVE_GET) . " instead of \%p?\n" .
|
||||
"HINT: PostgreSQL may pass relative paths even with \%p depending on the environment.");
|
||||
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
$self->testResult(
|
||||
sub {walPath($strWalFileRelative, $strDbPath, cfgCommandName(CFGCMD_ARCHIVE_PUSH))}, $strWalFileAbsolute,
|
||||
sub {walPath($strWalFileRelative, $strPgPath, cfgCommandName(CFGCMD_ARCHIVE_PUSH))}, $strWalFileAbsolute,
|
||||
'relative path is contructed');
|
||||
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
$self->testResult(
|
||||
sub {walPath($strWalFileAbsolute, $strDbPath, cfgCommandName(CFGCMD_ARCHIVE_PUSH))}, $strWalFileAbsolute,
|
||||
'path is not relative and db-path is still specified');
|
||||
sub {walPath($strWalFileAbsolute, $strPgPath, cfgCommandName(CFGCMD_ARCHIVE_PUSH))}, $strWalFileAbsolute,
|
||||
'path is not relative and pg-path is still specified');
|
||||
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
$self->testResult(
|
||||
sub {walPath($strWalFileAbsolute, $strDbPath, cfgCommandName(CFGCMD_ARCHIVE_PUSH))}, $strWalFileAbsolute,
|
||||
'path is not relative and db-path is undef');
|
||||
sub {walPath($strWalFileAbsolute, $strPgPath, cfgCommandName(CFGCMD_ARCHIVE_PUSH))}, $strWalFileAbsolute,
|
||||
'path is not relative and pg-path is undef');
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
|
Reference in New Issue
Block a user