|
49 | 49 | 'tar format');
|
50 | 50 | ok(-f "$tempdir/tarbackup/base.tar", 'backup tar was created');
|
51 | 51 |
|
| 52 | +# Create a temporary directory in the system location and symlink it |
| 53 | +# to our physical temp location. That way we can use shorter names |
| 54 | +# for the tablespace directories, which hopefully won't run afoul of |
| 55 | +# the 99 character length limit. |
| 56 | +my $shorter_tempdir = tempdir_short . "/tempdir"; |
| 57 | +symlink "$tempdir", $shorter_tempdir; |
| 58 | + |
52 | 59 | mkdir "$tempdir/tblspc1";
|
53 |
| -psql 'postgres', "CREATE TABLESPACE tblspc1 LOCATION '$tempdir/tblspc1';"; |
| 60 | +psql 'postgres', "CREATE TABLESPACE tblspc1 LOCATION '$shorter_tempdir/tblspc1';"; |
54 | 61 | psql 'postgres', "CREATE TABLE test1 (a int) TABLESPACE tblspc1;";
|
55 | 62 | command_ok([ 'pg_basebackup', '-D', "$tempdir/tarbackup2", '-Ft' ],
|
56 | 63 | 'tar format with tablespaces');
|
|
65 | 72 | command_ok(
|
66 | 73 | [ 'pg_basebackup', '-D',
|
67 | 74 | "$tempdir/backup1", '-Fp',
|
68 |
| - "-T$tempdir/tblspc1=$tempdir/tbackup/tblspc1" ], |
| 75 | + "-T$shorter_tempdir/tblspc1=$tempdir/tbackup/tblspc1" ], |
69 | 76 | 'plain format with tablespaces succeeds with tablespace mapping');
|
70 | 77 | ok(-d "$tempdir/tbackup/tblspc1", 'tablespace was relocated');
|
71 | 78 | opendir(my $dh, "$tempdir/pgdata/pg_tblspc") or die;
|
|
81 | 88 | mkdir "$tempdir/tbl=spc2";
|
82 | 89 | psql 'postgres', "DROP TABLE test1;";
|
83 | 90 | psql 'postgres', "DROP TABLESPACE tblspc1;";
|
84 |
| -psql 'postgres', "CREATE TABLESPACE tblspc2 LOCATION '$tempdir/tbl=spc2';"; |
| 91 | +psql 'postgres', "CREATE TABLESPACE tblspc2 LOCATION '$shorter_tempdir/tbl=spc2';"; |
85 | 92 | command_ok(
|
86 | 93 | [ 'pg_basebackup', '-D',
|
87 | 94 | "$tempdir/backup3", '-Fp',
|
88 |
| - "-T$tempdir/tbl\\=spc2=$tempdir/tbackup/tbl\\=spc2" ], |
| 95 | + "-T$shorter_tempdir/tbl\\=spc2=$tempdir/tbackup/tbl\\=spc2" ], |
89 | 96 | 'mapping tablespace with = sign in path');
|
90 | 97 | ok(-d "$tempdir/tbackup/tbl=spc2", 'tablespace with = sign was relocated');
|
91 | 98 |
|
|
0 commit comments