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 1j9coe-0002HV-Lg for pgsql-general@arkaria.postgresql.org; Wed, 04 Mar 2020 22:48:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9coc-0005b6-SV for pgsql-general@arkaria.postgresql.org; Wed, 04 Mar 2020 22:48:34 +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 1j9coc-0005ag-AH for pgsql-general@lists.postgresql.org; Wed, 04 Mar 2020 22:48:34 +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 1j9coZ-0000TJ-TJ for pgsql-general@postgresql.org; Wed, 04 Mar 2020 22:48:33 +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:Cc:To:From:Date:Sender:Reply-To: 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=NETVY9fjStizIluBkDXX9OWofRztTusZcIw+ytVQXmM=; b=fRwKmAqCxcmVmia3hdE7yMvm5 3xfoYoRKUzgI1bld5Pl7za4KfTqipzQiPleUNG3LPnRdmEzJkMnjHjjVv1hutIpJldmLLYfgb2RZF QSD06+PujEM0OST//jxKTDgp4icrUZb1opM0HO2mXfMIppYKQ5I9GWDOePRkMAUMTUMpo=; 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 1j9coX-0004j3-Cc; Wed, 04 Mar 2020 22:48:29 +0000 Received: from rory by rory-t450s with local (Exim 4.92) (envelope-from ) id 1j9col-0003F4-7w; Wed, 04 Mar 2020 22:48:43 +0000 Date: Wed, 4 Mar 2020 22:48:43 +0000 From: Rory Campbell-Lange To: Guyren Howe Cc: Adrian Klaver , PG-General Mailing List Subject: Re: Advice request : simultaneous function/data updates on many databases Message-ID: <20200304224843.GA12333@campbell-lange.net> References: <20200304220426.GB7232@campbell-lange.net> <7ce9074f-0468-1cc8-3337-018b66e56679@aklaver.com> <20200304222257.GA11376@campbell-lange.net> <42b4d82b-d468-3f9e-c021-c20bcc141245@aklaver.com> <20200304223342.GA11628@campbell-lange.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Guyren Howe (guyren@gmail.com) wrote: > On Mar 4, 2020, at 14:33 , Rory Campbell-Lange wrote: > > > > Essentially we wish to reduce the window where the frontend and backend > > aren't synchronised. > > > > If we have (for example) 200 databases which each take 2 seconds to > > update, a client could be on the wrong frontend code for over 6 minutes. > > Send each of the servers a PL/PGSQL method that executes all the > things in a transaction and then waits until the same clock time to > commit. Then all the servers are committing at the same moment. They > will still be out of synch somewhat, but this would reduce the degree. This is a really interesting idea. Any thoughts on how to wrap pl/pgsql function dropping and recreation code within a wrapper pl/pgsql function?