Skip site navigation (1) Skip section navigation (2)

RE: RE: datetime fix

From: Peter Mount <petermount(at)maidstone(dot)gov(dot)uk>
To: Postgres interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: RE: RE: datetime fix
Date: 2000-10-25 14:02:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Comments prefixed by PM: due to using outlook...

Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount(at)maidstone(dot)gov(dot)uk
All views expressed within this email are not the views of Maidstone Borough

-----Original Message-----
From: Ken Kachnowich [mailto:khkachn(at)toad(dot)net]
Sent: Wednesday, October 25, 2000 12:10 AM
To: Cedar Cox; Postgres interfaces
Subject: Re: [INTERFACES] RE: datetime fix

I do a PreparedStatement and setTimestamp() to do the select.
The Timestamp value is converted into a String in the JDBC code.

This may not be a JDBC problem. I can not select by a datetime field
in psql all the time. It seems if the milliseconds are below some
value it works and if above not. .62 worked for me but .71 did not.
I did a copy and paste of the datetime value to get it right:

PM: Now this is really getting weird...

select * from table_a;

| fld1
|2000-10-24 10:15:01.71-04|

select * from table_a where fld1 = '2000-10-24 10:15:01.71';

0 records found 

I had to make a change to the JDBC code to even get the .62 select to
work. The Timestamp toString() method gives a 3 digit millisecond
value and Postgres seems to not want the leading zero (ie: .62 viz

PM: .62 and .062 should be two different numbers as its being represented as
a decimal second, not as a separate millisecond field.

I will try these with query=1 in pg_options to get the query.

PM: Can you let me know how this is going by Saturday. I'm not going to get
chance to do any work on JDBC before then (apart from replying the odd email
here). Thanks, Peter

pgsql-interfaces by date

Next:From: Thomas LockhartDate: 2000-10-25 14:41:33
Subject: Re: signals in ODBC?
Previous:From: Kovacs Zoltan SandorDate: 2000-10-25 12:18:00
Subject: signals in ODBC?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group