Re: BUG #6424: Possible error in time to seconds conversion
От | Bousche, Olaf |
---|---|
Тема | Re: BUG #6424: Possible error in time to seconds conversion |
Дата | |
Msg-id | CCE2F52233740340BEC5A710A26AFABC0549FD4F@nld1exchange.nlkrohne.krohnegroup.com обсуждение исходный текст |
Ответ на | Re: BUG #6424: Possible error in time to seconds conversion (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-bugs |
Thank you for the fast reply=0D =0D I was not sure this was some spurious result messing up my calculations.=0D If it is by design and consistent it does not present any problems for=0D me.=0D =0D For me the matter is closed.=0D =0D Olaf=0D =0D =0D =0D -----Original Message-----=0D From: Tom Lane [mailto:tgl@sss.pgh.pa.us] =0D Sent: Wednesday, 01 February, 2012 17:00=0D To: Bousche, Olaf=0D Cc: pgsql-bugs@postgresql.org=0D Subject: Re: [BUGS] BUG #6424: Possible error in time to seconds=0D conversion =0D =0D o.bousche@krohne.com writes:=0D > Should the query=0D =0D > select=0D > extract(epoch=0D > from cast('2012-01-01 14:30:1' as=0D > timestamp) -=0D > cast('1970-01-01 0:0:0' as=0D > timestamp))) - =0D > extract(epoch=0D > from (cast('2012-01-01 14:30:1' as=0D > timestamp)))=0D =0D > return 0 instead of 3600?=0D =0D Well, right now it's operating as designed, because extract(epoch,=0D timestamp without timezone) tries to rotate the timestamp from local=0D time to GMT so that "epoch 0" corresponds to midnight GMT 1970-01-01.=0D (I presume that you are in a GMT+1 timezone.)=0D =0D Changing that behavior is one of the possible solutions to the problem=0D being discussed over here:=0D http://archives.postgresql.org/pgsql-general/2012-01/msg00649.php=0D but I don't believe we have any consensus yet about whether that would=0D be a good idea.=0D =0D regards, tom lane=0D =0D =0D This message has been scanned for malware by Websense Hosted Email=0D Security.=0D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DISCLAIMER =3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =0D NOTE: The information transmitted in this email is for the person or entity= to which it is addressed: =0D it may contain information that is confidential and/or legally privileged. = =0D If you are not the intended recipient, please do not read, use, retransmit = or disseminate this information. =0D Although this email and any attachments are believed to be free of any viru= s, it is the responsibility =0D of the recipient to ensure that they are virus free. No responsibility is a= ccepted by the KROHNE Company =0D for any loss or damage arising from receipt of this message. =0D Furthermore, unless explicitly stated, this email is in no way a legally bi= nding agreement. =0D The views represented in this email do not necessarily represent those of t= he corporation. =0D
В списке pgsql-bugs по дате отправления: