Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m12oy-0004rm-3N for pgsql-general@arkaria.postgresql.org; Wed, 07 Jul 2021 08:22:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m12ox-0004cH-2D for pgsql-general@arkaria.postgresql.org; Wed, 07 Jul 2021 08:22:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m12ow-0004az-1l for pgsql-general@lists.postgresql.org; Wed, 07 Jul 2021 08:22:14 +0000 Received: from forward1-smtp.messagingengine.com ([66.111.4.223]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m12os-0000fs-Ek for pgsql-general@lists.postgresql.org; Wed, 07 Jul 2021 08:22:12 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailforward.nyi.internal (Postfix) with ESMTP id 4933A1940498; Wed, 7 Jul 2021 04:22:09 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 07 Jul 2021 04:22:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=oKg1mx532BAEv2BZI+V9F4NVh3G77mohMwj3I2dpz Cg=; b=ClejHutGfoVlzHcDhbZAHr1un9TxKUa37LUbKo70z4T649GWvPo/D77eZ D6qtQ/tfkR4yqlQlgb8xh/GxMVnF7mt2i2QuhoP0vJ+u/s558lAjSaXUJZ5GYCOx qjFMjD73UtUpXVoyiQgdFPZpK+ceqVwmXJ/KoxcuoxfawhmYvgmAMTwnAXHdNEdf 1Lu1j7/Q+4GDplGo2chQKQWPvxyQgZU70EWtRKKXeptARPzyrOESF4IGtLlWoVdV aGmF4CHctwN5Eid2EChe9XXcalYG0ULnbfLATlqfRwacuTmYpRiLGsP3eOKHpIvu zjlH4p0ya7KTpc9s6vWGCsn+d+b0g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrtddvgddtvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeelveehheeuieduieetiedt keeuteelfeetjeffieffudegvdffvdfftdeivdeukeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Jul 2021 04:22:07 -0400 (EDT) Subject: Re: pg_upgrade as a way of cloning an instance? To: Luca Ferrari , pgsql-general References: From: Peter Eisentraut Message-ID: <8ba0ee71-063d-112b-66dc-2971456f8a8a@enterprisedb.com> Date: Wed, 7 Jul 2021 10:22:05 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 07.07.21 08:53, Luca Ferrari wrote: > Hi all, > someone pointed me out that pg_upgrade can be used to do a clone of > the database, specifying the same binaries such as > > pg_upgrade -B /usr/pgsql-13/bin -b /usr/pgsql-13/bin -D /data/clone -d /data/src > > I tested it and it seems to work, even if I don't see any point in > running it (and most notably it requires a downtime on the original > cluster). > Any opinion about that? Yeah, seems pretty pointless. You can just copy the data directory directly and get the same effect. pg_upgrade basically does a data directory copy plus some extra stuff to convert the system catalogs between versions, and if you don't need that second part, you might as well do the first part directly.