Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j9xTp-0000Pm-Jd for pgsql-general@arkaria.postgresql.org; Thu, 05 Mar 2020 20:52:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9xTo-0004l9-FE for pgsql-general@arkaria.postgresql.org; Thu, 05 Mar 2020 20:52:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j9xTn-0004k4-SE for pgsql-general@lists.postgresql.org; Thu, 05 Mar 2020 20:52:28 +0000 Received: from campbell-lange.net ([178.79.140.51]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j9xTl-0002g9-A0 for pgsql-general@postgresql.org; Thu, 05 Mar 2020 20:52:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=campbell-lange.net; s=it; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vMsWkMtkzV1vsAn9YbV7JrXYifMXXi6rAC6tlXyPvE8=; b=MjO+7v3PfgzvPfhx2fhD2SQCW dRc0fPmQfvog9+c35dclLeSxf1IymSN4CWP9CEXNI9ApvzWRBRLjVlHykqwrJ41iMJFW1gJlOwLq5 SrhwLk9n2kildxEbRRzQfJWswuK+/hhnARBD9DFZAYg9DqSrs8IduLwUUWrXcYTLfZee0=; Received: from 186.164.198.146.dyn.plus.net ([146.198.164.186] helo=rory-t450s) by campbell-lange.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j9xTj-0007s1-RN for pgsql-general@postgresql.org; Thu, 05 Mar 2020 20:52:23 +0000 Received: from rory by rory-t450s with local (Exim 4.92) (envelope-from ) id 1j9xTy-0000G7-OK for pgsql-general@postgresql.org; Thu, 05 Mar 2020 20:52:38 +0000 Date: Thu, 5 Mar 2020 20:52:38 +0000 From: Rory Campbell-Lange To: pgsql-general@postgresql.org Subject: Re: Advice request : simultaneous function/data updates on many databases Message-ID: <20200305205238.GC554@campbell-lange.net> References: <20200304220426.GB7232@campbell-lange.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200304220426.GB7232@campbell-lange.net> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/03/20, Rory Campbell-Lange (rory@campbell-lange.net) wrote: > We have many databases of the same type separated for data governance > reasons. They, however, share the same web front-end code. > > Presently, replacing functions and performing data updates on the > databases in series often executes across all databases in less than a > minute. (The updates are currently done with simple sql files connecting > to each database and then loading a stub file pointing to each function > to drop and reload, and running the data update queries.) > > However, for larger updates, the time when the front end code is > out-of-step with the database can cause end-user problems. For information, following the very helpful advice here, we intend to proceed as follows, using a rolling upgrade methodology: for each database: * upgrade the functions and sql * on success, callout haproxy to switch the client from web code version old to new * else investigate the upgrade failure We're planning to use postgres for recording state.