New pg_upgrade data directory inside old one?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: New pg_upgrade data directory inside old one?
Date: 2016-02-15 17:29:26
Message-ID: 20160215172926.GA31273@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Someone on IRC reported that if they had run the pg_upgrade-created
delete_old_cluster.sh shell script it would have deleted their old _and_
new data directories. (Fortunately they didn't run it.)

I was confused how this could have happened, and the user explained that
their old cluster was in /u/pgsql/data, and that they wanted to switch to
a per-major-version directory naming schema, so they put the new data
directory in /u/pgsql/data/9.5. (They could have just moved the
directory while the server was down, but didn't.)

Unfortunately, there is no check for having the new cluster data
directory inside the old data directory, only a check for tablespace
directories in the old cluster. (I never anticipated someone would do
this.)

The attached patch adds the proper check. This should be backpatched to
all supported Postgres versions.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Roman grave inscription +

Attachment Content-Type Size
pg_upgrade.diff text/x-diff 2.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Filip Rembiałkowski 2016-02-15 17:31:58 Re: proposal: make NOTIFY list de-duplication optional
Previous Message Petr Jelinek 2016-02-15 17:23:01 Re: WIP: Failover Slots