From 5539c9d52a6b601555ec852ead387dab238b1510 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 9 Oct 2025 01:46:51 +0200 Subject: [PATCH] chore: add support for PostgreSQL 18 --- .github/workflows/tests.yml | 18 +++++++++--------- NEWS | 2 ++ doc/src/install.rst | 2 +- lib/errorcodes.py | 5 +++++ scripts/make_errorcodes.py | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 27a2c89a..a62a7556 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,17 +16,17 @@ jobs: fail-fast: false matrix: include: - - {python: "3.9", postgres: "13"} - - {python: "3.10", postgres: "14"} - - {python: "3.11", postgres: "15"} - - {python: "3.12", postgres: "16"} - - {python: "3.13", postgres: "17"} + - {python: "3.9", postgres: "14"} + - {python: "3.10", postgres: "15"} + - {python: "3.11", postgres: "16"} + - {python: "3.12", postgres: "17"} + - {python: "3.13", postgres: "18"} # Opposite extremes of the supported Py/PG range, other architecture - - {python: "3.9", postgres: "17", architecture: "x86"} - - {python: "3.10", postgres: "16", architecture: "x86"} - - {python: "3.11", postgres: "15", architecture: "x86"} - - {python: "3.12", postgres: "14", architecture: "x86"} + - {python: "3.9", postgres: "18", architecture: "x86"} + - {python: "3.10", postgres: "17", architecture: "x86"} + - {python: "3.11", postgres: "16", architecture: "x86"} + - {python: "3.12", postgres: "15", architecture: "x86"} - {python: "3.13", postgres: "13", architecture: "x86"} env: diff --git a/NEWS b/NEWS index 7120b838..6659585a 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ Current release What's new in psycopg 2.9.11 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- `~psycopg2.errorcodes` map and `~psycopg2.errors` classes updated to + PostgreSQL 18. - Drop support for Python 3.8. diff --git a/doc/src/install.rst b/doc/src/install.rst index 90174520..f32bb02d 100644 --- a/doc/src/install.rst +++ b/doc/src/install.rst @@ -132,7 +132,7 @@ The current `!psycopg2` implementation supports: NOTE: keep consistent with setup.py and the /features/ page. - Python versions from 3.9 to 3.13 -- PostgreSQL server versions from 7.4 to 17 +- PostgreSQL server versions from 7.4 to 18 - PostgreSQL client library version from 9.1 .. note:: diff --git a/lib/errorcodes.py b/lib/errorcodes.py index 0bc9625e..c8898a41 100644 --- a/lib/errorcodes.py +++ b/lib/errorcodes.py @@ -69,6 +69,7 @@ CLASS_LOCATOR_EXCEPTION = '0F' CLASS_INVALID_GRANTOR = '0L' CLASS_INVALID_ROLE_SPECIFICATION = '0P' CLASS_DIAGNOSTICS_EXCEPTION = '0Z' +CLASS_XQUERY_ERROR = '10' CLASS_CASE_NOT_FOUND = '20' CLASS_CARDINALITY_VIOLATION = '21' CLASS_DATA_EXCEPTION = '22' @@ -154,6 +155,9 @@ INVALID_ROLE_SPECIFICATION = '0P000' DIAGNOSTICS_EXCEPTION = '0Z000' STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER = '0Z002' +# Class 10 - XQuery Error +INVALID_ARGUMENT_FOR_XQUERY = '10608' + # Class 20 - Case Not Found CASE_NOT_FOUND = '20000' @@ -400,6 +404,7 @@ SYSTEM_ERROR = '58000' IO_ERROR = '58030' UNDEFINED_FILE = '58P01' DUPLICATE_FILE = '58P02' +FILE_NAME_TOO_LONG = '58P03' # Class 72 - Snapshot Failure SNAPSHOT_TOO_OLD = '72000' diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py index 19eefa2c..29386262 100755 --- a/scripts/make_errorcodes.py +++ b/scripts/make_errorcodes.py @@ -33,7 +33,7 @@ def main(): file_start = read_base_file(filename) # If you add a version to the list fix the docs (in errorcodes.rst) - classes, errors = fetch_errors("11 12 13 14 15 16 17".split()) + classes, errors = fetch_errors("11 12 13 14 15 16 17 18".split()) disambiguate(errors)