diff -pruN 1.3.0-1/debian/changelog 1.3.0-1ubuntu1/debian/changelog
--- 1.3.0-1/debian/changelog	2023-05-28 12:24:41.000000000 +0000
+++ 1.3.0-1ubuntu1/debian/changelog	2023-08-31 16:19:08.000000000 +0000
@@ -1,3 +1,11 @@
+django-cte (1.3.0-1ubuntu1) mantic; urgency=medium
+
+  * d/p/fix-column-alias-django4.patch: Remove SQL column aliases as a
+    workaround for Django 4 introducing aliases that break access to
+    rootmap.name (LP: #2022089)
+
+ -- Lena Voytek <lena.voytek@canonical.com>  Thu, 31 Aug 2023 09:19:08 -0700
+
 django-cte (1.3.0-1) unstable; urgency=medium
 
   * New upstream release.
diff -pruN 1.3.0-1/debian/control 1.3.0-1ubuntu1/debian/control
--- 1.3.0-1/debian/control	2023-05-28 12:23:57.000000000 +0000
+++ 1.3.0-1ubuntu1/debian/control	2023-08-31 16:19:08.000000000 +0000
@@ -1,5 +1,6 @@
 Source: django-cte
-Maintainer: Debian Python Team <team+python@tracker.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
 Uploaders: Edward Betts <edward@4angle.com>
 Section: python
 Priority: optional
diff -pruN 1.3.0-1/debian/patches/fix-column-alias-django4.patch 1.3.0-1ubuntu1/debian/patches/fix-column-alias-django4.patch
--- 1.3.0-1/debian/patches/fix-column-alias-django4.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1.3.0-1ubuntu1/debian/patches/fix-column-alias-django4.patch	2023-08-31 16:19:08.000000000 +0000
@@ -0,0 +1,30 @@
+Description: Do not use Django 4.2 column aliases so rootmap.name is accessible
+ When Django 4.2 was released, it added a commit that generated explicit
+ aliases in generated SQL. This leads to a situation in the current version of
+ django-cte where query executions fail due to rootmap's "name" attribute being
+ aliased to "col1". There is an ongoing discussion as to how to move forward
+ with this in future django-cte versions in the attached bug, but the current
+ best workaround is to avoid using aliases when generating SQL statements in
+ the CTEQueryCompiler class. The final solution to this will likely be
+ different though, with some drafts in progress, such as:
+ https://github.com/dimagi/django-cte/pull/59
+ As such this patch will need to be removed once a newer version with the bug
+ fixed is merged.
+Author: Lena Voytek <lena.voytek@canonical.com>
+Bug: https://github.com/dimagi/django-cte/issues/66
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/mantic/+source/django-cte/+bug/2022089
+Forwarded: not-needed
+Last-Update: 2023-08-31
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/django_cte/query.py
++++ b/django_cte/query.py
+@@ -133,6 +133,8 @@
+ class CTEQueryCompiler(SQLCompiler):
+ 
+     def as_sql(self, *args, **kwargs):
++        with_col_aliases = kwargs.pop('with_col_aliases', None)
++
+         def _as_sql():
+             return super(CTEQueryCompiler, self).as_sql(*args, **kwargs)
+         return CTECompiler.generate_sql(self.connection, self.query, _as_sql)
diff -pruN 1.3.0-1/debian/patches/series 1.3.0-1ubuntu1/debian/patches/series
--- 1.3.0-1/debian/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ 1.3.0-1ubuntu1/debian/patches/series	2023-08-31 16:19:08.000000000 +0000
@@ -0,0 +1 @@
+fix-column-alias-django4.patch
