|
112 | 112 | symlink"$tempdir",$shorter_tempdir; |
113 | 113 |
|
114 | 114 | mkdir"$tempdir/tblspc1"; |
115 | | -$node->psql('postgres', |
| 115 | +$node->safe_psql('postgres', |
116 | 116 | "CREATE TABLESPACE tblspc1 LOCATION '$shorter_tempdir/tblspc1';"); |
117 | | -$node->psql('postgres',"CREATE TABLE test1 (a int) TABLESPACE tblspc1;"); |
| 117 | +$node->safe_psql('postgres',"CREATE TABLE test1 (a int) TABLESPACE tblspc1;"); |
118 | 118 | $node->command_ok(['pg_basebackup','-D',"$tempdir/tarbackup2",'-Ft' ], |
119 | 119 | 'tar format with tablespaces'); |
120 | 120 | ok(-f"$tempdir/tarbackup2/base.tar",'backup tar was created'); |
|
140 | 140 | closedir$dh; |
141 | 141 |
|
142 | 142 | mkdir"$tempdir/tbl=spc2"; |
143 | | -$node->psql('postgres',"DROP TABLE test1;"); |
144 | | -$node->psql('postgres',"DROP TABLESPACE tblspc1;"); |
145 | | -$node->psql('postgres', |
| 143 | +$node->safe_psql('postgres',"DROP TABLE test1;"); |
| 144 | +$node->safe_psql('postgres',"DROP TABLESPACE tblspc1;"); |
| 145 | +$node->safe_psql('postgres', |
146 | 146 | "CREATE TABLESPACE tblspc2 LOCATION '$shorter_tempdir/tbl=spc2';"); |
147 | 147 | $node->command_ok( |
148 | 148 | ['pg_basebackup','-D',"$tempdir/backup3",'-Fp', |
149 | 149 | "-T$shorter_tempdir/tbl\\=spc2=$tempdir/tbackup/tbl\\=spc2" ], |
150 | 150 | 'mapping tablespace with = sign in path'); |
151 | 151 | ok(-d"$tempdir/tbackup/tbl=spc2", |
152 | 152 | 'tablespace with = sign was relocated'); |
153 | | -$node->psql('postgres',"DROP TABLESPACE tblspc2;"); |
| 153 | +$node->safe_psql('postgres',"DROP TABLESPACE tblspc2;"); |
154 | 154 |
|
155 | 155 | mkdir"$tempdir/$superlongname"; |
156 | | -$node->psql('postgres', |
| 156 | +$node->safe_psql('postgres', |
157 | 157 | "CREATE TABLESPACE tblspc3 LOCATION '$tempdir/$superlongname';"); |
158 | 158 | $node->command_ok( |
159 | 159 | ['pg_basebackup','-D',"$tempdir/tarbackup_l3",'-Ft' ], |
160 | 160 | 'pg_basebackup tar with long symlink target'); |
161 | | -$node->psql('postgres',"DROP TABLESPACE tblspc3;"); |
| 161 | +$node->safe_psql('postgres',"DROP TABLESPACE tblspc3;"); |
162 | 162 | } |
163 | 163 |
|
164 | 164 | $node->command_ok(['pg_basebackup','-D',"$tempdir/backupR",'-R' ], |
|
199 | 199 | 'slot1' ], |
200 | 200 | 'pg_basebackup fails with nonexistent replication slot'); |
201 | 201 |
|
202 | | -$node->psql('postgres', |
| 202 | +$node->safe_psql('postgres', |
203 | 203 | q{SELECT * FROM pg_create_physical_replication_slot('slot1')}); |
204 | | -my$lsn =$node->psql('postgres', |
| 204 | +my$lsn =$node->safe_psql('postgres', |
205 | 205 | q{SELECT restart_lsn FROM pg_replication_slots WHERE slot_name = 'slot1'} |
206 | 206 | ); |
207 | 207 | is($lsn,'','restart LSN of new slot is null'); |
208 | 208 | $node->command_ok( |
209 | 209 | ['pg_basebackup','-D',"$tempdir/backupxs_sl",'-X', |
210 | 210 | 'stream','-S','slot1' ], |
211 | 211 | 'pg_basebackup -X stream with replication slot runs'); |
212 | | -$lsn =$node->psql('postgres', |
| 212 | +$lsn =$node->safe_psql('postgres', |
213 | 213 | q{SELECT restart_lsn FROM pg_replication_slots WHERE slot_name = 'slot1'} |
214 | 214 | ); |
215 | 215 | like($lsn,qr!^0/[0-9A-Z]{7,8}$!,'restart LSN of slot has advanced'); |
|