From f0d2e599b60317fc27f64f0abe7d2af65fba7e7b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 9 Aug 2009 22:11:40 +0000 Subject: - PG: somewhat better support for % signs in table/column names; psycopg2 can't handle a bind parameter name of %(foobar)s however and SQLA doesn't want to add overhead just to treat that one non-existent use case. [ticket:1279] - MySQL: somewhat better support for % signs in table/column names; MySQLdb can't handle % signs in SQL when executemany() is used, and SQLA doesn't want to add overhead just to treat that one non-existent use case. [ticket:1279] --- lib/sqlalchemy/dialects/postgresql/base.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqlalchemy/dialects/postgresql') diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index fbba8221b..c89ae16bd 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -431,6 +431,10 @@ class PGIdentifierPreparer(compiler.IdentifierPreparer): value = value[1:-1].replace('""','"') return value + def _escape_identifier(self, value): + value = value.replace('"', '""') + return value.replace('%', '%%') + class PGInspector(reflection.Inspector): def __init__(self, conn): -- cgit v1.2.1