Emmanuel Cecchet <[EMAIL PROTECTED]> writes:
> 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.
It's really not that hard.
> 1. CREATE TABLE TABLE1
org.POSTGRESQL.jdbc2.AbstractJdbc2DatabaseMetaData
public boolean supportsMixedCaseIdentifiers() throws SQLException
{
return false;
}
public boolean storesLowerCaseIdentifiers() throws SQLException
{
return true;
}
----> table1 <------
> 1. CREATE TABLE TABLE1
org.HSQLDB.jdbc.jdbcDatabaseMetaData
public boolean supportsMixedCaseIdentifiers() throws SQLException {
return false;
}
public boolean storesUpperCaseIdentifiers() throws SQLException {
return true;
}
-----> TABLE1 <------
> 2. CREATE TABLE "TABLE2"
(same code for both drivers)
/*
* Does the database treat mixed case quoted SQL identifiers as
* case sensitive and as a result store them in mixed case? A
* JDBC compliant driver will always return true.
*/
public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException {
return true;
}
----> TABLE2 <-----
See <https://forge.continuent.org/jira/browse/SEQUOIA-765>
_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia