On Apr 21, 2008, at 11:25 AM, Jason R. Coombs wrote:

>
> I think you mean the "quote" kwarg.
>
> I also agree that this is misleading.
>
> I would also like to mention that I have run into a similar mixed-case
> problem, and if the quote= argument was used for Oracle and PostgreSQL
> table names, it would resolve my problem.
>
> The problem is that I'm working with a schema that was created through
> manual sql scripts that have mixed case:
>
> CREATE TABLE MyTable (...)
>
> In Oracle, this creates MYTABLE.  In PostgreSQL, this creates
> mytable.  In MSSQL, this creates MyTable.
>
> Because of this discrepancy, it's impossible to create a SQLAlchemy
> model that works with all three databases.  Michael's suggestion to
> "use all lowercase" only works for PostgreSQL/Oracle, but breaks in
> MSSQL.

The above statement, since it does not use quotes, intends to create a  
table with a case-insensitive name.  Therefore, in SQLAlchemy you  
indicate "case-insensitive" by using an all-lower case table name.  If  
the above statement happens to have the effect on MS-SQL that the  
table is created with a case sensitive name, the the CREATE TABLE  
statement must be adjusted so that it creates a table that is case- 
insensitive on all databases.   Otherwise you have inconsistent case- 
sensitivity which is no different than having inconsistent table or  
column names.

The quote=True flag has nothing to do with case sensitivity - its only  
intended as a way to get "emergency" quoting for a reserved word that  
SQLA doesn't yet know about.

>
>
> This is related to Ticket #1012 (http://www.sqlalchemy.org/trac/ 
> ticket/
> 1012), which describes the symptom encountered in the MSSQL case.

this ticket has to do with reflecting foreign keys.  So its not  
"directly" related here since reflection only talks about an alternate  
way of defining the elements of a Table.

> This is an ongoing issue for me.  Any suggestions are appreciated.

use consistent case-insensitivity - all lower case names for your  
table and column names (or use consistent case-sensitivity if you  
choose).  We have many hundreds of unit tests, using case insensitive  
as well as case sensitive names,  that work across all databases  
without issue.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to