From owner-freebsd-ports@freebsd.org Tue Jul 21 11:52:49 2015 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19F8D9A6748 for ; Tue, 21 Jul 2015 11:52:49 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id F329313DB for ; Tue, 21 Jul 2015 11:52:48 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: by mailman.ysv.freebsd.org (Postfix) id F11559A6746; Tue, 21 Jul 2015 11:52:48 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6E649A6743 for ; Tue, 21 Jul 2015 11:52:48 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD4713DA; Tue, 21 Jul 2015 11:52:47 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from ppp14-2-93-217.lns21.adl6.internode.on.net (HELO leader.local) ([14.2.93.217]) by ipmail07.adl2.internode.on.net with ESMTP; 21 Jul 2015 21:22:46 +0930 Message-ID: <55AE327F.8040300@ShaneWare.Biz> Date: Tue, 21 Jul 2015 21:22:31 +0930 From: Shane Ambler User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Baptiste Daroussin , pgsql@FreeBSD.org, ports@FreeBSD.org Subject: Re: Proposal to fix postgresql package maintainance nightmare References: <20150721094627.GD21594@ivaldir.etoilebsd.net> In-Reply-To: <20150721094627.GD21594@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 11:52:49 -0000 On 21/07/2015 19:16, Baptiste Daroussin wrote: > Hi, > > We do manage a bunch of postgresql servers on FreeBSD, and I really find the > current model of packages postgresql is a nightmare on FreeBSD. > > Let's first start with the current issues. > - Impossible to have tools from both old and new version at the same time (which > is necessary to upgrade db and prepare upgrades of db) > - Impossible to chose the version we want to run in production without having to > rebuild the packages and the whole ports tree with a specific default. > - Nightmare each time a new default version is set in the ports tree. Sounds like a good plan, I am not a heavy postgresql user but I have set the default pg version in make.conf to prevent unexpected new versions going in during port updates when I didn't think of doing upgrade steps. > Here is my proposal to fix that. > > Having one single postgresql-client package always on the latest stable version > (backward compability being very good) providing the client cli tools and the > libraries (those libraries will be used for everything in the ports tree > needing to talk to postgresql) > > Have one full postgresql package per supported version upstream self installing > itself into let's say: /usr/local/postgresql94 and symlinks all the client tools > to /usr/local/bin suffixed by the version psql94 pg_bla94 etc. Don't want to start a debate but thought I would mention as food for thought -- I'm not sure of any strong need to have more than one pg client version available. The newer client can connect to any older server and I don't know of any issues when an old client connects to a newer server. > That way everything talk to pgsql will only depend on one postgresql-client > packages that will smoothly be upgraded to newer versions. > > All database administrators will have the ability to chose the production > version they do want without having to worry about a default version. > > They can install multiple version in parallel and deal with upgrade the way they > want having access to both versions of the tools of the same time. > > Any opinion on that change? Any idea one how to make the upgrade path as > transparent as possible for current setup? (beside of course adding an UPDATING > entry) I think allowing multiple pg server versions is a good idea, this can prevent old binary versions being removed before the data update process. A new upgrade command could be added so we can do `service postgresql upgrade` which tests for existing paths, defines old and new dirs and runs pg_upgrade. The rc script could either add a version postfix to the data dir path or test PG_VERSION content to decide if data gets moved to data-old so new versions being started won't see older version data. Lack of up to date data dirs can lead to "You need to perform an upgrade first." Different disk usage (filecount?) for old and new data dir can lead to "Have you upgraded your old data?" I don't think an upgrade step could be added during a port build, it would have to be at server start in the rc script. I wouldn't add an automatic upgrade step unless it was enabled by the user. -- FreeBSD - the place to B...Serving Data Shane Ambler