pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 甄明洋 <zhenmingyang@yeah.net>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Aleksander Alekseev <a.alekseev@postgrespro.ru>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re:Re:  Re: [BUGS] Return value error of‘to_timestamp’
Date: Wed, 17 Aug 2016 19:06:14 +0800 (CST)
Message-ID: <6144af7f.1d1e.156982e1e21.Coremail.zhenmingyang@yeah.net> (raw)
In-Reply-To: <CAKFQuwa1eWdO-7Y-uqRTGrdwj0H=N6iz5dLohLy7BCeLG3=qrw@mail.gmail.com>
References: <379c479a.f0c.15653e44bba.Coremail.zhenmingyang@yeah.net>
	<CAKFQuwYMf7Xb9yqwTMcJ67-+r7V88NkR=wKpskFM6Hykm4ZhZQ@mail.gmail.com>
	<20160804180309.28bd486a@fujitsu>
	<CAKFQuwa1eWdO-7Y-uqRTGrdwj0H=N6iz5dLohLy7BCeLG3=qrw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Thank you very much !

I have another question for datetime type, it is GUC parameter 'timezone' , example as follow:


postgres=# set timezone='-08:00';
SET
postgres=# show timezone;
 TimeZone 
----------
 -08:00
(1 row)


postgres=# select timestamptz'1990-1-1 11:11:11.123 -08:00' ;
        timestamptz         
----------------------------
 1990-01-02 03:11:11.123+08
(1 row)


postgres=# select timestamptz'1990-1-1 11:11:11.123 +08:00' ;
        timestamptz         
----------------------------
 1990-01-01 11:11:11.123+08
(1 row)


postgres=# 


   this looks like, the sign  plus and minus are inverted, i dont understand why?




在 2016-08-04 23:06:40,"David G. Johnston" <david.g.johnston@gmail.com> 写道:

On Thu, Aug 4, 2016 at 11:03 AM, Aleksander Alekseev <a.alekseev@postgrespro.ru> wrote:

>> postgres=# select to_timestamp('1990-1-1 11:11:11.123456789',
>> 'YYYY-MM-DD HH24:MI:SS.US'); to_timestamp
>> -------------------------------
>>  1990-01-01 11:13:14.456789+08
>> (1 row)
>> postgres=#

> Working as designed...

Maybe it means that current design is poor. However since this behavior
is documented there are users who might depend on it. So I doubt it
will be changed any time soon.

Though I wonder maybe we should consider introducing a new set of
time-related procedures with different behavior (to_timestamp_strict?),
that would be more obvious to users.



Discussions ongoing...
an archive search should be fruitful.


David J.
 

view thread (10+ messages)  latest in thread

Message-ID: <6144af7f.1d1e.156982e1e21.Coremail.zhenmingyang@yeah.net>
Permalink:  ../6144af7f.1d1e.156982e1e21.Coremail.zhenmingyang@yeah.net/
Also on:    postgresql.org/message-id/6144af7f.1d1e.156982e1e21.Coremail.zhenmingyang@yeah.net

 · 

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: zhenmingyang@yeah.net, david.g.johnston@gmail.com, a.alekseev@postgrespro.ru
  Subject: Re: [BUGS] Return value error of‘to_timestamp’
  In-Reply-To: <6144af7f.1d1e.156982e1e21.Coremail.zhenmingyang@yeah.net>
  References: <379c479a.f0c.15653e44bba.Coremail.zhenmingyang@yeah.net> <CAKFQuwYMf7Xb9yqwTMcJ67-+r7V88NkR=wKpskFM6Hykm4ZhZQ@mail.gmail.com> <20160804180309.28bd486a@fujitsu> <CAKFQuwa1eWdO-7Y-uqRTGrdwj0H=N6iz5dLohLy7BCeLG3=qrw@mail.gmail.com> <6144af7f.1d1e.156982e1e21.Coremail.zhenmingyang@yeah.net>

* 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