diff --git a/NEWS b/NEWS index 21f6d201..737d3a3f 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ What's new in psycopg 2.5.4 - Fixed segfault if COPY statements are executed instead of using the proper methods (:ticket:`#219`). - Don't ignore silently the `cursor.callproc` argument without a length. +- Added a few errors missing from `~psycopg2.errorcodes`, defined by + PostgreSQL but not documented. What's new in psycopg 2.5.3 diff --git a/doc/src/errorcodes.rst b/doc/src/errorcodes.rst index bfaaeb45..3fdd5499 100644 --- a/doc/src/errorcodes.rst +++ b/doc/src/errorcodes.rst @@ -49,7 +49,7 @@ An example of the available constants defined in the module: >>> errorcodes.UNDEFINED_TABLE '42P01' -Constants representing all the error values documented by PostgreSQL versions +Constants representing all the error values defined by PostgreSQL versions between 8.1 and 9.2 are included in the module. diff --git a/lib/errorcodes.py b/lib/errorcodes.py index 12c300f6..e004cac5 100644 --- a/lib/errorcodes.py +++ b/lib/errorcodes.py @@ -284,6 +284,10 @@ STATEMENT_COMPLETION_UNKNOWN = '40003' DEADLOCK_DETECTED = '40P01' # Class 42 - Syntax Error or Access Rule Violation +UNDEFINED_PSTATEMENT = '26000' +UNDEFINED_CURSOR = '34000' +UNDEFINED_DATABASE = '3D000' +UNDEFINED_SCHEMA = '3F000' SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION = '42000' INSUFFICIENT_PRIVILEGE = '42501' SYNTAX_ERROR = '42601'