From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: eric.meygret@free.fr
Subject: BUG #17333: pgdg postgresql-common pg_upgradecluster duplicate data_directory in configuration file
Date: Fri, 10 Dec 2021 16:41:18 +0000
Message-ID: <17333-a00bcda4fab7c6d4@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17333
Logged by: Eric Meygret
Email address: eric.meygret@free.fr
PostgreSQL version: 14.1
Operating system: Ubuntu 20.04
Description:
Hello,
first I want to say that this bug could delete all data, and second sorry
for my bad English.
I tried to upgrade a database from 9.6 to 14(but I think it is the same for
any migrations).
in /etc/postgresql/9.6/main/postgresql.conf I have to times data_directory
first default value:
data_directory = '/var/lib/postgresql/9.6/main'
and at the end of file
data_directory = '/postgresql/9.6/main/'
postgresql ignore first value.
when I launch upgrade with
pg_upgradecluster -v 14 --method=link --link 9.6 main /postgresql/14/main/
upgrade copy /etc/postgresql/9.6/main/postgresql.conf to
/etc/postgresql/14/main/postgresql.conf
and replace first occurrence so I have :
data_directory = '/postgresql/14/main/'
and at then end of the configuration file :
data_directory = '/postgresql/9.6/main/'
the upgrade failed and start a pg_dropcluster 14 main and this one use the
last occurrence so delete /postgresql/9.6/main/
and now all data are lost. (thanks to backup before upgrade :) )
hope that my explanation is correct and understandable.
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, eric.meygret@free.fr
Subject: Re: BUG #17333: pgdg postgresql-common pg_upgradecluster duplicate data_directory in configuration file
In-Reply-To: <17333-a00bcda4fab7c6d4@postgresql.org>
* 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