pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15389: Fill zero in milliseconds of a timestamp
4+ messages / 4 participants
[nested] [flat]

* BUG #15389: Fill zero in milliseconds of a timestamp
@ 2018-09-18 11:44  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: PG Bug reporting form @ 2018-09-18 11:44 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: taddeoluca96@gmail.com

The following bug has been logged on the website:

Bug reference:      15389
Logged by:          Luca Taddeo
Email address:      taddeoluca96@gmail.com
PostgreSQL version: 9.6.10
Operating system:   Windows 7 Service Pack 2
Description:        

if I try to convert a string "2014-09-26 17:17:45.990" into timestamp become
"2014-09-26 17:17:45.99"
I don't think is correct because if I try to convert in Java become 099.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15389: Fill zero in milliseconds of a timestamp
@ 2018-09-18 11:59  Sergei Kornilov <sk@zsrv.org>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Sergei Kornilov @ 2018-09-18 11:59 UTC (permalink / raw)
  To: taddeoluca96@gmail.com <taddeoluca96@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Hello

> I don't think is correct because if I try to convert in Java become 099.
"2014-09-26 17:17:45.099"?
I think Java is incorrect here. Usually trailing zeros can be omitted.
Also postgresql timestamp has resolution 1 microsecond, so with trailing zeros it must be "2014-09-26 17:17:45.990000", not "2014-09-26 17:17:45.990".

regards, Sergei




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15389: Fill zero in milliseconds of a timestamp
@ 2018-09-18 13:17  David G. Johnston <david.g.johnston@gmail.com>
  parent: Sergei Kornilov <sk@zsrv.org>
  0 siblings, 1 reply; 4+ messages in thread

From: David G. Johnston @ 2018-09-18 13:17 UTC (permalink / raw)
  To: Sergei Kornilov <sk@zsrv.org>; +Cc: taddeoluca96@gmail.com <taddeoluca96@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

On Tuesday, September 18, 2018, Sergei Kornilov <sk@zsrv.org> wrote:

> Hello
>
> > I don't think is correct because if I try to convert in Java become 099.
> "2014-09-26 17:17:45.099"?
> I think Java is incorrect here. Usually trailing zeros can be omitted.
> Also postgresql timestamp has resolution 1 microsecond, so with trailing
> zeros it must be "2014-09-26 17:17:45.990000", not "2014-09-26
> 17:17:45.990".
>

Except the decimal in that construct is a simple part separator and not a
fractional indicator.  You cannot drop trailing zeros in the last part in
the same way you cannot drop trailing zeros when describing one hundred
(100) because if you do you get the number one (1) instead.

David J.
.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15389: Fill zero in milliseconds of a timestamp
@ 2018-09-18 13:30  Andrew Gierth <andrew@tao11.riddles.org.uk>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Andrew Gierth @ 2018-09-18 13:30 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Sergei Kornilov <sk@zsrv.org>; taddeoluca96\@gmail.com <taddeoluca96@gmail.com>; pgsql-bugs\@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

>>>>> "David" == David G Johnston <david.g.johnston@gmail.com> writes:

 >> I think Java is incorrect here. Usually trailing zeros can be
 >> omitted. Also postgresql timestamp has resolution 1 microsecond, so
 >> with trailing zeros it must be "2014-09-26 17:17:45.990000", not
 >> "2014-09-26 17:17:45.990".

 David> Except the decimal in that construct is a simple part separator
 David> and not a fractional indicator.

Both the SQL spec and ISO 8601 beg to differ.

-- 
Andrew (irc:RhodiumToad)




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-09-18 13:30 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-18 11:44 BUG #15389: Fill zero in milliseconds of a timestamp PG Bug reporting form <noreply@postgresql.org>
2018-09-18 11:59 ` Sergei Kornilov <sk@zsrv.org>
2018-09-18 13:17   ` David G. Johnston <david.g.johnston@gmail.com>
2018-09-18 13:30     ` Andrew Gierth <andrew@tao11.riddles.org.uk>

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