pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
date/time out of range
8+ messages / 5 participants
[nested] [flat]

* date/time out of range
@ 2011-01-18 04:00  Colin Taylor <colin.taylor@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Colin Taylor @ 2011-01-18 04:00 UTC (permalink / raw)
  To: pgsql-jdbc

This error confuses me:

10127 Caused by: org.postgresql.util.PSQLException: ERROR: date/time
field value out of range: "2011-01-12 21:30:00.000000 +13:00:00"

The date appears to be  valid,

 smx3_mailreport=# select timestamp '2011-01-12 21:30:00.000000 +13:00:00';
      timestamp
---------------------
 2011-01-12 21:30:00
(1 row)


I cant see how any session paramater would affect this?

OSX - Postgres 8.4.4 , jdbc 8.4.702



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: date/time out of range
@ 2011-01-18 04:20  Oliver Jowett <oliver@opencloud.com>
  parent: Colin Taylor <colin.taylor@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Oliver Jowett @ 2011-01-18 04:20 UTC (permalink / raw)
  To: Colin Taylor <colin.taylor@gmail.com>; +Cc: pgsql-jdbc

On 18/01/11 17:00, Colin Taylor wrote:
> This error confuses me:
>
> 10127 Caused by: org.postgresql.util.PSQLException: ERROR: date/time
> field value out of range: "2011-01-12 21:30:00.000000 +13:00:00"

You should show us the code that generates this error, and your schema.

Oliver



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: date/time out of range
@ 2011-01-18 05:15  Oliver Jowett <oliver@opencloud.com>
  parent: Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Oliver Jowett @ 2011-01-18 05:15 UTC (permalink / raw)
  To: Colin Taylor <colin.taylor@gmail.com>; pgsql-jdbc

Please remember to cc: the list when you reply.

On 18/01/11 18:01, Colin Taylor wrote:
> On Tue, Jan 18, 2011 at 5:20 PM, Oliver Jowett<oliver@opencloud.com>  wrote:
>> On 18/01/11 17:00, Colin Taylor wrote:
>>>
>>> This error confuses me:
>>>
>>> 10127 Caused by: org.postgresql.util.PSQLException: ERROR: date/time
>>> field value out of range: "2011-01-12 21:30:00.000000 +13:00:00"
>>
>> You should show us the code that generates this error, and your schema.
>>
>> Oliver
>>
>
> select id, name, address_type_id, default_timezone, customer_ref,
> from_date from domain where
> (from_date<= '2011-01-12 21:30:00.000000 +13:00:00' or from_date is
> null) and (thru_date is null or
> thru_date>  '2011-01-12 21:30:00.000000 +13:00:00')   and
> address_type_id = '10' and name in ('ALL','<>');

Well.. that's not JDBC code, is it? If I run that in psql against 8.4.5, 
it runs just fine and I see no error. How do you actually construct and 
execute that query via JDBC?

We need a selfcontained test case that compiles and runs "out of the 
box" showing the problem. Otherwise I don't think anyone can help you here.

Oliver



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: date/time out of range
@ 2011-01-18 05:29  Samuel Gendler <sgendler@ideasculptor.com>
  parent: Oliver Jowett <oliver@opencloud.com>
  0 siblings, 2 replies; 8+ messages in thread

From: Samuel Gendler @ 2011-01-18 05:29 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: Colin Taylor <colin.taylor@gmail.com>; pgsql-jdbc

On Mon, Jan 17, 2011 at 9:15 PM, Oliver Jowett <oliver@opencloud.com> wrote:

> Please remember to cc: the list when you reply.
>
> On 18/01/11 18:01, Colin Taylor wrote:
>
>> On Tue, Jan 18, 2011 at 5:20 PM, Oliver Jowett<oliver@opencloud.com>
>>  wrote:
>>
>>  On 18/01/11 17:00, Colin Taylor wrote:
>>>
>>>>
>>>> This error confuses me:
>>>>
>>>> 10127 Caused by: org.postgresql.util.PSQLException: ERROR: date/time
>>>> field value out of range: "2011-01-12 21:30:00.000000 +13:00:00"
>>>>
>>>
>>>
Is there a +13:00:00 timezone or does that wind up crossing the date line?
If Java has no mechanism for converting that time zone to whatever date/time
type it is trying to convert to, the exception would make sense.

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: date/time out of range
@ 2011-01-18 06:01  Oliver Jowett <oliver@opencloud.com>
  parent: Samuel Gendler <sgendler@ideasculptor.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Oliver Jowett @ 2011-01-18 06:01 UTC (permalink / raw)
  To: Samuel Gendler <sgendler@ideasculptor.com>; +Cc: Colin Taylor <colin.taylor@gmail.com>; pgsql-jdbc

