pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Byron Nikolaidis <byronn@insightdist.com>
To: Hannu Krosing <hannu@trust.ee>
To: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgreSQL.org>
Subject: Re: ODBC driver and Dates
Date: Thu, 16 Apr 1998 15:11:29 -0400
Message-ID: <353657E1.5955C81C@insightdist.com> (raw)
References: <199804160750.RAA27706@mustang.sdc.com.au>
	<3535FD96.DF9F603F@sid.trust.ee>

Hello,

Yes it is true that there should be something done about supporting other date
styles.  In making the driver be able to handle all the odbc conversions of
date, time, and timestamp, assumptions were made about what format they were in.

It would be relatively easy to modify this to allow for other styles.

Should the driver query the database (i.e., "show datestyle") to see what format
it should use, -OR-, should it be an option for the datasource, where you select
what style to use, and the driver sets the style when it makes a connection
("set datestyle")?

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.

Byron

P.S., Please send these notes to the pgsql-interfaces@postgreSQL.org list so
that everyone can read them, including me.


Hannu Krosing wrote:

> Stephen Davies wrote:
> >
> > >       The driver at
> > > > http://www.insightdist.com/download/
> > > > works great. Very well done and much quicker than previous drivers.
> > > >
> > > > I have had a couple of problems though. The problems seem to be with
> >
> > G'day all.
> >
> > I too have had good success with this driver except for one MAJOR problem:
> >
> > it does not seem to handle date fields at all well.
>
> To get a uniform date access across different databases one should
> first issue a query like "set DateStyle to 'ISO'" or some other that the
> driver is developed for
>
> I routinely do it always when accessin PostgreSQL. I think it would be
> nice of the driver to always start the session by settin the DateStyle
> to some known value
>
> Does it not do that already?
>
>
> Hannu






view thread (12+ messages)  latest in thread

Message-ID: <353657E1.5955C81C@insightdist.com>
Permalink:  ../353657E1.5955C81C@insightdist.com/
Also on:    postgresql.org/message-id/353657E1.5955C81C@insightdist.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: byronn@insightdist.com, hannu@trust.ee
  Subject: Re: ODBC driver and Dates
  In-Reply-To: <353657E1.5955C81C@insightdist.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox