From b02b64675e0c10ecf10e9e0ee1b34cc6ec412d37 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 31 Aug 2006 23:26:30 +0000 Subject: [PATCH] pg formats sequence name, more quote test fixes --- lib/sqlalchemy/databases/postgres.py | 2 +- test/sql/quote.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index c7a03629d2..ff123ff00f 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -508,7 +508,7 @@ class PGSchemaGenerator(ansisql.ANSISchemaGenerator): def visit_sequence(self, sequence): if not sequence.optional and not self.engine.dialect.has_sequence(self.connection, sequence.name): - self.append("CREATE SEQUENCE %s" % sequence.name) + self.append("CREATE SEQUENCE %s" % self.preparer.format_sequence(sequence)) self.execute() class PGSchemaDropper(ansisql.ANSISchemaDropper): diff --git a/test/sql/quote.py b/test/sql/quote.py index 2d5132fb0b..6b38accbd9 100644 --- a/test/sql/quote.py +++ b/test/sql/quote.py @@ -37,11 +37,11 @@ class QuoteTest(PersistTest): {'d123':2,'u123':2,'MixedCase':3}, {'d123':4,'u123':3,'MixedCase':2}) - res1 = select([table1.c.lowercase, table1.c.UPPERCASE, table1.c.MixedCase, table1.c.ASC]).execute().fetchall() + res1 = select([table1.c.lowercase, table1.c.UPPERCASE, table1.c.MixedCase, table1.c.a123]).execute().fetchall() print res1 assert(res1==[(1,2,3,4),(2,2,3,4),(4,3,2,1)]) - res2 = select([table2.c.desc, table2.c.Union, table2.c.MixedCase]).execute().fetchall() + res2 = select([table2.c.d123, table2.c.u123, table2.c.MixedCase]).execute().fetchall() print res2 assert(res2==[(1,2,3),(2,2,3),(4,3,2)]) -- 2.47.2