pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
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: Sat, 2 May 2020 11:29:00 +0900
Message-ID: <20200502022900.GD409463@paquier.xyz> (raw)
In-Reply-To: <8aa9c491-c693-0e8c-66e8-eb22e72ab329@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>

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.

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (25+ messages)  latest in thread

Message-ID: <20200502022900.GD409463@paquier.xyz>
Permalink:  ../20200502022900.GD409463@paquier.xyz/
Also on:    postgresql.org/message-id/20200502022900.GD409463@paquier.xyz

 · 

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: michael@paquier.xyz, masao.fujii@oss.nttdata.com, robertmhaas@gmail.com, horikyota.ntt@gmail.com, jgdr@dalibo.com
  Subject: Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators
  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>

* 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