Error codes updated to PG 10 beta 1

This commit is contained in:
Daniele Varrazzo 2017-06-05 12:26:29 +01:00
parent 75d84f0b25
commit 89169e6e53
2 changed files with 12 additions and 5 deletions

View File

@ -173,6 +173,7 @@ INVALID_USE_OF_ESCAPE_CHARACTER = '2200C'
INVALID_ESCAPE_OCTET = '2200D'
ZERO_LENGTH_CHARACTER_STRING = '2200F'
MOST_SPECIFIC_TYPE_MISMATCH = '2200G'
SEQUENCE_GENERATOR_LIMIT_EXCEEDED = '2200H'
NOT_AN_XML_DOCUMENT = '2200L'
INVALID_XML_DOCUMENT = '2200M'
INVALID_XML_CONTENT = '2200N'
@ -316,6 +317,7 @@ WRONG_OBJECT_TYPE = '42809'
INVALID_FOREIGN_KEY = '42830'
CANNOT_COERCE = '42846'
UNDEFINED_FUNCTION = '42883'
GENERATED_ALWAYS = '428C9'
RESERVED_NAME = '42939'
UNDEFINED_TABLE = '42P01'
UNDEFINED_PARAMETER = '42P02'
@ -361,6 +363,7 @@ OBJECT_NOT_IN_PREREQUISITE_STATE = '55000'
OBJECT_IN_USE = '55006'
CANT_CHANGE_RUNTIME_PARAM = '55P02'
LOCK_NOT_AVAILABLE = '55P03'
UNSAFE_NEW_ENUM_VALUE_USAGE = '55P04'
# Class 57 - Operator Intervention
OPERATOR_INTERVENTION = '57000'

View File

@ -35,7 +35,7 @@ def main():
# If you add a version to the list fix the docs (errorcodes.rst, err.rst)
classes, errors = fetch_errors(
['8.1', '8.2', '8.3', '8.4', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5',
'9.6'])
'9.6', '10 b1'])
f = open(filename, "w")
for line in file_start:
@ -133,7 +133,7 @@ errors_sgml_url = \
errors_txt_url = \
"http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;" \
"f=src/backend/utils/errcodes.txt;hb=REL%s_STABLE"
"f=src/backend/utils/errcodes.txt;hb=%s"
def fetch_errors(versions):
@ -142,12 +142,16 @@ def fetch_errors(versions):
for version in versions:
print >> sys.stderr, version
tver = tuple(map(int, version.split('.')))
tver = tuple(map(int, version.split()[0].split('.')))
if tver < (9, 1):
c1, e1 = parse_errors_sgml(errors_sgml_url % version)
else:
c1, e1 = parse_errors_txt(
errors_txt_url % version.replace('.', '_'))
# TODO: move to 10 stable when released.
if version == '10 b1':
tag = 'REL_10_BETA1'
else:
tag = 'REL%s_STABLE' % version.replace('.', '_')
c1, e1 = parse_errors_txt(errors_txt_url % tag)
classes.update(c1)
for c, cerrs in e1.iteritems():
errors[c].update(cerrs)