Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjrEb-0007Mb-LH for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Jul 2019 20:24:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hjrEY-0000Hx-Ti for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Jul 2019 20:24:34 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjrEY-0000Hp-H3 for pgsql-hackers@lists.postgresql.org; Sat, 06 Jul 2019 20:24:34 +0000 Received: from mail-io1-xd44.google.com ([2607:f8b0:4864:20::d44]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjrET-0003QM-Mz for pgsql-hackers@lists.postgresql.org; Sat, 06 Jul 2019 20:24:33 +0000 Received: by mail-io1-xd44.google.com with SMTP id h6so18073319iom.7 for ; Sat, 06 Jul 2019 13:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=k157etnUfGijwMe3m+7f8L1+bGLm9AOIHUI4YJubado=; b=RjwpN/jBezj/Hpjk6Z1jtj0HL8qdwFDG4NhKMVh0NBBgoR4ph7Fv3TRX2RjThJCFhe G/fiAhbvKHH9/hMLOHYwf8OUu5m8rkiJ3K0m0X+uTQzJjM+35ixnggHcK9kNZJlsmblR SnNTu0eHWPg4Mu+iFZ8N38rrgkV36pZdQVHWkZgBferwgmY74m5gTP6ArWwKxch4baDR XdIdQOv1c8hpDZY6SWlB3Pt1OxUkX20rwnBnPtlmbfVvrbB+ewEkeboySPEreuerGcfh G0pl7pJULDw+qgzbBUlXwFQEkQqythapRAvXBngutJnoARR+imtUxlVsh4LEH0ncCqxu pRjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=k157etnUfGijwMe3m+7f8L1+bGLm9AOIHUI4YJubado=; b=KJm7N5nYXYKAKpJQERkfyoqRD4FbbU3fWLyyaQZfFmWF0z0iExX1uuuqmaYF95RS5r B+OsQHrtesjI9VY7iJouYMnAXei9nBV9sembItptauo6DV232wF/X1pWIN75IWxiao1Y 7IBae3gE/L4zq04U7S5wE6scMjDz3MVEu8lF0KKMunchwl7RzQNKYRCwj1Yn301zb4Zj ohihxGzRWlo6uxXZ+ioB0eGvsX3L/2ZjrrzeNfCTpWDaD8xNFp1swO/3YV98mZMy5IK+ hVg+JOaWJSpvI/KBGlDit3CSluI+34IestvVL/O7HxNuaR85s7WSVc+BVHHUFyY86UCK Qadw== X-Gm-Message-State: APjAAAXi5AWlOGWQcN6efENJ/VFUXIrfl0ZZrGhxjXnCIeXSfFOhqAB9 QEOTq47R8yY7DitLwM8tbid/cxq1ClM= X-Google-Smtp-Source: APXvYqxda3432jxDH6ioebaRNNL5lGsVbAEPsA2BPaFBeDiZNMCX1pVmVtU01/bqq0g6sBEFrK8NCQ== X-Received: by 2002:a5e:db02:: with SMTP id q2mr3651180iop.306.1562444667312; Sat, 06 Jul 2019 13:24:27 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id j25sm18805624ioj.67.2019.07.06.13.24.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jul 2019 13:24:26 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 6ABDA8009A7; Sat, 6 Jul 2019 15:24:25 -0500 (CDT) Date: Sat, 6 Jul 2019 15:24:25 -0500 From: Justin Pryzby To: Alexander Korotkov Cc: PostgreSQL Hackers Subject: Re: doc: improve PG 12 to_timestamp()/to_date() wording Message-ID: <20190706202425.GA16933@telsasoft.com> References: <20190430183636.GA8175@telsasoft.com> <20190501001403.GN3925@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline In-Reply-To: <20190501001403.GN3925@telsasoft.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 30, 2019 at 07:14:04PM -0500, Justin Pryzby wrote: > On Tue, Apr 30, 2019 at 09:48:14PM +0300, Alexander Korotkov wrote: > > I'd like to add couple of comments from my side. > > > > - returns an error because the second template string space is consumed > > > - by the letter J in the input string. > > > + returns an error because the second space in the template string consumes > > > + the letter M from the input string. > > > > Why M? There is no letter "M" is input string. > > The issue here is that we already consumed "J" from "JUN" and trying > > to match "UN" to "MON". So, I think we should live > > J here. The rest of this change looks good. > > Seems like I confused myself while resolving rebase conflict. > > Thanks for checking. Find attached updated patch, which seems to still be needed. This was subsumed and now extracted from a larger patch, from which Michael at one point applied a few hunks. I have some minor updates based on review from Andres, but there didn't seem to be much interest so I haven't pursued it. https://www.postgresql.org/message-id/20190520182001.GA25675%40telsasoft.com Justin --IJpNTDwzlM2Ie8A6 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v3-0008-Clean-up-language-in-cf984672-Improve-behavior-of.patch" From 2ca5c2f2f8ad8bb8a681aea7ca78131f1f99d756 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sat, 30 Mar 2019 03:42:35 -0500 Subject: [PATCH v3 08/12] Clean up language in cf984672: Improve behavior of to_timestamp()/to_date() functions --- doc/src/sgml/func.sgml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index d425731..c5f1828 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -6426,20 +6426,20 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}'); If FX is specified, a separator in the template string - matches exactly one character in input string. Notice we don't insist the - input string character be the same as the template string separator. + matches exactly one character in the input string. But note that the + input string character is not required to be the same as the separator from the template string. For example, to_timestamp('2000/JUN', 'FXYYYY MON') works, but to_timestamp('2000/JUN', 'FXYYYY  MON') - returns an error because the second template string space is consumed - by the letter J in the input string. + returns an error because the second space in the template string consumes + the letter J from the input string. A TZH template pattern can match a signed number. - Without the FX option, it can lead to ambiguity in - interpretation of the minus sign, which can also be interpreted as a separator. + Without the FX option, minus signs may be ambiguous, + and could be interpreted as a separator. This ambiguity is resolved as follows: If the number of separators before TZH in the template string is less than the number of separators before the minus sign in the input string, the minus sign -- 2.7.4 --IJpNTDwzlM2Ie8A6--