Samuel Gendler wrote:

> Is there a +13:00:00 timezone or does that wind up crossing the date 
> line? If Java has no mechanism for converting that time zone to whatever 
> date/time type it is trying to convert to, the exception would make sense.

+1300 is fine (NZ in summer - I'm there now!)
The Chatham Islands are even further east while still on the same side 
of the dateline, they're +1345 at the moment.

Older server versions had problems with timezones beyond +1200, but that 
was fixed ages ago (7.x era)

Oliver



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: date/time out of range
@ 2011-01-18 16:10  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Samuel Gendler <sgendler@ideasculptor.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Tom Lane @ 2011-01-18 16:10 UTC (permalink / raw)
  To: Samuel Gendler <sgendler@ideasculptor.com>; +Cc: Oliver Jowett <oliver@opencloud.com>; Colin Taylor <colin.taylor@gmail.com>; pgsql-jdbc

Samuel Gendler <sgendler@ideasculptor.com> writes:
>> On 18/01/11 17:00, Colin Taylor wrote:
>>> 10127 Caused by: org.postgresql.util.PSQLException: ERROR: date/time
>>> field value out of range: "2011-01-12 21:30:00.000000 +13:00:00"

> Is there a +13:00:00 timezone or does that wind up crossing the date line?
> If Java has no mechanism for converting that time zone to whatever date/time
> type it is trying to convert to, the exception would make sense.

The weird thing is that the message appears to be a server-side error;
at least it exactly matches the spelling of one server error.  But I
don't understand how come it occurs only from JDBC and not in psql.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: date/time out of range
@ 2011-01-18 20:36  Colin Taylor <colin.taylor@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 8+ messages in thread

From: Colin Taylor @ 2011-01-18 20:36 UTC (permalink / raw)
  To: pgsql-jdbc

Oops I'm an idiot of course this is server side only.

For more background I'm running a java log processing system using
straight JDBC, I will get logs error out occasionally with this error
and then rerun them and its all good! As the process is multi-threaded
runs aren't idempotent but this particular query would always occur.

I cant reproduce this problem on redhat only OSX so its good that I
dont get in production only on my dev box..


On Wed, Jan 19, 2011 at 5:10 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Samuel Gendler <sgendler@ideasculptor.com> writes:
>>> On 18/01/11 17:00, Colin Taylor wrote:
>>>> 10127 Caused by: org.postgresql.util.PSQLException: ERROR: date/time
>>>> field value out of range: "2011-01-12 21:30:00.000000 +13:00:00"
>
>> Is there a +13:00:00 timezone or does that wind up crossing the date line?
>> If Java has no mechanism for converting that time zone to whatever date/time
>> type it is trying to convert to, the exception would make sense.
>
> The weird thing is that the message appears to be a server-side error;
> at least it exactly matches the spelling of one server error.  But I
> don't understand how come it occurs only from JDBC and not in psql.
>
>                        regards, tom lane
>



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: date/time out of range
@ 2011-01-19 17:37  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Colin Taylor <colin.taylor@gmail.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Maciek Sakrejda @ 2011-01-19 17:37 UTC (permalink / raw)
  To: Colin Taylor <colin.taylor@gmail.com>; +Cc: pgsql-jdbc

> Oops I'm an idiot of course this is server side only.

You showed a successful parsing of the very same timestamp through
psql in your original message--was that on the production server? Does
that exact statement fail through psql on your OS X box? If not, then
it does seem to be jdbc related, no? Can you capture protocol traffic
through DriverManager.setLogWriter() and setting loglevel in the jdbc
URL to help track this down?

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2011-01-19 17:37 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18 04:00 date/time out of range Colin Taylor <colin.taylor@gmail.com>
2011-01-18 04:20 ` Oliver Jowett <oliver@opencloud.com>
2011-01-18 05:15   ` Oliver Jowett <oliver@opencloud.com>
2011-01-18 05:29     ` Samuel Gendler <sgendler@ideasculptor.com>
2011-01-18 06:01       ` Oliver Jowett <oliver@opencloud.com>
2011-01-18 16:10       ` Tom Lane <tgl@sss.pgh.pa.us>
2011-01-18 20:36         ` Colin Taylor <colin.taylor@gmail.com>
2011-01-19 17:37           ` Maciek Sakrejda <msakrejda@truviso.com>

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