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.94.2) (envelope-from ) id 1uQtVj-002G5y-Ds for pgsql-admin@arkaria.postgresql.org; Sun, 15 Jun 2025 19:59:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uQtVh-00Dnxw-GE for pgsql-admin@arkaria.postgresql.org; Sun, 15 Jun 2025 19:59:22 +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.94.2) (envelope-from ) id 1uQkFC-00CJZu-9i for pgsql-admin@lists.postgresql.org; Sun, 15 Jun 2025 10:05:42 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uQkFA-002A2L-2x for pgsql-admin@lists.postgresql.org; Sun, 15 Jun 2025 10:05:42 +0000 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-739dcdb012fso922807a34.2 for ; Sun, 15 Jun 2025 03:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749981938; x=1750586738; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YHvlWfzwUTBwIg/3+MKdnZo4INgd94amb9ki2d+s8FI=; b=hrnzbNCusNwv73UbAj7JasEcQwWNcetvZsWiZvJD5iwRBcRg2UNLLdmZl4VeGTjk9f ewPrDP/DlkgZHbG+x5oXFNMC6CLXzj9cgxmK4I48Sf0WjD/B4BAAY7xtWa0CxET6WJi0 V1GDFckdfI790VnCnB20k/LchQpLOTqzl45ixV/cCZ9MX6YiTTu3m0ijn+kp+WuxMR9h zvKjJvf2VML9Ue6o6vYUbBfXJtsNULLxfWhXs8Nm+Q+7Ax3yCMhXAr2IBJZVcaouzh+H XHRhQ0KOz0RiamIH9K13CAHoZ4npb9D9xve2pknY4xBJbK1jp6dybGMcC64uGiu882aE IRcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749981938; x=1750586738; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YHvlWfzwUTBwIg/3+MKdnZo4INgd94amb9ki2d+s8FI=; b=qRU8t23MZ36SpypN0/u6vRB34/3UKinwffxP83FU0AGtxv6aPxxaftguhmyKHzDZjt sBU07yHuTJq9tFLEqw6R+4C4ipdOB5HC00Jyj+cqwaH3Mem0v1OORvVdkxglsccMxkMC fHb2vFtSl5GeG9ht9wLIlN8M+dCyqkmYUQuyChnk2WDsKtGmmwIT54ZiIAHiLAIjO9Er 24IjemAd4ZCgjmtvg9IIj6wYhaKtIaIoLv29G2xdlmO9j5+eoyqaw9+sOUn1GrEMj9GQ tnpljQwNmLdzNpMiAzCUM0aVCkv8cOpdVuAu28f6TCQUT9h9P87AsRmiEuyj80YoRg6v Awaw== X-Forwarded-Encrypted: i=1; AJvYcCXCmztu6u7IUyee+JlbU0aombib0dVjnzYxUSUKuBrmZzY8937fzK/7E8EALUEAq5UeWiRekRf0rqO2lQ==@lists.postgresql.org X-Gm-Message-State: AOJu0YwPedtoGYStmIJk+OXtD0qLLPHsutHEpzUi1iXbf3hbSOCid6zL q7D95hjiH3gv8pY0jM+OXeBLWXaDzCpPzICZW1W+32akEnq/ChqtS7OL0cO1Vq9v3wmotkmiq6G M2ICXomOxFNUqEI3h5Y2fqbGi9U06Srw= X-Gm-Gg: ASbGncvQRtKrlDSv7F9Trf0r9dTqlZx51zmShMwBQv6mm4uWENWe8H+hfjSfeU4csO5 ziYSs5AwolpMuUDrZdUk09JhhJna/Ki21EAdvNSoQtwUPvLR8TjLp2cFnILJFKxdks4teZJObM4 A5MRAqGWVPxUiyAb2a+NUk3GtQ+W6w26I8GGfIqpSEQj1M X-Google-Smtp-Source: AGHT+IF/dW6/4T+0/3ftGxgQm404l3KWQ48XryvRzUVcAeD82VhviqUi0emXw36MamZtd9h+dGw2BmtspMv6rugSf0g= X-Received: by 2002:a05:6870:e0ce:b0:2bd:456c:92a with SMTP id 586e51a60fabf-2eaf05ef307mr3626915fac.10.1749981938590; Sun, 15 Jun 2025 03:05:38 -0700 (PDT) MIME-Version: 1.0 References: <61b6cfb6ae03b5ad6512d0d167a5cb409ae58f21.camel@cybertec.at> In-Reply-To: From: Kushal Shri Date: Sun, 15 Jun 2025 15:50:27 +0545 X-Gm-Features: AX0GCFuVHGVdrwRtm1_HxXPmBSqbsC8PONG9KHKehY7YcswuZzzTRdLK573R5NM Message-ID: Subject: Re: PostgreSQL Upgrade (v9.5 to v12) with Django 2.0 To: ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org Cc: Laurenz Albe , eduardobarbachandb@gmail.com Content-Type: multipart/alternative; boundary="000000000000d0281c0637996be4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d0281c0637996be4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Currently, our plan is to test pg_upgrade using the --link option to upgrade from PostgreSQL 9.5 to 12, then upgrade Django to the latest supported version, and finally perform another pg_upgrade to PostgreSQL 16. Since Django 2.0 is officially tested and supported only up to PostgreSQL 10, would you recommend upgrading to PostgreSQL 10 using pg_upgrade as the first phase, followed by logical replication to PostgreSQL 16 as the final target after upgrading Django as well? and, if we use the --link option for pg_upgrade, what would be the rollback plan in case issues arise during or after the upgrade? On Sat, 14 Jun 2025 at 01:59, Eduardo Barbachan < eduardobarbachandb@gmail.com> wrote: > I'm sorry if this part of the answer should not be given in this context, > but I happen to be in this list (as a lurker for most of the time) and be= a > Django user. > Till Django 4.2 (LTS) postgres 12 is supported. Django 5.2 (LTS also) > supports postgres 17+. > > > Em qui., 12 de jun. de 2025 =C3=A0s 10:19, Laurenz Albe < > laurenz.albe@cybertec.at> escreveu: > >> On Wed, 2025-06-11 at 16:39 +0545, Kushal Shri wrote: >> > We are in the process of planning a PostgreSQL upgrade and would great= ly >> > appreciate any insights, best practices, or lessons learned from your >> experiences. >> > >> > Current Setup: >> > - PostgreSQL version: 9.5 >> > - Django version: 2.0 >> > - Database size: ~3 TB >> > - One Master 4 Replicas(Streaming Replication) >> > >> > We are taking a phased approach to this upgrade. In Phase 1, our goal >> is to >> > upgrade PostgreSQL from v9.5 to v12, ensuring compatibility with our >> current >> > Django 2.0 application. >> >> That's already wrong. PostgreSQL v12 is out of support. Upgrade to v17 >> or v18. >> >> > As part of this, I would like to understand: >> > >> > - What is the highest PostgreSQL version reliably supported with Djang= o >> 2.0? >> >> You'll have to ask Django what they support. >> >> > - What upgrade strategies or methods have worked well for you in >> similar environments? >> >> pg_upgrade --link >> >> > - Any gotchas or performance considerations to keep in mind with large >> databases >> > during such upgrades? >> >> Make sure you don't have millions of Large Objects, otherwise the upgrad= e >> will be very slow and memory consuming. >> >> Yours, >> Laurenz Albe >> >> >> > > -- > > Att. > > Eduardo Barbachan > --000000000000d0281c0637996be4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Currently, our plan is to test pg_upgrade using the --l= ink option to upgrade from PostgreSQL 9.5 to 12, then upgrade Django to the= latest supported version, and finally perform another pg_upgrade to Postgr= eSQL 16.

