Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfp8c-00039s-Mz for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Feb 2017 14:40:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cfp8c-0006Gs-A0 for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Feb 2017 14:40:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cfp8b-0006Gm-W1 for pgsql-bugs@postgresql.org; Mon, 20 Feb 2017 14:40:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cfp8Z-00043T-LV for pgsql-bugs@postgresql.org; Mon, 20 Feb 2017 14:40:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v1KEeLFX000504; Mon, 20 Feb 2017 09:40:21 -0500 From: Tom Lane To: John McKown cc: coladict@gmail.com, pgsql-bugs Subject: Re: BUG #14558: to_timestamp() format lies about supporting timezone In-reply-to: References: <20170220141104.1256.73955@wrigleys.postgresql.org> Comments: In-reply-to John McKown message dated "Mon, 20 Feb 2017 08:26:15 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <502.1487601621.1@sss.pgh.pa.us> Date: Mon, 20 Feb 2017 09:40:21 -0500 Message-ID: <503.1487601621@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org John McKown writes: > On Mon, Feb 20, 2017 at 8:11 AM, 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