From owner-freebsd-ports@FreeBSD.ORG Sat Sep 29 10:34:21 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 657E71065673; Sat, 29 Sep 2012 10:34:21 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from melon.pingpong.net (melon.pingpong.net [79.136.116.200]) by mx1.freebsd.org (Postfix) with ESMTP id EEB888FC1C; Sat, 29 Sep 2012 10:34:20 +0000 (UTC) Received: from girgBook.local (c-f2cee055.1521-1-64736c12.cust.bredbandsbolaget.se [85.224.206.242]) by melon.pingpong.net (Postfix) with ESMTPA id 7E46B236CB; Sat, 29 Sep 2012 12:34:12 +0200 (CEST) Message-ID: <5066CEA3.1000803@FreeBSD.org> Date: Sat, 29 Sep 2012 12:34:11 +0200 From: Palle Girgensohn User-Agent: Postbox 3.0.5 (Macintosh/20120826) MIME-Version: 1.0 To: Chris Rees References: <4C985BA2.5060906@rsu.ru> <3000A63E-F860-45B1-B2C4-EAC7F0BF9BA3@Chaos1.DE> In-Reply-To: X-Enigmail-Version: 1.2.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Axel Rau , freebsd-ports@freebsd.org, Alexander Pyhalov , pgsql@freebsd.org Subject: Re: Question about postgresql 9 and pg_upgrade X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2012 10:34:21 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chris Rees skrev: > > On 29 Sep 2012 09:49, "Axel Rau" > 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-----