User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1
MonetDB's data source section in odbc.ini should provide an option for running a query every time a connection is opened.
Typical usage scenario:
Since ODBC does not support time zone information, the result of queries for timestamps depends on the session time zone of the connection. To make sure that all users retrieve the same values, we would like to fix the session time zone to UTC. A workaround is to fire a SET TIME ZONE query every time a session is created.
Client applications using ODBC should not need knowledge of the specifics of a database represented by an ODBC data source. Thus, client applications should not be forced to execute a (not standardized) statement such as SET TIME ZONE themselves.
The correct place for such a query would be in the configuration of the data source, i.e., in odbc.ini. Here, the logic for fixing the time zone is centralized instead of being scattered around different client applications.
Other databases such as MySQL and PostgreSQL (and probably many more) provide such an option in the odbc.ini file. Here is an excerpt of how a PostgreSQL data source looks like:
Driver = PostgreSQL ODBC Driver
Database = test_database
Servername = test_server
Port = 5432
Protocol = 8.3.9
ConnSettings = set time zone 'UTC';
I would like to see a similar option for MonetDB's ODBC driver.
A more generic solution is suggested in id=3426
I agree that the solution suggested in 3426 would indeed resolve my issue. Still, it would require appropriate rights (and syntax skills) on the database which my solution would not.