Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators
Date: 2020-05-07 06:25:24
Message-ID: 1c6b21e4-bd9e-6447-021e-3753e3e18dff@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/05/07 13:15, Fujii Masao wrote:
>
>
> 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.

Done.

>
>>
>>>> +   /* 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.

Done. Attached is the updated version of the patch!

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Attachment Content-Type Size
pg_lsn_operators_v3.patch text/plain 11.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey M. Borodin 2020-05-07 06:25:47 Re: PG 13 release notes, first draft
Previous Message Amit Kapila 2020-05-07 05:51:04 Re: PG compilation error with Visual Studio 2015/2017/2019