Hi Guillaume,

That was not my point. I was not talking about the case but about the
quotes/backticks. We should be consistent about what we store in the
DatabaseSchema IMHO to be sure the behaviour is the same when we
create the table through Sequoia and when we restart the controller.
It's not the case currently.
The problem if that if you execute:
1. CREATE TABLE TABLE1 ...
2. CREATE TABLE "TABLE2" ...

If I try to extract the table name from the statements I will get TABLE1 and TABLE2, however if I fetch the schema from Postgres I will get table1 and TABLE2. If I do that with HSQL I will get all names uppercase.

So it is hard to know if the name used in the statement will be exactly the same as the one that will be provided by the database at controller restart. The only way to be sure is to refetch the name from the database but this is a costly operation.
For the case, we rely on the fact that the user has a logical
database. Because for example, PostgreSQL is not case sensitive _or_
case insensitive, it's both. It's case insensitive _only if_ we don't
quote the identifiers. So if a user has "TabLe" and "tAbLe" and table
which he called by using TaBlE, we'll probably have problems. This is
probably acceptable anyway.

I'm not sure but I think there can be problems with schemas too if we
have two tables with the same names in 2 different schemas.
If you have a table with the same name in 2 different schemas, then you are always forced to reference the table with its schema prefix so that the database can eliminate any ambiguity. If you don't do so, the database will systematically reject the query with an 'ambiguous table name' error message.

What do you think?
Emmanuel

--
Emmanuel Cecchet
Chief Scientific Officer, Continuent

Blog: http://emanux.blogspot.com/
Open source: http://www.continuent.org
Corporate: http://www.continuent.com
Skype: emmanuel_cecchet
Cell: +33 687 342 685


_______________________________________________
Sequoia mailing list
Sequoia@lists.forge.continuent.org
https://forge.continuent.org/mailman/listinfo/sequoia

Reply via email to