diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-08-21 20:59:04 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-08-21 21:03:44 -0400 |
commit | 32ce703a98eba8a7685e609b4a7ca86b79dd0904 (patch) | |
tree | daccb23549471e07d963b31a93722e2035a51738 /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | aafc4cb2c93e474e068983927475ea3f2f370524 (diff) | |
download | sqlalchemy-32ce703a98eba8a7685e609b4a7ca86b79dd0904.tar.gz |
Strip quotes from format_type in addition to other characters
Fixed bug in PostgreSQL ENUM reflection where a case-sensitive, quoted name
would be reported by the query including quotes, which would not match a
target column during table reflection as the quotes needed to be stripped
off.
Fixes: #4323
Change-Id: I668f3acccc578e58f23b70c82d31d5c1ec194913
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index ad15cb0ea..7db26e4c0 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -2599,6 +2599,9 @@ class PGDialect(default.DefaultDialect): # with time zone, geometry(POLYGON), etc. attype = re.sub(r'\(.*\)', '', format_type) + # strip quotes from case sensitive enum names + attype = re.sub(r'^"|"$', '', attype) + # strip '[]' from integer[], etc. attype = attype.replace('[]', '') @@ -3128,7 +3131,6 @@ class PGDialect(default.DefaultDialect): 'labels': [enum['label']], } enums.append(enum_rec) - return enums def _load_domains(self, connection): |