Jorge could you add this to http://trac.turbogears.org/turbogears/wiki/SQLObjectReservedWords

I think it will be a good idea to have an explanation if why this is need to be taken into account.

On 4/20/06, Jorge Godoy < [EMAIL PROTECTED]> wrote:

Em Quinta 20 Abril 2006 20:01, Robin Haswell escreveu:

> I'm not sure if case folding applies to this. All that should be necessary
> is adding backticks (or equivalents - maybe) around table/column names.

In PostgreSQL if you use quotes you have to use the exact same case that was
used to create the table.  If you don't, names will be converted to lower
case.  In Oracle if you don't use quotes names will be converted to upper
case.

If you create a table like this "Test" then you can't access it like "test" or
"TEST" in PostgreSQL, for example.  On the other hand, if you create it like
Test, then it will be converted to test and you can access it as test, Test,
TEST, teST, TeST, etc.  All without quotes, of course.  If you try accessing
it as "Test" (with quotes), it will fail.

Now, imagine it in an database that is used by several applications in, lets
say, 3 different languages.  Several different teams coding, etc.  If you
enforce the use of quotes in one of these apps, *all* of them will have to
use quotes to maintain compatibility and there will have to be some internal
documentation on how to name tables and columns.  If you don't use quotes,
then it doesn't matter if team A writes "select ThisColumn from TableA" and
team B writes "select thiscolumn from tablea" since both will succeed.

There is much more to consider than just the presence or absence of quotes,
backticks, etc. here.  It is easy to think in a new application used by only
one team but it is a very narrow minded approach to a database that can be
shared by several applications and several teams in different programming
languages.

--
Jorge Godoy      < [EMAIL PROTECTED]>




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to