]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
since casing is figured out quasi-automatically when creating table/column/etc,
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 31 Aug 2006 23:58:34 +0000 (23:58 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 31 Aug 2006 23:58:34 +0000 (23:58 +0000)
removed casing checks within pg reflection

lib/sqlalchemy/ansisql.py
lib/sqlalchemy/databases/postgres.py

index f810b0d03f3206dc1cd571804e78d5cfdc6cc5c7..d65e8ad338f60b1ad9a56df474bccda2b6c9cf7a 100644 (file)
@@ -836,6 +836,9 @@ class ANSIIdentifierPreparer(schema.SchemaVisitor):
     def should_quote(self, object):
         return object.quote or self._requires_quotes(object.name, object.case_sensitive) 
  
+    def is_natural_case(self, object):
+        return object.quote or self._requires_quotes(object.name, object.case_sensitive)
+        
     def format_sequence(self, sequence):
         return self.__prepare_sequence(sequence)
         
index ff123ff00faa48d34e8569a2780fd044fb2e16f4..8234d96f060ea02f02cc2a555f4858b27b8a3d7b 100644 (file)
@@ -339,7 +339,6 @@ class PGDialect(ansisql.ANSIDialect):
                     break
                 found_table = True
                 name = row['attname']
-                natural_case = preparer._is_natural_case(name)
                 ## strip (30) from character varying(30)
                 attype = re.search('([^\(]+)', row['format_type']).group(1)
     
@@ -372,7 +371,7 @@ class PGDialect(ansisql.ANSIDialect):
                 colargs= []
                 if default is not None:
                     colargs.append(PassiveDefault(sql.text(default)))
-                table.append_item(schema.Column(name, coltype, nullable=nullable, case_sensitive=not natural_case, *colargs))
+                table.append_item(schema.Column(name, coltype, nullable=nullable, *colargs))
     
     
             if not found_table:
@@ -434,17 +433,14 @@ class PGDialect(ansisql.ANSIDialect):
                 referred_table = preparer._unquote_identifier(referred_table)
                 referred_columns = [preparer._unquote_identifier(x) for x in f.search(referred_columns).groups() if x]
                 
-                natural_case = preparer._is_natural_case(referred_table)
-                
                 refspec = []
                 if referred_schema is not None:
-                    natural_case_schema = preparer._is_natural_case(referred_schema)
                     schema.Table(referred_table, table.metadata, autoload=True, schema=referred_schema, 
-                                autoload_with=connection, case_sensitive= not natural_case, case_sensitive_schema = not natural_case_schema)
+                                autoload_with=connection)
                     for column in referred_columns:
                         refspec.append(".".join([referred_schema, referred_table, column]))
                 else:
-                    schema.Table(referred_table, table.metadata, autoload=True, autoload_with=connection, case_sensitive=not natural_case)
+                    schema.Table(referred_table, table.metadata, autoload=True, autoload_with=connection)
                     for column in referred_columns:
                         refspec.append(".".join([referred_table, column]))
                 
@@ -553,7 +549,5 @@ class PGIdentifierPreparer(ansisql.ANSIIdentifierPreparer):
         if value[0] == self.initial_quote:
             value = value[1:-1].replace('""','"')
         return value
-    def _is_natural_case(self, value):
-        return self._fold_identifier_case(value) == value
     
 dialect = PGDialect