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 1hLXcW-0005zY-5k for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Apr 2019 18:36:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLXcS-00080w-Rs for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Apr 2019 18:36:44 +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 1hLXcS-00080p-Ej for pgsql-hackers@lists.postgresql.org; Tue, 30 Apr 2019 18:36:44 +0000 Received: from mail-it1-x12c.google.com ([2607:f8b0:4864:20::12c]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLXcP-0005dT-P0 for pgsql-hackers@lists.postgresql.org; Tue, 30 Apr 2019 18:36:44 +0000 Received: by mail-it1-x12c.google.com with SMTP id x132so6364194itf.2 for ; Tue, 30 Apr 2019 11:36:41 -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:mime-version:content-disposition :user-agent; bh=nThs8bwrAdfts3XUXD+pEirAR1fb60K94V7bd8Bzqqc=; b=C53D/SnVKaVcRAwusZppsxS6T7qVBA8rPeR22ttLDk11NsO7F/SBlJcoK9mayhroYC 6MMf5JcD8AO/6mF4Jzo4InCetuqgiap3RInTr7JolS9ltJZN7OUeiAWvUBO3IzenqSvz 0XgbL544sY7wcU9xluoXQ6sl2txkbywf3Ed1EOPazZVqpNtjb6e9ttW+g1a/aSod34jZ Uus4H4YlRvhotlFRLsbWnnK0p5+fRoTgh9G1OCU1qJSZIyrtryZjY3H+bqj66/NlnI3s 64jIqraiC6FH4tvLvYNnUDjb0LiyAt5GTXA+MHZisEiZ1gu35EUcRW+5ruPg7Rq8L67q OV3A== 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:mime-version :content-disposition:user-agent; bh=nThs8bwrAdfts3XUXD+pEirAR1fb60K94V7bd8Bzqqc=; b=qnvAA4gRfpJ6TTlBk548aVJrUxvjolvMRmr0RLPLBtpKUiZmWgodn4J5vuaPoYV27Q miaGuf09TKPo7xaZCrcmcexdznm3RhdVgSrOzkNOkVoztLbcsI9T8N8UhwpoQiEyxiQc WjT0gNM3mVVjQZUEfiCnDQcM49UlqVM9v+jsKrRDeIdVULVKK7jmxSTLByL5ORP+xC4Q f5ycjUUW9NBfClSV3i8WGi8POzAw/G3tkacE7Kv7Tx2k7rRMkU11OKNxW0GXVlrvyqO3 l+86BWMD2r+dK0VBOQYiMf26B5+a7/38cT6A3YheUKWpmVKrsMMqiuDE1lJ4LSJcuwFn 4x6A== X-Gm-Message-State: APjAAAU0edtowv0DgaZgL4eAPW6S2v6/K1RPCsd6nygmKxBqPP9neY3o QfNxamfkC9v7pb4qtIeMNFb0IcEqWnw= X-Google-Smtp-Source: APXvYqxCtxEXsVwO7bmdwBbq1kNHZ5TtaWMllX19u+hDEiHDdeWY3JAYmg/iSvXdyI14z9Ia8vAe0w== X-Received: by 2002:a24:6495:: with SMTP id t143mr4437395itc.156.1556649399234; Tue, 30 Apr 2019 11:36:39 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id t127sm1876313itb.32.2019.04.30.11.36.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 11:36:38 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 3360F80091E; Tue, 30 Apr 2019 13:36:36 -0500 (CDT) Date: Tue, 30 Apr 2019 13:36:36 -0500 From: Justin Pryzby To: Bruce Momjian Cc: pgsql-hackers@lists.postgresql.org Subject: Re: doc: improve PG 12 to_timestamp()/to_date() wording Message-ID: <20190430183636.GA8175@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Bruce I saw this commit; commit ad23adc5a169b114f9ff325932cbf2ce1c5e69c1 |Author: Bruce Momjian |Date: Tue Apr 30 14:06:57 2019 -0400 | | doc: improve PG 12 to_timestamp()/to_date() wording which cleans up language added at cf984672. Can I suggest this additional change, which is updated and extracted from my larger set of documentation fixes. Justin diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 96fafdd..b420585 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -6400,20 +6400,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 M 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 --/9DWx/yDrRhgMJTb Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v3-0001-Clean-up-language-in-cf984672-Improve-behavior-of.patch" From 0d304935aa5b83e56127b5a63aa3d180b4c42e16 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sat, 30 Mar 2019 03:42:35 -0500 Subject: [PATCH v3] 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 96fafdd..b420585 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -6400,20 +6400,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 M 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 --/9DWx/yDrRhgMJTb--