From 0715771845746831db78e9cc3669ff85e745e9c8 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 28 Aug 2014 02:05:54 +0100 Subject: [PATCH] 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. --- NEWS | 2 -- lib/errorcodes.py | 4 ---- scripts/make_errorcodes.py | 11 +++-------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index 4fa1a0b3..d7d4b03a 100644 --- a/NEWS +++ b/NEWS @@ -13,8 +13,6 @@ What's new in psycopg 2.5.4 (:ticket:`#228`). - Cursors :sql:`WITH HOLD` can be used in autocommit (:ticket:`#229`). - 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 (to allow modules juggling such as the one described in :ticket:`#201`). - Fixed memory leak with large objects (regression introduced in 2.5.3). diff --git a/lib/errorcodes.py b/lib/errorcodes.py index e004cac5..12c300f6 100644 --- a/lib/errorcodes.py +++ b/lib/errorcodes.py @@ -284,10 +284,6 @@ 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' diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py index d6e25337..122e0d56 100755 --- a/scripts/make_errorcodes.py +++ b/scripts/make_errorcodes.py @@ -72,15 +72,10 @@ def parse_errors_txt(url): m = re.match(r"(.....)\s+(?:E|W|S)\s+ERRCODE_(\S+)(?:\s+(\S+))?$", line) if m: errcode, macro, spec = m.groups() - # error 22008 has 2 macros and 1 def: give priority to the def - # as it's the one we used to parse from sgml + # skip errcodes without specs as they are not publically visible if not spec: - if errcode in errors[class_]: - continue - errlabel = macro.upper() - else: - errlabel = spec.upper() - + continue + errlabel = spec.upper() errors[class_][errcode] = errlabel continue