After experimenting with DATABASE_TO_UPPER a bit more I realize it does 
what we need, i.e. this all works:

   create table CI_Sessions (id int);
   insert into ci_sessions (id) values (1);
   select * from "ci_sessions";

How do we set that option on a PgServer connection?

Cheers,
    Peter


On Thursday, October 13, 2016 at 3:59:01 PM UTC+10, Peter Becker wrote:
>
> Sorry - I just realized there is 
> https://groups.google.com/forum/#!topic/h2-database/bg_dGVT_XbA already.
>
> Given how quiet that has been I assume the feature doesn't exist. Can 
> anyone give me an idea of how hard it would be to implement?
>
> Cheers,
>    Peter
>
>
> On Thursday, October 13, 2016 at 3:43:21 PM UTC+10, Peter Becker wrote:
>>
>> Hello all,
>>
>> we are trying to do something a bit more unusual: use the PostgreSQL wire 
>> protocol to talk to H2 as if it is a SQL Server. The reason behind that is 
>> that we are migrating from PHP to Java and want to run integration tests on 
>> top of H2. PHP seems to be capable of connecting to H2's PgServer via it's 
>> Postgres driver, so this seems a viable approach to manage the database 
>> state.
>>
>> The issue we are facing is that the PHP code uses the table names in 
>> different capitalizations compared to the database schema. SQL Server is 
>> case-preserving, case-insensitive when it comes to table names (no matter 
>> if the table name is quoted or not). This way it works in production, but 
>> it doesn't work with H2. The queries the PHP code generates look like this:
>>
>>      INSERT INTO "ci_sessions" ("session_id", "ip_address", "user_agent", 
>> "last_activity", "user_data") VALUES ('e1a0a3cd8e2aa1473aac3c0a8b2c0237', 
>> '127.0.0.1', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, 
>> like Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.14', 1476334111, 
>> '')
>>
>> This table is actually named "CI_Sessions", H2 produces "ERROR: Table 
>> "ci_sessions" not found".
>>
>> Is there an option to make H2 case insensitive on the table names? The 
>> MSSQLServer mode doesn't seem to trigger a change in this regard. 
>>
>> Also: how do we control options on the PgServer connections? The syntax 
>> using semicolons to append the options is something at least the psql 
>> command line tool doesn't like.
>>
>> Cheers,
>>     Peter
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to