Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7WZN-00040s-Hm for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Oct 2018 02:07:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g7WZK-0005N5-Gh for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Oct 2018 02:07:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7WZK-0005Mw-9T for pgsql-hackers@lists.postgresql.org; Wed, 03 Oct 2018 02:07:18 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g7WZC-0008Tw-JR for pgsql-hackers@postgresql.org; Wed, 03 Oct 2018 02:07:17 +0000 Received: by mail-qt1-x841.google.com with SMTP id z8-v6so4298047qto.9 for ; Tue, 02 Oct 2018 19:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=NEQVAzXkSM7wnoj+Iqrh6L6vfwJydgI8KKFvHNsqiNM=; b=TpfWxW5RheBCyQFMCSHPsvPhz0iQPaJrnGlkS0Uqs0a1v7XYO2CTQ3XEHu3UHJAVqH cAIMhj19akGlbavjVsZtM4LAR488MRt5wWN+UettjJqlY87ckKnrgkW4MnaEB6nuecr8 eThVk4Zby3/RZGWtB/tuqcmMOgI7lA7lNwMrLLALlNJ8mNme/n/YYatvmgByFSAYVC6v uc2sD4xpKjqBcLdnIYWwZp/A2kpFc0Sm6s5SCu28OYrcLFzALvAm/fy+4vb18Nr5PBNx ockY3UOGrzXN4lhTsY1/zEiZPc0g+9RAuRiz31rVigXifqhU5ZT02HsMs8baukjpY5AX 93Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=NEQVAzXkSM7wnoj+Iqrh6L6vfwJydgI8KKFvHNsqiNM=; b=UtqatV6dSV6OzYhGML0900hzUKo7NjfYC4Jja8CMosiyGHHw4GOIcpLYi+Luol7+ok pnrmNPQtOkgXnPXoSBd1EEPaKYLMGlLRiYxsAUx3lJ9ldEEVK//bB5uE3YMnBtqhFtWL JjjM2VgGkf43F9E4eemoa9AOFrLVBFfu6JoxvKzoeWJKHAeyRkCrtTe9sYReVGDATCbv n7a/vZaB2FocmxYTJZh9URMwZg2y+eWlQC1Y62zh449gmk9ZxMe/pLRVUIQjIewHihOl E7jPDSBHX1AnCTvUJJcMEOmkyVN4zveISYmY1DqYyeOPfQBu/cUPd+tI1wQBaRGsb8bo LXAw== X-Gm-Message-State: ABuFfoi659trIcGjPZfVMLNgvUpP972VNyY1kFASAgp+tzTgWXbxNKO5 1EbjYP3yQdYPk9QObUuxSgxjdg== X-Google-Smtp-Source: ACcGV61GMVHbU+bt02XMFwDkNBjLHSEGy4DEpP4TBg0k53EhzRtoUDAxdKJrf8/NhWmrLnCiIM7jkw== X-Received: by 2002:a05:6214:1091:: with SMTP id o17mr10687637qvr.97.1538532428482; Tue, 02 Oct 2018 19:07:08 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([179.56.48.211]) by smtp.gmail.com with ESMTPSA id u13-v6sm3135806qtu.90.2018.10.02.19.07.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Oct 2018 19:07:07 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 41447469; Tue, 2 Oct 2018 23:07:06 -0300 (-03) Date: Tue, 2 Oct 2018 23:07:06 -0300 From: Alvaro Herrera To: Michael Paquier Cc: Peter Eisentraut , pgsql-hackers , Bruce Momjian Subject: Re: file cloning in pg_upgrade and CREATE DATABASE Message-ID: <20181003020706.hykmk4vmy6brovoj@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181003014409.GC2609@paquier.xyz> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Oct-03, Michael Paquier wrote: > On Tue, Oct 02, 2018 at 10:35:02PM -0300, Alvaro Herrera wrote: > > I'm not clear what interface are you proposing. Maybe they would just > > use the clone-or-fail mode, and note whether it fails? If that's not > > it, please explain. > > Okay. What I am proposing is to not have any kind of automatic mode to > keep the code simple, with a new option called --transfer-mode, able to > do three things: > - "link", which is the equivalent of the existing --link. > - "copy", the default and the current behavior, which copies files. > - "clone", the new mode proposed in this thread. I see. Peter is proposing to have a fourth mode, essentially --transfer-mode=clone-or-copy. Thinking about a generic tool that wraps pg_upgrade (say, Debian's wrapper for it) this makes sense: just use the fastest non-destructive mode available. Which ones are available depends on what the underlying filesystem is, so it's not up to the tool's writer to decide which to use ahead of time. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services