]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
pg formats sequence name, more quote test fixes
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 31 Aug 2006 23:26:30 +0000 (23:26 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 31 Aug 2006 23:26:30 +0000 (23:26 +0000)
lib/sqlalchemy/databases/postgres.py
test/sql/quote.py

index c7a03629d2a03ca5bd2d0adda37a922f76f7ede8..ff123ff00faa48d34e8569a2780fd044fb2e16f4 100644 (file)
@@ -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):
index 2d5132fb0bdd9ea35a3156f733e532ae04a0e876..6b38accbd9f9fcc0269ccc8f4bedd1d086abbf6f 100644 (file)
@@ -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)])