Re: pg_basebackup check vs Windows file path limits

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup check vs Windows file path limits
Date: 2023-11-12 14:09:27
Message-ID: b623500d-4a48-d0d6-cdea-3c6c2b83ffdf@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2023-11-11 Sa 12:00, Alexander Lakhin wrote:
> 11.11.2023 18:18, Andrew Dunstan wrote:
>>
>> Hmm, maybe we should be using File::Copy::move() instead of rename().
>> The docco for that says:
>>
>>         If possible, move() will simply rename the file. Otherwise, it
>>         copies the file to the new location and deletes the original. If an
>>         error occurs during this copy-and-delete process, you may be left
>>         with a (possibly partial) copy of the file under the destination
>>         name.
>
> Unfortunately, I've stumbled upon inability of File::Copy::move()
> to move directories across filesystems, exactly as described here:
> https://stackoverflow.com/questions/17628039/filecopy-move-directories-accross-drives-in-windows-not-working
>
> (I'm sorry for not looking above rename() where this stated explicitly:
> # On Windows use the short location to avoid path length issues.
> # Elsewhere use $tempdir to avoid file system boundary issues with moving.
> So this issue affects Windows only.)
>
>

*sigh*

A probable workaround is to use a temp directory on the same device the
test is building on. Just set it up and set your environment TEMPDIR to
point to it, and I think it will be OK (i.e. I havent tested it).

But that doesn't mean I'm not searching for a better solution. Maybe
Alvaro's suggestion nearby will help.

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2023-11-12 16:41:15 Re: building with meson on windows with ssl
Previous Message Anton Kirilov 2023-11-12 13:37:16 Re: Add PQsendSyncMessage() to libpq