pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gouse <gkhaji@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: to_timestamp returns the incorrect result for the DST fall over time.
Date: Wed, 5 Jan 2011 03:10:49 -0800 (PST)
Message-ID: <1294225849286-3328589.post@n5.nabble.com> (raw)
In-Reply-To: <12763.1294165610@sss.pgh.pa.us>
References: <1294161425291-3327393.post@n5.nabble.com>
	<12763.1294165610@sss.pgh.pa.us>


Thanks Tom for the Update.
You are correct that there is not local date and time for that DST time
period as clocks jump to 2 A.M.

The problem i am seeing  here is that, we have a small stored procedure
written which will always take UTC time as parameter and should convert it
to local timestamp with time zone. Can you verify the sp pls and let me if I
am doing something wrong.

// snippet of the stored procedure...
CREATE OR REPLACE FUNCTION wf_to_timestamp("varchar")
  RETURNS timestamptz AS
$BODY$
  select to_timestamp($1,'YYYY-MM-DD HH24:MI:SS.MS')+ interval '1 hour' *
(extract(timezone from to_timestamp($1,'YYYY-MM-DD HH24:MI:SS.MS')) /
3600.0)
$BODY$
  LANGUAGE 'sql' VOLATILE;
ALTER FUNCTION wf_to_timestamp("varchar") OWNER TO postgres;

When I pass the UTC time '2010-03-28 01:00:03 243'  I should expect the
output to be '2010-03-28 02:00:03.243 + 01'  , instead I am getting the
result '2010-03-28 03:00:03.243 + 01'.

The store procedure works well for the UTC time starting from '2010-03-28
02:00:00 000'. The problem only lies for the UTC time period  from
'2010-03-28 01:00:00 000' to '2010-03-28 01:59:59 999'.

Can you verifiy this pls..?


Thanks,
Gouse













-- 
View this message in context: http://postgresql.1045698.n5.nabble.com/to-timestamp-returns-the-incorrect-result-for-the-DST-fall-o...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.



view thread (7+ messages)  latest in thread

Message-ID: <1294225849286-3328589.post@n5.nabble.com>
Permalink:  ../1294225849286-3328589.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1294225849286-3328589.post@n5.nabble.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: gkhaji@gmail.com
  Subject: Re: to_timestamp returns the incorrect result for the DST fall over time.
  In-Reply-To: <1294225849286-3328589.post@n5.nabble.com>
  References: <1294161425291-3327393.post@n5.nabble.com> <12763.1294165610@sss.pgh.pa.us> <1294225849286-3328589.post@n5.nabble.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