diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-30 13:53:26 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-30 13:53:26 -0500 |
commit | 66773a8801a584d36b514e22a03d92d66fb2931b (patch) | |
tree | e891ac17418ddded7524e8a85f19b9c2a34a6d7b /lib/sqlalchemy/dialects | |
parent | 53e93d50caee40fa0873a16ec50a0e09996c8151 (diff) | |
download | sqlalchemy-66773a8801a584d36b514e22a03d92d66fb2931b.tar.gz |
- Fixed bug where values within an ENUM weren't escaped for single
quote signs. Note that this is backwards-incompatible for existing
workarounds that manually escape the single quotes. [ticket:2878]
Diffstat (limited to 'lib/sqlalchemy/dialects')
-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 8bcfcbf7c..b80f269c1 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1090,7 +1090,9 @@ class PGDDLCompiler(compiler.DDLCompiler): return "CREATE TYPE %s AS ENUM (%s)" % ( self.preparer.format_type(type_), - ",".join("'%s'" % e for e in type_.enums) + ", ".join( + self.sql_compiler.process(sql.literal(e), literal_binds=True) + for e in type_.enums) ) def visit_drop_enum_type(self, drop): |