Thank you for the fast reply

I was not sure this was some spurious result messing up my calculations.
If it is by design and consistent it does not present any problems for
me.

For me the matter is closed.

Olaf



-----Original Message-----
From: Tom Lane [mailto:t...@sss.pgh.pa.us] 
Sent: Wednesday, 01 February, 2012 17:00
To: Bousche, Olaf
Cc: pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #6424: Possible error in time to seconds
conversion 

o.bous...@krohne.com writes:
> Should the query

> select
>   extract(epoch
>     from cast('2012-01-01 14:30:1' as
>              timestamp) -
>          cast('1970-01-01 0:0:0' as
>               timestamp))) - 
>   extract(epoch
>     from (cast('2012-01-01 14:30:1' as
>               timestamp)))

> return 0 instead of 3600?

Well, right now it's operating as designed, because extract(epoch,
timestamp without timezone) tries to rotate the timestamp from local
time to GMT so that "epoch 0" corresponds to midnight GMT 1970-01-01.
(I presume that you are in a GMT+1 timezone.)

Changing that behavior is one of the possible solutions to the problem
being discussed over here:
http://archives.postgresql.org/pgsql-general/2012-01/msg00649.php
but I don't believe we have any consensus yet about whether that would
be a good idea.

                        regards, tom lane


 This message has been scanned for malware by Websense Hosted Email
Security.
====================================== DISCLAIMER 
=================================== 
NOTE: The information transmitted in this email is for the person or entity to 
which it is addressed: 
it may contain information that is confidential and/or legally privileged. 
If you are not the intended recipient, please do not read, use, retransmit or 
disseminate this information. 
Although this email and any attachments are believed to be free of any virus, 
it is the responsibility 
of the recipient to ensure that they are virus free. No responsibility is 
accepted by the KROHNE Company 
for any loss or damage arising from receipt of this message. 
Furthermore, unless explicitly stated, this email is in no way a legally 
binding agreement. 
The views represented in this email do not necessarily represent those of the 
corporation. 


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to