summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2022-10-06 02:26:09 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2022-10-06 02:26:09 +0100
commit29a65f756c7871010ecc73828458d4d9b6a4928d (patch)
tree22984f66604611c6221ba57d53f7e864ab81e023
parent6d815f5df95b7c920df0f9d9bcfb8ecc47510cbc (diff)
downloadpsycopg2-29a65f756c7871010ecc73828458d4d9b6a4928d.tar.gz
chore: upgrade error codes to PostgreSQL 15
-rw-r--r--NEWS2
-rw-r--r--doc/src/errorcodes.rst2
-rw-r--r--doc/src/errors.rst6
-rw-r--r--doc/src/install.rst2
-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
8 files changed, 13 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index e04314b..c14250e 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ What's new in psycopg 2.9.4 (unreleased)
- Fix `register_composite()`, `register_range()` with customized search_path
(:ticket:`#1487`).
- Handle correctly composite types with names or in schemas requiring escape.
+- `~psycopg2.errorcodes` map and `~psycopg2.errors` classes updated to
+ PostgreSQL 15.
Current release
diff --git a/doc/src/errorcodes.rst b/doc/src/errorcodes.rst
index 2966efa..4094dc5 100644
--- a/doc/src/errorcodes.rst
+++ b/doc/src/errorcodes.rst
@@ -50,7 +50,7 @@ An example of the available constants defined in the module:
'42P01'
Constants representing all the error values defined by PostgreSQL versions
-between 8.1 and 13 are included in the module.
+between 8.1 and 15 are included in the module.
.. autofunction:: lookup(code)
diff --git a/doc/src/errors.rst b/doc/src/errors.rst
index d1aed13..d6a7f4f 100644
--- a/doc/src/errors.rst
+++ b/doc/src/errors.rst
@@ -14,11 +14,15 @@
.. versionchanged:: 2.8.6 added errors introduced in PostgreSQL 13
+.. versionchanged:: 2.9.2 added errors introduced in PostgreSQL 14
+
+.. versionchanged:: 2.9.4 added errors introduced in PostgreSQL 15
+
This module exposes the classes psycopg raises upon receiving an error from
the database with a :sql:`SQLSTATE` value attached (available in the
`~psycopg2.Error.pgcode` attribute). The content of the module is generated
from the PostgreSQL source code and includes classes for every error defined
-by PostgreSQL in versions between 9.1 and 13.
+by PostgreSQL in versions between 9.1 and 15.
Every class in the module is named after what referred as "condition name" `in
the documentation`__, converted to CamelCase: e.g. the error 22012,
diff --git a/doc/src/install.rst b/doc/src/install.rst
index 8d22137..7ac2d14 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.6 to 3.10
-- PostgreSQL server versions from 7.4 to 14
+- PostgreSQL server versions from 7.4 to 15
- PostgreSQL client library version from 9.1
diff --git a/lib/errorcodes.py b/lib/errorcodes.py
index b76eb14..aa646c4 100644
--- a/lib/errorcodes.py
+++ b/lib/errorcodes.py
@@ -223,6 +223,7 @@ SQL_JSON_OBJECT_NOT_FOUND = '2203C'
TOO_MANY_JSON_ARRAY_ELEMENTS = '2203D'
TOO_MANY_JSON_OBJECT_MEMBERS = '2203E'
SQL_JSON_SCALAR_REQUIRED = '2203F'
+SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE = '2203G'
FLOATING_POINT_EXCEPTION = '22P01'
INVALID_TEXT_REPRESENTATION = '22P02'
INVALID_BINARY_REPRESENTATION = '22P03'
diff --git a/psycopg/sqlstate_errors.h b/psycopg/sqlstate_errors.h
index e717727..38ad78d 100644
--- a/psycopg/sqlstate_errors.h
+++ b/psycopg/sqlstate_errors.h
@@ -111,6 +111,7 @@
{"2203D", "TooManyJsonArrayElements"},
{"2203E", "TooManyJsonObjectMembers"},
{"2203F", "SqlJsonScalarRequired"},
+{"2203G", "SqlJsonItemCannotBeCastToTargetType"},
{"22P01", "FloatingPointException"},
{"22P02", "InvalidTextRepresentation"},
{"22P03", "InvalidBinaryRepresentation"},
diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py
index 0a7ee8d..378ce84 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', '14'])
+ '9.1 9.2 9.3 9.4 9.5 9.6 10 11 12 13 14 15'.split())
disambiguate(errors)
diff --git a/scripts/make_errors.py b/scripts/make_errors.py
index 7085c41..59b1b2b 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', '14'])
+ '9.1 9.2 9.3 9.4 9.5 9.6 10 11 12 13 14 15'.split())
f = open(filename, "w")
print("/*\n * Autogenerated by 'scripts/make_errors.py'.\n */\n", file=f)