Revision 9390
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sql.py | ||
---|---|---|
598 | 598 |
name, type_ = match.groups() |
599 | 599 |
raise InvalidTypeException(type_, name, e) |
600 | 600 |
|
601 |
typed_name_re = r'^(\S+) "?(.+?)"?(?: of relation ".+?")?'
|
|
601 |
typed_name_re = r'^(\S+) (?:"([^"]*)"|(\S+))(?: of relation ".+?")?'
|
|
602 | 602 |
|
603 | 603 |
match = re.match(typed_name_re+r'.*? already exists', msg) |
604 | 604 |
if match: |
605 |
type_, name = match.groups() |
|
605 |
type_, name_quoted, name_unquoted = match.groups() |
|
606 |
name = util.coalesce(name_quoted, name_unquoted, u'') |
|
606 | 607 |
raise DuplicateException(type_, name, e) |
607 | 608 |
|
608 | 609 |
match = re.match(r'more than one (\S+) named ""(.+?)""', msg) |
... | ... | |
612 | 613 |
|
613 | 614 |
match = re.match(typed_name_re+r' does not exist', msg) |
614 | 615 |
if match: |
615 |
type_, name = match.groups() |
|
616 |
type_, name_quoted, name_unquoted = match.groups() |
|
617 |
name = util.coalesce(name_quoted, name_unquoted, u'') |
|
616 | 618 |
if type_ == 'function': |
617 | 619 |
match = re.match(r'^(.+?)\(.*\)$', name) |
618 | 620 |
if match: # includes params, so is call rather than cast to regproc |
Also available in: Unified diff
bugfix: lib/sql.py: parse_exception(): typed_name_re: need to ensure that full name is matched rather than just first character