Re: pg_upgrade as a way of cloning an instance?

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Luca Ferrari <fluca1978(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_upgrade as a way of cloning an instance?
Date: 2021-07-07 08:22:05
Message-ID: 8ba0ee71-063d-112b-66dc-2971456f8a8a@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Luca Ferrari 2021-07-07 08:30:15 Re: pg_upgrade as a way of cloning an instance?
Previous Message Luca Ferrari 2021-07-07 06:53:06 pg_upgrade as a way of cloning an instance?