Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wVdBS-0025pL-33 for pgsql-general@arkaria.postgresql.org; Fri, 05 Jun 2026 22:38:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wVdBR-00F93Q-0T for pgsql-general@arkaria.postgresql.org; Fri, 05 Jun 2026 22:38:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wVdBQ-00F93H-2d for pgsql-general@lists.postgresql.org; Fri, 05 Jun 2026 22:38:32 +0000 Received: from luna.openvistas.net ([207.158.15.156]) by magus.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1wVdBN-00000001VDX-24uj for pgsql-general@lists.postgresql.org; Fri, 05 Jun 2026 22:38:31 +0000 Received: (qmail 85482 invoked from network); 5 Jun 2026 22:38:26 -0000 Received: from unknown (HELO ?10.0.26.30?) (jross@154.27.111.18) de/crypted with TLSv1.3: AEAD-AES128-GCM-SHA256 [128/128] DN=none by mail.openvistas.net with ESMTPSA; 5 Jun 2026 22:38:26 -0000 Message-ID: <5986509e-528b-4203-a607-402a6317d521@openvistas.net> Date: Fri, 5 Jun 2026 16:38:25 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Postgres 12 update to new major version To: pgsql-general@lists.postgresql.org References: Content-Language: en-US, en-MW From: Jeff Ross In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/5/26 2:30 PM, Adrian Klaver wrote: > On 6/5/26 5:11 AM, Boris Dovčík wrote: >> Hello all, >> >> I have a question regarding the update of the production database >> (multiple TB of data) from version 12 to higher major version. We would > > How many TB? > >> like to jump to 15 or 16. DB is installed on a Linux server with one >> replica on another, it is not on cloud. > > What replication is being done now? > > Where are the servers relative to each other network distance wise? > >> >> First question is should we perform updates one by one? 12 -> 13 -> >> 14 etc. or is it viable to jump to 16 right away? (We have few >> functions but usually its plain tables) >> >> Second we are contemplating options for the update since we are >> limited with downtime. We could get 4 hours of downtime for the whole >> update (either via pg_update or dumps). We are not sure how to >> estimate the > > Did you mean pg_upgrade? > >> time for direct update or dumps. What would be the recommended way >> for it? >> >> One option we see could be logical replication to the new major >> version on a new machine, but we received feedback that in our setup >> it might > > What was the feedback that indicated it was not advisable? > >> not be recommendable. Does it make sense to try logical replica? What >> would be the downsides of it? >> >> Best regards, >> Boris Dovčík I've got just a little over 1 TB in prod with a logical replica in the same network. We upgraded from 10 to 16 in one jump by first setting up the logical replica to run 16 and getting replication up and in sync. When it came time to do the upgrade from 10 to 16 it was just a few simple steps, and with minimal (less than 5 minutes downtime):     Stop the pgbouncers, which stopped all network traffic     Set the sequences on the 16 replica     Updated pgbouncer configs to point to the 16 server     Turned the pgbouncers back on Setting the sequences was the most time consuming part but it was really not long. Logical replication did the trick for us. I see that in 19 we won't even have to set the sequences because they are also replicated!  Hooray! One of the advantages to the logical replication route is that we could take advantage of testing a ton of our code against 16 on the replica *before* we ever flipped the switch. Jeff P.S.  I can't wait to hear how I did it all wrong or could have done it better but this absolutely worked ;-)