Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWXx8-0006qa-Qj for pgsql-hackers@arkaria.postgresql.org; Thu, 07 May 2020 04:16:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jWXx7-0004Nj-M7 for pgsql-hackers@arkaria.postgresql.org; Thu, 07 May 2020 04:16:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWXx7-0004Na-FG for pgsql-hackers@lists.postgresql.org; Thu, 07 May 2020 04:16:05 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWXwz-0001hc-LY for pgsql-hackers@postgresql.org; Thu, 07 May 2020 04:16:03 +0000 Received: from hnk.local (p2358024-ipbf2221funabasi.chiba.ocn.ne.jp [114.177.56.24]) by oss.nttdata.com (Postfix) with ESMTPSA id 4200860256; Thu, 7 May 2020 13:15:53 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at oss.nttdata.com Subject: Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators To: Michael Paquier Cc: Robert Haas , Kyotaro Horiguchi , Jehan-Guillaume de Rorthais , "pgsql-hackers@postgresql.org" References: <20200424072414.GP33034@paquier.xyz> <20200424121526.399578eb@firost> <20200427.104147.1848676018835134301.horikyota.ntt@gmail.com> <20200428060328.GF279958@paquier.xyz> <8aa9c491-c693-0e8c-66e8-eb22e72ab329@oss.nttdata.com> <20200502022900.GD409463@paquier.xyz> From: Fujii Masao Message-ID: Date: Thu, 7 May 2020 13:15:52 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200502022900.GD409463@paquier.xyz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/05/02 11:29, Michael Paquier wrote: > On Thu, Apr 30, 2020 at 11:40:59PM +0900, Fujii Masao wrote: >> Also the number of bytes can be added into and substracted from LSN using the >> +(pg_lsn,numeric) and -(pg_lsn,numeric) >> operators, respectively. Note that the calculated LSN should be in the range >> of pg_lsn type, i.e., between 0/0 and >> FFFFFFFF/FFFFFFFF. >> ----------------- > > That reads fine. Ok, I will update the docs in that way. > >>> + /* XXX would it be better to return NULL? */ >>> + if (NUMERIC_IS_NAN(num)) >>> + ereport(ERROR, >>> + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), >>> + errmsg("cannot convert NaN to pg_lsn"))); >>> That would be good to test, and an error sounds fine to me. >> >> You mean that we should add the test that goes through this code block, >> into the regression test? > > Yes, that looks worth making sure to track, especially if the behavior > of this code changes in the future. Ok, I will add that regression test. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION