pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14558: to_timestamp() format lies about supporting timezone
4+ messages / 3 participants
[nested] [flat]

* BUG #14558: to_timestamp() format lies about supporting timezone
@ 2017-02-20 14:11  coladict@gmail.com
  0 siblings, 1 reply; 4+ messages in thread

From: coladict@gmail.com @ 2017-02-20 14:11 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14558
Logged by:          Jordan Gigov
Email address:      coladict@gmail.com
PostgreSQL version: 9.6.2
Operating system:   irrelevant
Description:        

postgres=# SELECT to_timestamp('2017-02-20 16:00:27.989808+02', 'YYYY-MM-DD
HH24:MI:SS.SSSSOF')::timestamp with time zone;
ERROR:  "TZ"/"tz"/"OF" format patterns are not supported in to_date



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


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

* Re: BUG #14558: to_timestamp() format lies about supporting timezone
@ 2017-02-20 14:26  John McKown <john.archie.mckown@gmail.com>
  parent: coladict@gmail.com
  0 siblings, 1 reply; 4+ messages in thread

From: John McKown @ 2017-02-20 14:26 UTC (permalink / raw)
  To: coladict@gmail.com; +Cc: pgsql-bugs

On Mon, Feb 20, 2017 at 8:11 AM, <coladict@gmail.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      14558
> Logged by:          Jordan Gigov
> Email address:      coladict@gmail.com
> PostgreSQL version: 9.6.2
> Operating system:   irrelevant
> Description:
>
> postgres=# SELECT to_timestamp('2017-02-20 16:00:27.989808+02', 'YYYY-MM-DD
> HH24:MI:SS.SSSSOF')::timestamp with time zone;
> ERROR:  "TZ"/"tz"/"OF" format patterns are not supported in to_date
>
>
​I'm not a maintainer. Or any kind of an official "expert". But I'm
wondering if the above is really a bug. From reading the documentation on:
https://www.postgresql.org/docs/current/static/functions-datetime.html, it
seems to me to say that to_timestamp() only takes one parameter, which is a
double precision number (not a string). But the following worked well for
me:

tsh009=# SELECT '2017-02-20 16:00:27.989808+02'::timestamp;
         timestamp
----------------------------
 2017-02-20 16:00:27.989808
(1 row)
​
Or was this an enhancement request?


-- 
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

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

* Re: BUG #14558: to_timestamp() format lies about supporting timezone
@ 2017-02-20 14:40  Tom Lane <tgl@sss.pgh.pa.us>
  parent: John McKown <john.archie.mckown@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2017-02-20 14:40 UTC (permalink / raw)
  To: John McKown <john.archie.mckown@gmail.com>; +Cc: pgsql-bugs

John McKown <john.archie.mckown@gmail.com> writes:
> On Mon, Feb 20, 2017 at 8:11 AM, <coladict@gmail.com> wrote:
>> postgres=# SELECT to_timestamp('2017-02-20 16:00:27.989808+02', 'YYYY-MM-DD
>> HH24:MI:SS.SSSSOF')::timestamp with time zone;
>> ERROR:  "TZ"/"tz"/"OF" format patterns are not supported in to_date

> I'm not a maintainer. Or any kind of an official "expert". But I'm
> wondering if the above is really a bug. From reading the documentation on:
> https://www.postgresql.org/docs/current/static/functions-datetime.html, it
> seems to me to say that to_timestamp() only takes one parameter, which is a
> double precision number (not a string).

Nah, that's the other function named to_timestamp.  This one's documented
on the previous page:
https://www.postgresql.org/docs/current/static/functions-formatting.html

> Or was this an enhancement request?

Possibly.  I'm choosing to read it as a complaint that the limitation
is not mentioned in the documentation, which seems to be true.  I'll
go fix that.

(Actually supporting TZ/tz might be a bit hard, because you'd have
to figure out how to get to_timestamp's parser to see cases like
"America/New_York" or "GMT-03" as single tokens.  Possibly the
omission of OF is just a lack of round tuits.)

> But the following worked well for me:
> tsh009=# SELECT '2017-02-20 16:00:27.989808+02'::timestamp;

Yeah, it's remarkable how many people insist on using to_timestamp
when the regular timestamp input function would serve them as well
or better.

			regards, tom lane


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



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

* Re: BUG #14558: to_timestamp() format lies about supporting timezone
@ 2017-02-20 14:53  John McKown <john.archie.mckown@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: John McKown @ 2017-02-20 14:53 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

On Mon, Feb 20, 2017 at 8:40 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> John McKown <john.archie.mckown@gmail.com> writes:
> > On Mon, Feb 20, 2017 at 8:11 AM, <coladict@gmail.com> wrote:
> >> postgres=# SELECT to_timestamp('2017-02-20 16:00:27.989808+02',
> 'YYYY-MM-DD
> >> HH24:MI:SS.SSSSOF')::timestamp with time zone;
> >> ERROR:  "TZ"/"tz"/"OF" format patterns are not supported in to_date
>
> > I'm not a maintainer. Or any kind of an official "expert". But I'm
> > wondering if the above is really a bug. From reading the documentation
> on:
> > https://www.postgresql.org/docs/current/static/functions-datetime.html,
> it
> > seems to me to say that to_timestamp() only takes one parameter, which
> is a
> > double precision number (not a string).
>
> Nah, that's the other function named to_timestamp.  This one's documented
> on the previous page:
> https://www.postgresql.org/docs/current/static/functions-formatting.html


​See, I told ya'll that I'm not an expert. And thus it is shown! And in a
kindly manner.​

                        regards, tom lane
>



-- 
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

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


end of thread, other threads:[~2017-02-20 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20 14:11 BUG #14558: to_timestamp() format lies about supporting timezone coladict@gmail.com
2017-02-20 14:26 ` John McKown <john.archie.mckown@gmail.com>
2017-02-20 14:40   ` Tom Lane <tgl@sss.pgh.pa.us>
2017-02-20 14:53     ` John McKown <john.archie.mckown@gmail.com>

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