Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1rMX-00E232-RA for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Nov 2023 17:01:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r1rMV-007rXa-Ch for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Nov 2023 17:01:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1rMV-007rXR-0z for pgsql-hackers@lists.postgresql.org; Sat, 11 Nov 2023 17:01:35 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r1rMS-005vQ8-3d for pgsql-hackers@postgresql.org; Sat, 11 Nov 2023 17:01:34 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-507adc3381cso4010646e87.3 for ; Sat, 11 Nov 2023 09:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699722090; x=1700326890; darn=postgresql.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=SkHEKKPfJLtySgXTcs79mb3kWrqKDQasNifaLnd16T8=; b=YFeHuzRouAsATSXghr58x9WuHuRHXJQ2Zh8hSyoCOU5IXafAVTTyA1DmgDLqsyLIp0 Xa0JiTY5/hTXkMDCIvlLVZfulcY0Gqf/7Hy8FaQ2jzNGILxMvGEIgp+mNGEWLDl2l/GJ PkOf1tfAwC3mSGKGWBhrCOvLYBmD2WkKm+uLvM+37eIgwzMOtYD8xAQ6yWoMn+hcGGJ/ zWgPt/5Ue56EVZ2Ji9Xys83i0vIDS3/oAG1YTm44bLPiPH69YBR+8NZbI4xp8gy0JH2L 2uMtPlR6Ggr+q+GU7x9y6aDPVksmTZPPTNY5899VoUpTVFNv61HY67G2rA/5OP6M1nPA Xgug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699722090; x=1700326890; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=SkHEKKPfJLtySgXTcs79mb3kWrqKDQasNifaLnd16T8=; b=TRdKtSXvUjL1q+55ZBT205ro/iG+RoVcoQA0t998CzgLBIjuaDzrViqnKPHKufs7Bz xOMcOeuwmH/JIPmTy1e5z/vCoU2rV16K0v1jTbQDUx6U4yXN/4nT8dsYB7kKa+ruZ835 zZpV7k93FQ0OShRU3t9NVEDZY6JVcyxYXg0MjW+JpRpvEK7PxXolZkwyCtfIRJChl7XJ 3s/JZ58ws8bYubXm3hL93DAXqQpTQzBlci3B7kyVUF5zrL21HwDRVEh1Sy4mlNFRVfl7 /WeqiAvZtIfF9222O3j2/3LAzl/+7FLib2reM5E7LGu//P2t3FkaUA9ISCNvoTcIQYFL GX8w== X-Gm-Message-State: AOJu0Yz2eZYpOsTpebocMB9nvRw6bSDS5AIUJ4NiWiTpzTjAp18jbZhY ROuSPbE3ZBUTuBGdPaP09Jfmci4kZjkzug== X-Google-Smtp-Source: AGHT+IGrKXzk8WK1L9dmlQi8scdtswJzTvzmkC6mbJ/UqFLo7AAiEa1u410nw/jdy7x59Q2GpKBa/w== X-Received: by 2002:a05:6512:48b:b0:503:2623:7cfa with SMTP id v11-20020a056512048b00b0050326237cfamr1395359lfq.35.1699722089402; Sat, 11 Nov 2023 09:01:29 -0800 (PST) Received: from [1.0.0.7] ([178.155.25.100]) by smtp.gmail.com with ESMTPSA id d23-20020ac25457000000b0050a7052409fsm328392lfn.121.2023.11.11.09.01.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Nov 2023 09:01:28 -0800 (PST) Content-Type: multipart/alternative; boundary="------------20qQHc7fRXzyZQxt49RgfyEy" Message-ID: <6aa7c5a0-a4c8-dd2c-3a99-946eb7f23155@gmail.com> Date: Sat, 11 Nov 2023 20:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: pg_basebackup check vs Windows file path limits Content-Language: en-US To: Andrew Dunstan , Daniel Gustafsson Cc: PostgreSQL Hackers References: <666ac55b-3400-fb2c-2cea-0281bf36a53c@dunslane.net> <76f33a1f-ddce-80a6-6f39-fefa0668f4a6@dunslane.net> <3AC47E65-02A0-42BF-8A3E-B38FD09FE702@yesql.se> <94341cbe-9491-60e9-f01a-7ed770295cfa@dunslane.net> <81023744-772d-889b-99b8-bd1d58bd761b@dunslane.net> <67093EFC-3800-48B0-9E20-82A37A5F2A7B@yesql.se> <0c1c289c-f55a-1cc3-4ce1-44d7e8353e70@dunslane.net> <3B1D0F8A-DB97-462A-937F-73B3FCFE2713@yesql.se> <8e3130c2-5c51-5cd5-9f0d-b0cd938bcd6b@dunslane.net> <13663265-cac2-ec5d-d378-0dd44a895f8e@gmail.com> <9293e623-1d5e-0bd3-9b61-6129821b6f42@dunslane.net> From: Alexander Lakhin In-Reply-To: <9293e623-1d5e-0bd3-9b61-6129821b6f42@dunslane.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------20qQHc7fRXzyZQxt49RgfyEy Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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.) Best regards, Alexander --------------20qQHc7fRXzyZQxt49RgfyEy Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
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.)

Best regards,
Alexander
--------------20qQHc7fRXzyZQxt49RgfyEy--