From 7dd193a7f7f20e3197fdd5e1ff91b1595f1c9214 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 11 Nov 2021 20:08:39 +0100 Subject: errorcodes map and errors classes updated to PostgreSQL 14. --- NEWS | 4 +++- lib/errorcodes.py | 1 + psycopg/sqlstate_errors.h | 1 + scripts/make_errorcodes.py | 2 +- scripts/make_errors.py | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 3f1b7ba..e8e64df 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,9 @@ Current release What's new in psycopg 2.9.2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Raise `ValueError` for dates >= Y10k (:ticket:`#1307`) +- Raise `ValueError` for dates >= Y10k (:ticket:`#1307`). +- `~psycopg2.errorcodes` map and `~psycopg2.errors` classes updated to + PostgreSQL 14. What's new in psycopg 2.9.1 diff --git a/lib/errorcodes.py b/lib/errorcodes.py index d511f1c..b76eb14 100644 --- a/lib/errorcodes.py +++ b/lib/errorcodes.py @@ -391,6 +391,7 @@ ADMIN_SHUTDOWN = '57P01' CRASH_SHUTDOWN = '57P02' CANNOT_CONNECT_NOW = '57P03' DATABASE_DROPPED = '57P04' +IDLE_SESSION_TIMEOUT = '57P05' # Class 58 - System Error (errors external to PostgreSQL itself) SYSTEM_ERROR = '58000' diff --git a/psycopg/sqlstate_errors.h b/psycopg/sqlstate_errors.h index 0b85dd5..e717727 100644 --- a/psycopg/sqlstate_errors.h +++ b/psycopg/sqlstate_errors.h @@ -279,6 +279,7 @@ {"57P02", "CrashShutdown"}, {"57P03", "CannotConnectNow"}, {"57P04", "DatabaseDropped"}, +{"57P05", "IdleSessionTimeout"}, /* Class 58 - System Error (errors external to PostgreSQL itself) */ {"58000", "SystemError"}, diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py index 66ca87b..0a7ee8d 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( - ['9.1', '9.2', '9.3', '9.4', '9.5', '9.6', '10', '11', '12', '13']) + ['9.1', '9.2', '9.3', '9.4', '9.5', '9.6', '10', '11', '12', '13', '14']) disambiguate(errors) diff --git a/scripts/make_errors.py b/scripts/make_errors.py index fb22708..7085c41 100755 --- a/scripts/make_errors.py +++ b/scripts/make_errors.py @@ -30,7 +30,7 @@ def main(): # If you add a version to the list fix the docs (in errors.rst) classes, errors = fetch_errors( - ['9.1', '9.2', '9.3', '9.4', '9.5', '9.6', '10', '11', '12', '13']) + ['9.1', '9.2', '9.3', '9.4', '9.5', '9.6', '10', '11', '12', '13', '14']) f = open(filename, "w") print("/*\n * Autogenerated by 'scripts/make_errors.py'.\n */\n", file=f) -- cgit v1.2.1