summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2021-11-11 20:08:39 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2021-11-11 20:08:39 +0100
commit7dd193a7f7f20e3197fdd5e1ff91b1595f1c9214 (patch)
treee6b951269ff97433332d495b1ef82f852f55229f
parent1a0c02a6f48939dbe3f4b8b6930e28f9e62604e0 (diff)
downloadpsycopg2-7dd193a7f7f20e3197fdd5e1ff91b1595f1c9214.tar.gz
errorcodes map and errors classes updated to PostgreSQL 14.
-rw-r--r--NEWS4
-rw-r--r--lib/errorcodes.py1
-rw-r--r--psycopg/sqlstate_errors.h1
-rwxr-xr-xscripts/make_errorcodes.py2
-rwxr-xr-xscripts/make_errors.py2
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)