mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 08:56:34 +03:00
Dropped creation of errcodes with missing spec field
On further inspection these names are just aliases for values already defined: we don't need the duplication.
This commit is contained in:
parent
ccc30e1877
commit
6705e4051d
2
NEWS
2
NEWS
|
@ -22,8 +22,6 @@ What's new in psycopg 2.5.4
|
||||||
(:ticket:`#228`).
|
(:ticket:`#228`).
|
||||||
- Cursors :sql:`WITH HOLD` can be used in autocommit (:ticket:`#229`).
|
- Cursors :sql:`WITH HOLD` can be used in autocommit (:ticket:`#229`).
|
||||||
- Don't ignore silently the `cursor.callproc` argument without a length.
|
- 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.
|
|
||||||
- Make sure the internal `_psycopg.so` module can be imported stand-alone
|
- Make sure the internal `_psycopg.so` module can be imported stand-alone
|
||||||
(to allow modules juggling such as the one described in :ticket:`#201`).
|
(to allow modules juggling such as the one described in :ticket:`#201`).
|
||||||
- Fixed memory leak with large objects (regression introduced in 2.5.3).
|
- Fixed memory leak with large objects (regression introduced in 2.5.3).
|
||||||
|
|
|
@ -284,10 +284,6 @@ STATEMENT_COMPLETION_UNKNOWN = '40003'
|
||||||
DEADLOCK_DETECTED = '40P01'
|
DEADLOCK_DETECTED = '40P01'
|
||||||
|
|
||||||
# Class 42 - Syntax Error or Access Rule Violation
|
# 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'
|
SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION = '42000'
|
||||||
INSUFFICIENT_PRIVILEGE = '42501'
|
INSUFFICIENT_PRIVILEGE = '42501'
|
||||||
SYNTAX_ERROR = '42601'
|
SYNTAX_ERROR = '42601'
|
||||||
|
|
|
@ -72,15 +72,10 @@ def parse_errors_txt(url):
|
||||||
m = re.match(r"(.....)\s+(?:E|W|S)\s+ERRCODE_(\S+)(?:\s+(\S+))?$", line)
|
m = re.match(r"(.....)\s+(?:E|W|S)\s+ERRCODE_(\S+)(?:\s+(\S+))?$", line)
|
||||||
if m:
|
if m:
|
||||||
errcode, macro, spec = m.groups()
|
errcode, macro, spec = m.groups()
|
||||||
# error 22008 has 2 macros and 1 def: give priority to the def
|
# skip errcodes without specs as they are not publically visible
|
||||||
# as it's the one we used to parse from sgml
|
|
||||||
if not spec:
|
if not spec:
|
||||||
if errcode in errors[class_]:
|
continue
|
||||||
continue
|
errlabel = spec.upper()
|
||||||
errlabel = macro.upper()
|
|
||||||
else:
|
|
||||||
errlabel = spec.upper()
|
|
||||||
|
|
||||||
errors[class_][errcode] = errlabel
|
errors[class_][errcode] = errlabel
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user