Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1fa25ce

Browse files
committed
Skip pg_baseback long filename test if path too long on Windows
On Windows, it's sometimes difficult to create a file with a path longerthan 255 chars, and if it can be created it might not be seen by thearchiver. This can be triggered by the test for tar backups withfilenames greater than 100 bytes. So we skip that test if the path wouldexceed 255.Backpatch to all live branches.Reviewed by Daniel GustafssonDiscussion:https://postgr.es/m/666ac55b-3400-fb2c-2cea-0281bf36a53c@dunslane.net
1 parent3142a88 commit1fa25ce

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

‎src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -310,21 +310,23 @@
310310
[@pg_basebackup_defs,'-D',"$tempdir/backup_foo",'-Fp',"-Tfoo" ],
311311
'-T with invalid format fails');
312312

313-
# Tar format doesn't support filenames longer than 100 bytes.
314-
# Create the test file via a short name directory so it doesn't blow the
315-
# Windows path limit.
316-
my$lftmp = PostgreSQL::Test::Utils::tempdir_short;
317-
dir_symlink"$pgdata","$lftmp/pgdata";
318313
my$superlongname ="superlongname_" . ("x"x100);
319-
my$superlongpath ="$lftmp/pgdata/$superlongname";
314+
# Tar format doesn't support filenames longer than 100 bytes.
315+
SKIP:
316+
{
317+
my$superlongpath ="$pgdata/$superlongname";
320318

321-
openmy$file,'>',"$superlongpath"
322-
ordie"unable to create file$superlongpath";
323-
close$file;
324-
$node->command_fails(
325-
[@pg_basebackup_defs,'-D',"$tempdir/tarbackup_l1",'-Ft' ],
326-
'pg_basebackup tar with long name fails');
327-
unlink"$superlongpath";
319+
skip"File path too long", 1
320+
if$windows_os &&length($superlongpath) > 255;
321+
322+
openmy$file,'>',"$superlongpath"
323+
ordie"unable to create file$superlongpath";
324+
close$file;
325+
$node->command_fails(
326+
[@pg_basebackup_defs,'-D',"$tempdir/tarbackup_l1",'-Ft' ],
327+
'pg_basebackup tar with long name fails');
328+
unlink"$superlongpath";
329+
}
328330

329331
# The following tests are for symlinks.
330332

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp