Bug in tm2timestamp - Mailing list pgsql-hackers

From Magnus Hagander
Subject Bug in tm2timestamp
Date
Msg-id CABUevEx5zUO=KRUg06a9qnQ_e9EvTKscL6HxAM_L3xj71R7AQw@mail.gmail.com
Whole thread Raw
Responses Re: Bug in tm2timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
AFAICT, there's a bug in tm2timestamp(). You can't do this:

postgres=# select '1999-12-31T24:00:00'::timestamptz;
ERROR:  timestamp out of range: "1999-12-31T24:00:00"

But that's a perfectly legal date. It works fine for any other year -
and AFAICT this is because of the POSTGRES_EPOCH_JDATE being
2000-01-01.

The check in 1693 and forward comes with *result=0 and date=-1 in this
case, which AFAICT is fine.

I'm not entirely sure what that check is guarding against (which may
be because I just came off a flight from canada and don't really have
the brain in full gear ATM). Perhaps it just needs an extra exclusion
for this special case?

--Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/



pgsql-hackers by date:

Previous
From: Euler Taveira
Date:
Subject: Re: Materialized views WIP patch
Next
From: Pavan Deolasee
Date:
Subject: Re: Status of the startup process post end of recovery