``2203D`` `!TooManyJsonArrayElements` `!DataError`
``2203E`` `!TooManyJsonObjectMembers` `!DataError`
``2203F`` `!SqlJsonScalarRequired` `!DataError`
+``2203G`` `!SqlJsonItemCannotBeCastToTargetType` `!DataError`
``22P01`` `!FloatingPointException` `!DataError`
``22P02`` `!InvalidTextRepresentation` `!DataError`
``22P03`` `!InvalidBinaryRepresentation` `!DataError`
========= ================================================== ====================
.. autogenerated: end
+
+.. versionadded:: 3.1.4
+ Exception `!SqlJsonItemCannotBeCastToTargetType`, introduced in PostgreSQL
+ 15.
``psycopg`` release notes
=========================
+Future releases
+---------------
+
+Psycopg 3.1.4 (unreleased)
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- Include :ref:`error classes <sqlstate-exceptions>` defined in PostgreSQL 15.
+
+
Current release
---------------
code='2203F', name='SQL_JSON_SCALAR_REQUIRED'):
pass
+class SqlJsonItemCannotBeCastToTargetType(DataError,
+ code='2203G', name='SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE'):
+ pass
+
class FloatingPointException(DataError,
code='22P01', name='FLOATING_POINT_EXCEPTION'):
pass
for t in [
TypeInfo('"char"', 18, 1002),
# autogenerated: start
- # Generated from PostgreSQL 14.0
+ # Generated from PostgreSQL 15.0
TypeInfo("aclitem", 1033, 1034),
TypeInfo("bit", 1560, 1561),
TypeInfo("bool", 16, 1000, regtype="boolean"),
# autogenerated: start
- # Generated from PostgreSQL 14.0
+ # Generated from PostgreSQL 15.0
ACLITEM_OID = 1033
BIT_OID = 1560
def main():
- classes, errors = fetch_errors(["9.6", "10", "11", "12", "13", "14"])
+ classes, errors = fetch_errors("9.6 10 11 12 13 14 15".split())
fn = os.path.dirname(__file__) + "/../psycopg/psycopg/errors.py"
update_file(fn, generate_module_data(classes, errors))
This script updates some of the files in psycopg source code with data read
from a database catalog.
+
+Hint: use docker to upgrade types from a new version in isolation. Run:
+
+ docker run --rm -p 11111:5432 --name pg -e POSTGRES_PASSWORD=password postgres:TAG
+
+with a specified version tag, and then query it using:
+
+ %(prog)s "host=localhost port=11111 user=postgres password=password"
"""
import re
def parse_cmdline() -> argparse.Namespace:
- parser = argparse.ArgumentParser(description=__doc__)
+ parser = argparse.ArgumentParser(
+ description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
+ )
parser.add_argument("dsn", help="where to connect to")
opt = parser.parse_args()
return opt