Re: Problem with pg_upgrade - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: Problem with pg_upgrade
Date
Msg-id 20120706033700.GB15538@momjian.us
Whole thread Raw
In response to Re: Problem with pg_upgrade  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Thu, Jul 05, 2012 at 06:28:31PM -0400, Tom Lane wrote:
> Payal Singh <payals1@umbc.edu> writes:
> > On Thu, Jul 5, 2012 at 12:15 PM, Craig Ringer <ringerc@ringerc.id.au> wrote:
> >> If you start 9.1 on a copy of the backup then cleanly stop it again, does
> >> pg_upgrade then run?
>
> > Thank you. That worked.
>
> ISTM that pg_upgrade should check that the old cluster was shut down
> cleanly, ie pg_control has state = "shut down".  AFAICT from some
> testing, it currently only checks that there is no postmaster.pid file,
> which is easily bypassed by users who might not realize that it's not
> safe to run pg_upgrade against a filesystem backup.

I am confused.  pg_upgrade certainly starts/stops the old and new server
with pg_ctl before copying any files --- isn't that sufficent?

> BTW, I also noticed while trying to test this that pg_upgrade is
> currently completely broken for the case of taking PGDATAOLD or
> PGDATANEW from the environment rather than switches.  This is because
> the existing coding in option.c fails to set up the "pgconfig" fields
> in such cases.

Oh, good catch.  Fixed with the attached patch, and backpatched to 9.2.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Attachment

pgsql-bugs by date:

Previous
From: Craig Ringer
Date:
Subject: Re: BUG #6720: Its often disconnecting
Next
From: Craig Ringer
Date:
Subject: Re: BUG #6720: Its often disconnecting