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

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: masao(dot)fujii(at)oss(dot)nttdata(dot)com
Cc: robertmhaas(at)gmail(dot)com, jgdr(at)dalibo(dot)com, michael(at)paquier(dot)xyz, pgsql-hackers(at)postgresql(dot)org
Subject: Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators
Date: 2020-05-11 04:00:12
Message-ID: 20200511.130012.2305038351154866785.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Sat, 9 May 2020 23:40:15 +0900, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote in
>
>
> On 2020/05/08 12:10, Kyotaro Horiguchi wrote:
> > At Fri, 8 May 2020 11:31:42 +0900, Fujii Masao
> > <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote in
> >>>> You mean that pg_lsn_pli() and pg_lsn_mii() should emit an error like
> >>>> "the number of bytes to add/subtract cannnot be NaN" when NaN is
> >>>> specified?
> >>> The function is called while executing an expression, so "NaN cannot
> >>> be used in this expression" or something like that would work.
> >>
> >> This sounds ambiguous. I like to use clearer messages like
> >>
> >> cannot add NaN to pg_lsn
> >> cannot subtract NaN from pg_lsn
> > They works fine to me.
>
> Ok, I updated pg_lsn_pli() and pg_lsn_mii() so that they emit an error
> when NaN is specified as the number of bytes.

It's fine with me.

> > Sorry, I misread the patch as it rejected -1 for *nbytes*, by seeing
> > numeric_pg_lsn.
> > Finally, I'm convinced that we lack required integer arithmetic
> > infrastructure to perform the objective.
> > The patch looks good to me except the size of buf[], but I don't
> > strongly object to that.
>
> Ok, I changed the size of buf[] to 32.
> Attached is the updated version of the patch.

Thank you very much! The patch looks good to me.

regard.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-05-11 04:38:57 Re: 2020-05-14 Press Release Draft
Previous Message Alvaro Herrera 2020-05-11 03:59:25 Re: Add "-Wimplicit-fallthrough" to default flags (was Re: pgsql: Support FETCH FIRST WITH TIES)