From: Tom Lane <tgl@sss.pgh.pa.us>
To: John McKown <john.archie.mckown@gmail.com>
Cc: coladict@gmail.com, pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14558: to_timestamp() format lies about supporting timezone
Date: Mon, 20 Feb 2017 09:40:21 -0500
Message-ID: <503.1487601621@sss.pgh.pa.us> (raw)
In-Reply-To: <CAAJSdjjhdd2J3rUqMXuuJ2yBL+d6mVfTU0XsQ8xW4+fgdoQBbA@mail.gmail.com>
References: <20170220141104.1256.73955@wrigleys.postgresql.org>
<CAAJSdjjhdd2J3rUqMXuuJ2yBL+d6mVfTU0XsQ8xW4+fgdoQBbA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
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: tgl@sss.pgh.pa.us, john.archie.mckown@gmail.com
Subject: Re: BUG #14558: to_timestamp() format lies about supporting timezone
In-Reply-To: <503.1487601621@sss.pgh.pa.us>
References: <20170220141104.1256.73955@wrigleys.postgresql.org> <CAAJSdjjhdd2J3rUqMXuuJ2yBL+d6mVfTU0XsQ8xW4+fgdoQBbA@mail.gmail.com> <503.1487601621@sss.pgh.pa.us>
* 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