Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Sep 2012 12:34:11 +0200
From:      Palle Girgensohn <girgen@FreeBSD.org>
To:        Chris Rees <utisoft@gmail.com>
Cc:        Axel Rau <Axel.Rau@chaos1.de>, freebsd-ports@freebsd.org, Alexander Pyhalov <alp@rsu.ru>, pgsql@freebsd.org
Subject:   Re: Question about postgresql 9 and pg_upgrade
Message-ID:  <5066CEA3.1000803@FreeBSD.org>
In-Reply-To: <CADLo83_t_=CaV_8UBUAK1WNoV3dDo8SH=BAhSMjAGELvxCjXAg@mail.gmail.com>
References:  <4C985BA2.5060906@rsu.ru> <3000A63E-F860-45B1-B2C4-EAC7F0BF9BA3@Chaos1.DE> <CADLo83_t_=CaV_8UBUAK1WNoV3dDo8SH=BAhSMjAGELvxCjXAg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris Rees skrev:
> 
> On 29 Sep 2012 09:49, "Axel Rau" <Axel.Rau@chaos1.de 
> <mailto:Axel.Rau@chaos1.de>> wrote:
>> 
>> 
>> Am 21.09.2010 um 09:15 schrieb Alexander Pyhalov:
>> 
>>> All latest PostgreSQL ports has conflicts with  earlier
>>> versions.
> May this be corrected in some way (for example, modify CONFLICTS 
> variable and  install each new PostgreSQL version in its own
> directory, e.g. ${LOCALBASE}/postgresql/XX/, where XX is 90 , 91 and
> so on). This will allow us to use pg_upgrade to upgrade databases (it
> needs binary files from both new and old postgresql version).
>>> 
>>> How do you advise to solve this problem? Should we compile
> postgresql from sources and avoid using databases/postgresql*-server
> ports?
>> Did anybody find a good solution for this? I'm just planning
>> upgrade from 9.1.x to 9.2.x.
> 
> Sorry for the delay in replying (major delay!)
> 
> We (pgsql@) are dreamily considering ways to mitigate this problem,
> by perhaps versioning the data directories, but the sad fact is that
> its going to be pretty difficult to do without migration by most
> people on upgrades.
> 
> Added to the fact that databases are almost always mission-critical, 
> we're reluctant to mess about until something's properly tested.
> 
> Sorry to say, but the only current upgrade path is stop database,
> dump, upgrade, restore, restart.
> 
> Minimum downtime is;
> 
> # cd /usr/ports/databases/postgresql92-server
> 
> # make
> 
> # service postgresql stop
> 
> (dump database)
> 
> # pkg_delete -fx postgresql-server
> 
> # make install clean
> 
> (Restore database)
> 
> # service postgresql start
> 
> I hope we'll have a solution soon.
> 
> Chris
> 

You should be able to install into a chrooted/jailed environment as per

1. install new version to a chroot/jail

2. stop postgres

3. use pgupgrade and use chrooted installation as the new binary
installation

4. upgrade the "real" postgresql to the new major version

5. start postgres

This is a bit of a hassle with the chroot stuff, but it should work in
theory.

Or perhaps you could just take a package of the new postgresql version
and untar is somewhere. For pg_upgrade, all you need is both binaries
available at the same time on you hard disk. You could build the package
somewhere else.

Sadly though, the wet dream if installing different versions side by
side has the draw back that it hard to come up with a scheme that won't
require current setups to migrate at upgrade, as Chris points out.

Palle
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQZs6jAAoJEIhV+7FrxBJDZcsIAMutNBgGxbHDT0O4iD34FtPY
W2fALEAWMpAYrsS8XoCaVtQXU/VdrQ9OR1ZayQMiR3vdPPokmMVQ+D/N6rdaf8ld
cMOz0P4YffGEamZaWk+EDZo1k1HNzjbjRtCLMJbF2S+pV+v6a6WPcRQ/2284HfTW
QIRcDxgoc9dVmF47tciORyeHF8YKhA2svo/xNI9yAlwDoM8V5wBBXjsN3PtR5nku
B8C89Rne+4m7wn4iJ7oWQp7pb74PcwOna9PUAjZTU9c25q56kNSfSXMgbFzu9vZ0
AMR+YH+5YcxsJufNHMNXHqyeailSPr/Kvq+81D/MAqTvnF6R8GyS0VyY2nfHmWY=
=/xGt
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5066CEA3.1000803>