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 1uTHUY-002LYN-Qj for pgsql-admin@arkaria.postgresql.org; Sun, 22 Jun 2025 10:00:02 +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 1uTHUW-00C8dc-Si for pgsql-admin@arkaria.postgresql.org; Sun, 22 Jun 2025 10:00:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uTHUW-00C8ce-DU for pgsql-admin@lists.postgresql.org; Sun, 22 Jun 2025 10:00:01 +0000 Received: from cc-smtpout1.netcologne.de ([89.1.8.211]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uTHUU-003MhY-0C for pgsql-admin@lists.postgresql.org; Sun, 22 Jun 2025 10:00:00 +0000 Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id A4B141221F for ; Sun, 22 Jun 2025 11:59:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1750586394; bh=9TowEC3nGfn9XupQ/3ERBBn+ztmLXDZLNZZp4sli2fo=; h=Message-ID:Date:Subject:To:References:From:In-Reply-To:From; b=PnuTrfkJX3On7Fsqw6tqCNh6AnwKv8NWPkzN47GciVjEVX8zZE63NljW7LmbCtsD+ jMAdSQksUVq6fvP9Rd/JSP8idPCeT8yBsxBZY0eQqH1C7mWZst+DaUB/TZUHugsotL lb7YjZYbQRFC/kJ5os5duAjFCY39uiq+tvmCCQrnKfdFduafNSEof2D8vDlFBM1IXH hOb1X28X0WoEpYuHk/QzPkUgji1JoJaZpmxHA50lcrg9rb6cHr3dnG2WLJrKC72nXh UpnjNfaetyH8sEDtY5QVLwJSD6PXEe6fF3hy/C2rF1fSf/65Tu+mqTnvdWRsxQKWn+ GtAJ+C/hbloRg== Received: from [IPV6:2a03:b580:afbb:9101:c452:7d7e:87de:9de9] (unknown [IPv6:2a03:b580:afbb:9101:c452:7d7e:87de:9de9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA id 801F011D73 for ; Sun, 22 Jun 2025 11:59:54 +0200 (CEST) Content-Type: multipart/alternative; boundary="------------EkKTILuNmNV7TcxvNyDun3Wg" Message-ID: <6db6f240-aa33-44d1-9cbd-0a7007d4115f@netcologne.de> Date: Sun, 22 Jun 2025 12:00:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PostgreSQL Upgrade (v9.5 to v12) with Django 2.0 To: pgsql-admin@lists.postgresql.org References: <61b6cfb6ae03b5ad6512d0d167a5cb409ae58f21.camel@cybertec.at> Content-Language: en-US From: vrms In-Reply-To: X-NetCologne-Spam: L X-Rspamd-Queue-Id: 801F011D73 X-Spamd-Bar: - X-Rspamd-Action: no action List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------EkKTILuNmNV7TcxvNyDun3Wg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable >> if we use the --link option for pg_upgrade, what would be the=20 rollback plan in case issues arise during or after the upgrade? restoring a backup would be your option in such a case I guess. On 15.06.25 12:05, Kushal Shri wrote: > > Currently, our plan is to test pg_upgrade using the --link option to=20 > upgrade from PostgreSQL 9.5 to 12, then upgrade Django to the latest=20 > supported version, and finally perform another pg_upgrade to=20 > PostgreSQL 16. > > Since Django 2.0 is officially tested and supported only up to=20 > PostgreSQL 10, would you recommend upgrading to PostgreSQL 10 using=20 > pg_upgrade as the first phase, followed by logical replication to=20 > 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=20 > rollback plan in case issues arise during or after the upgrade? > > > On Sat, 14 Jun 2025 at 01:59, Eduardo Barbachan=20 > 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 > 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 greatly > > 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 current > > Django 2.0 application. > > That's already wrong.=C2=A0 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 Django 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 > >=C2=A0 =C2=A0during such upgrades? > > Make sure you don't have millions of Large Objects, otherwise > the upgrade > will be very slow and memory consuming. > > Yours, > Laurenz Albe > > > > > --=20 > > Att. > > Eduardo =C2=A0Barbachan > --------------EkKTILuNmNV7TcxvNyDun3Wg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable >> if we use the --link option for pg_upgrade, what would be the rollback plan in case issues arise during or after the upgrade?
restoring a backup would be your option in such a case I guess.



On 15.06.25 12:05, Kushal Shri wrote:<= br>

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:5= 9, Eduardo Barbachan <edua= rdobarbachandb@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.=C2=A0<= br> 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 greatly
> 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 Replica= tion)
>
> 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.=C2=A0 PostgreSQL v12 is out of suppor= t.=C2=A0 Upgrade to v17 or v18.

> As part of this, I would like to understand:
>
> - What is the highest PostgreSQL version reliably supported with Django 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
>=C2=A0 =C2=A0during such upgrades?

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

Yours,
Laurenz Albe




--

Att.

Eduardo =C2=A0Barbachan

--------------EkKTILuNmNV7TcxvNyDun3Wg--