Re: [INTERFACES] Re: ODBC driver and Dates - Mailing list pgsql-interfaces

From Stephen Davies
Subject Re: [INTERFACES] Re: ODBC driver and Dates
Date
Msg-id 199804170914.SAA29622@mustang.sdc.com.au
Whole thread Raw
In response to Re: ODBC driver and Dates  (Hannu Krosing <hannu@trust.ee>)
List pgsql-interfaces
> > HERE IS A POSSIBLY USEFUL BUT UNDOCUMENTED FEATURE OF THE NEW ODBC DRIVER:
> >
> > By the way, there is a feature in this driver that allows you to send simple
> > commands to the driver at connection time.  Its registry key is 'ConnSettings'
> > and it can be on a driver level or datasource level, or both.
> >
> > Here is an example, if you had a datasource called 'co1', then in the registry
> > under the HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\co1 you would create a String
> > Value called 'ConnSettings' which can contain a list of commands, separated by
> > semicolans, to send to Postgres on a successful connection.  Example, "set geqo
> > to 'off'; set datestyle to 'ISO' "
> >
> > You can also set this on a driver level so that for any datasource these
> > commands would be set.  That key is
> > HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL
> > and it is also called 'ConnSettings'.
> >
> > It will first send the driver 'ConnSettings' (if any) followed by the datasource
> > 'ConnSettings' (if any).
> >
> > This feature has its limitations.   For example, it can only handle commands;
> > not queries that would generate tuples.
>
> Well, that is a useful feature indeed, and I think that this will solve
> the whole problem without changing the driver code. But the install
> script
> should set this to "set Datestyle to 'US';" for all of us poor
> non-americans
> (and it would'nt hurt those who use the US dates neither).
>
> > P.S., Please send these notes to the pgsql-interfaces@postgreSQL.org list so
> > that everyone can read them, including me.
>

Ahah!! A whole new ball game:-))

This indeed sounds very good.

The caveat is that "we poor dumb users" should not need/be allowed to fiddle
with the registry.

Something like an "Advanced Features" button on the DSN definition form that
allowed the entry of these commands would be an excellent feature I reckon.

It even fits into the ODBC model as these can be seen as "connection
attributes" that are being externalised for apps such as MS Query that have no
other mechanism for setting such attributes.

Cheers,
Strephen
========================================================================
Stephen Davies Consulting                                            scldad@sdc.com.au
Adelaide, South Australia.                                             Voice: 61-8-82728863
Computing & Network solutions.                                     Fax: 61-8-82741015



pgsql-interfaces by date:

Previous
From: "Antonio Garcia Mari"
Date:
Subject: ODBC Driver and password auth.
Next
From: "Dario Fumagalli"
Date:
Subject: Re: Possible bugs in ODBC driver