Since Django 2.0 is officially tested and supported o= nly up to PostgreSQL 10, would you recommend upgrading to PostgreSQL 10 usi= ng pg_upgrade as the first phase, followed by logical replication to Postgr= eSQL 16 as the final target after upgrading Django as well?

an= d, if we use the --link option for pg_upgrade, what would be the rollback p= lan in case issues arise during or after the upgrade?


<= div class=3D"gmail_quote gmail_quote_container">
On Sat, 14 Jun 2025 at 01:59, Eduardo Barbachan <eduardobarbachandb@gmail.com> wr= ote:
I'm sorry if this part of the answer should not be given in = this context, but I happen to be in this list (as a lurker for most of the = time) and be a Django user.=C2=A0
Till Django 4.2 (LTS) postgres 12 is s= upported. Django 5.2 (LTS also) supports postgres 17+.

=

= Em qui., 12 de jun. de 2025 =C3=A0s 10:19, Laurenz Albe <laurenz.albe@cybertec.at= > escreveu:
O= n Wed, 2025-06-11 at 16:39 +0545, Kushal Shri wrote:
> We are in the process of planning a PostgreSQL upgrade and would great= ly
> appreciate any insights, best practices, or lessons learned from your = experiences.
>
> Current Setup:
> =C2=A0 =C2=A0- PostgreSQL version: 9.5
> =C2=A0 =C2=A0- Django version: 2.0
> =C2=A0 =C2=A0- Database size: ~3 TB
> =C2=A0 =C2=A0- One Master 4 Replicas(Streaming Replication)
>
> We are taking a phased approach to this upgrade. In Phase 1, our goal = is to
> upgrade PostgreSQL from v9.5 to v12, ensuring compatibility with our c= urrent
> Django 2.0 application.

That's already wrong.=C2=A0 PostgreSQL v12 is out of support.=C2=A0 Upg= rade to v17 or v18.

> As part of this, I would like to understand:
>
> - What is the highest PostgreSQL version reliably supported with Djang= o 2.0?

You'll have to ask Django what they support.

> - What upgrade strategies or methods have worked well for you in simil= ar environments?

pg_upgrade --link

> - Any gotchas or performance considerations to keep in mind with large= databases
>=C2=A0 =C2=A0during such upgrades?

Make sure you don't have millions of Large Objects, otherwise the upgra= de
will be very slow and memory consuming.

Yours,
Laurenz Albe




--

A= tt.

Eduardo =C2=A0Barbachan

--000000000000d0281c0637996be4--