From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Luca Ferrari <fluca1978@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: pg_upgrade as a way of cloning an instance?
Date: Wed, 7 Jul 2021 10:22:05 +0200
Message-ID: <8ba0ee71-063d-112b-66dc-2971456f8a8a@enterprisedb.com> (raw)
In-Reply-To: <CAKoxK+7GD7_y2q9+DBMRa6H4WuWmKvUYo5S5Y=paG-rcf+EjgQ@mail.gmail.com>
References: <CAKoxK+7GD7_y2q9+DBMRa6H4WuWmKvUYo5S5Y=paG-rcf+EjgQ@mail.gmail.com>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: peter.eisentraut@enterprisedb.com, fluca1978@gmail.com
Subject: Re: pg_upgrade as a way of cloning an instance?
In-Reply-To: <8ba0ee71-063d-112b-66dc-2971456f8a8a@enterprisedb.com>
References: <CAKoxK+7GD7_y2q9+DBMRa6H4WuWmKvUYo5S5Y=paG-rcf+EjgQ@mail.gmail.com> <8ba0ee71-063d-112b-66dc-2971456f8a8a@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox