Re: pg_upgrade as a way of cloning an instance? - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: pg_upgrade as a way of cloning an instance?
Date
Msg-id 8ba0ee71-063d-112b-66dc-2971456f8a8a@enterprisedb.com
Whole thread Raw
In response to pg_upgrade as a way of cloning an instance?  (Luca Ferrari <fluca1978@gmail.com>)
Responses Re: pg_upgrade as a way of cloning an instance?  (Luca Ferrari <fluca1978@gmail.com>)
List 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.



pgsql-general by date:

Previous
From: Luca Ferrari
Date:
Subject: pg_upgrade as a way of cloning an instance?
Next
From: Luca Ferrari
Date:
Subject: Re: pg_upgrade as a way of cloning an instance?