pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators
Date: Thu, 7 May 2020 13:15:52 +0900
Message-ID: <a03389b8-84f2-d9e4-3258-4f3b9f202963@oss.nttdata.com> (raw)
In-Reply-To: <20200502022900.GD409463@paquier.xyz>
References: <CA+Tgmoa0gRq56Z517QABepGcpbK-SERkp4P+5JjuQH+3Y8v4Kw@mail.gmail.com>
	<20200424072414.GP33034@paquier.xyz>
	<20200424121526.399578eb@firost>
	<20200427.104147.1848676018835134301.horikyota.ntt@gmail.com>
	<CA+TgmobHuvqBd1SVFNQNcA=KJMKx_5wNsKTa3yqHwwqqx+wNWA@mail.gmail.com>
	<c849ce81-e7bf-1d62-9b0f-959d2a1b467d@oss.nttdata.com>
	<20200428060328.GF279958@paquier.xyz>
	<8aa9c491-c693-0e8c-66e8-eb22e72ab329@oss.nttdata.com>
	<20200502022900.GD409463@paquier.xyz>



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
>> <literal>+(pg_lsn,numeric)</literal> and <literal>-(pg_lsn,numeric)</literal>
>> operators, respectively. Note that the calculated LSN should be in the range
>> of <type>pg_lsn</type> type, i.e., between <literal>0/0</literal> and
>> <literal>FFFFFFFF/FFFFFFFF</literal>.
>> -----------------
> 
> 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





view thread (25+ messages)  latest in thread

Message-ID: <a03389b8-84f2-d9e4-3258-4f3b9f202963@oss.nttdata.com>
Permalink:  ../a03389b8-84f2-d9e4-3258-4f3b9f202963@oss.nttdata.com/
Also on:    postgresql.org/message-id/a03389b8-84f2-d9e4-3258-4f3b9f202963@oss.nttdata.com

 · 

reply

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-hackers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, michael@paquier.xyz, robertmhaas@gmail.com, horikyota.ntt@gmail.com, jgdr@dalibo.com
  Subject: Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators
  In-Reply-To: <a03389b8-84f2-d9e4-3258-4f3b9f202963@oss.nttdata.com>
  References: <CA+Tgmoa0gRq56Z517QABepGcpbK-SERkp4P+5JjuQH+3Y8v4Kw@mail.gmail.com> <20200424072414.GP33034@paquier.xyz> <20200424121526.399578eb@firost> <20200427.104147.1848676018835134301.horikyota.ntt@gmail.com> <CA+TgmobHuvqBd1SVFNQNcA=KJMKx_5wNsKTa3yqHwwqqx+wNWA@mail.gmail.com> <c849ce81-e7bf-1d62-9b0f-959d2a1b467d@oss.nttdata.com> <20200428060328.GF279958@paquier.xyz> <8aa9c491-c693-0e8c-66e8-eb22e72ab329@oss.nttdata.com> <20200502022900.GD409463@paquier.xyz> <a03389b8-84f2-d9e4-3258-4f3b9f202963@oss.nttdata.com>

* 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