Re: R: Date types in where clause of PreparedStatement - Mailing list pgsql-general

From Eric G. Miller
Subject Re: R: Date types in where clause of PreparedStatement
Date
Msg-id 20010301194019.B25090@calico.local
Whole thread Raw
In response to R: Date types in where clause of PreparedStatement  ("Paolo Sinigaglia" <sini@informativesystem.it>)
List pgsql-general
On Thu, Mar 01, 2001 at 05:33:21PM +0100, Paolo Sinigaglia wrote:
>
> >Can anybody show any reason why the code using a prepared
> > statement with a where clause using a date won't find any records
> > on PostgreSQL but WILL work using Access and the jdbc-odbc
> > bridge?
>
>
> Assuming you are running PostgreSQL on a *nix machine and the odbc client on
> a Win* different machine, couldn't be a problem of different locale
> settings?
>
> Using Delphi BDE I had **a lot** of troubles on an all-windows-98 network
> because of different locale settings among the clients. First in all,
> day-month swapping in dates (dd-mm-yyyy and mm-dd-yyyy formats mixed through
> the network).

Make all dates ISO format and life should be good.  I think MS Access
does something like that for ODBC.  So, yyyy-mm-dd ('2001-03-01') or
dd-MMM-yyyy ('01-Mar-2001'), are good candidates.  For time as well:

yyyy-mm-dd hh:mm[:ss[-hh[mm]]]  '2001-03-01 23:42:58-0800'

Always having year first makes a good heuristic that date/time is in ISO
format, and there's no question that each successive part represents a
decreasing date/time part.

--
Eric G. Miller <egm2@jps.net>

pgsql-general by date:

Previous
From: Frank Miles
Date:
Subject: Re: Users in pg_shadow
Next
From: oberpwd@anubis.network.com (Wade D. Oberpriller)
Date:
Subject: EXECUTE in PLPGSQL