From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Allan Webber Subject: Re: postgres 9.6.2 update breakage Date: Sun, 14 May 2017 14:47:24 -0500 Message-ID: <87h90n8blf.fsf@dustycloud.org> References: <87mvag7sj0.fsf@gnu.org> <87mvagaayq.fsf@gnu.org> <874lwoa1bs.fsf@dustycloud.org> <87lgq09zq7.fsf@gnu.org> <877f1j90ii.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9zUL-0004dh-Dp for guix-devel@gnu.org; Sun, 14 May 2017 15:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9zUG-0004QT-Ho for guix-devel@gnu.org; Sun, 14 May 2017 15:47:33 -0400 In-reply-to: <877f1j90ii.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Jan Nieuwenhuizen Cc: guix-devel@gnu.org, Pg Hackers Jan Nieuwenhuizen writes: > Roel Janssen writes: > >> So, it would be something like: >> postgres pg_upgrade \ >> ... > > It's great to have a recipe `that works', so thanks! > > However, whether or not we automate this, I cannot help to wonder if > we should support downgrading -- at least to the previous version > in this case? > > If I'm not mistaken, everything else in GuixSD will run if I select a > previous system generation in Grub...except for this? > > Is involving postgres developers an option, I'm sure a least one of > the postgresql hackers[cc] are already looking at Guix[SD]? > > Greetings, > janneke There's a big difference in upgrading and downgrading between guix revisions and doing so in highly stateful databases, unfortunately. I can't speak for postgres specifically, but here's my experience with migrations as the tech lead of MediaGoblin: - upgrades should be taken with extreme caution, and you should back up first. - downgrades should be taken with ten times the amount of caution of upgrades, a vat of coffee to work through the problems, and a barrel of whiskey for when it doesn't. I say that as someone who's mostly given up coffee and doesn't drink alcohol. State changes are bad enough when unidirectional. Django, for instance, provides an API that does both upgrades and downgrades. Almost everybody spends a bunch of time carefully crafting their upgrades, and just leaves their downgrades as the stubs that come with it. These are stubs that drop columns entirely, possibly columns that data was moved to in the migration. Reverse course, and suddenly you don't have a lot of data you used to. What we really want to do is provide the option to snapshot things *before* you do an upgrade, IMO...