summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2014-08-28 02:05:54 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2014-08-28 02:17:57 +0100
commit6705e4051dc97256fb1d2f59773c84d43dcb0589 (patch)
tree54d783dd8b03e2c028f4187ae482f4b526351e7a
parentccc30e1877a76c5affe1cdd9c7384f62e54a1d63 (diff)
downloadpsycopg2-6705e4051dc97256fb1d2f59773c84d43dcb0589.tar.gz
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.
-rw-r--r--NEWS2
-rw-r--r--lib/errorcodes.py4
-rwxr-xr-xscripts/make_errorcodes.py11
3 files changed, 3 insertions, 14 deletions
diff --git a/NEWS b/NEWS
index 66d9aac..890da26 100644
--- a/NEWS
+++ b/NEWS
@@ -22,8 +22,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 e004cac..12c300f 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 d6e2533..122e0d5 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