pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Joseph Koshakow <koshy44@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Subject: Re: Remove dependence on integer wrapping
Date: Thu, 13 Jun 2024 07:00:00 +0300
Message-ID: <31ad2cd1-db94-bdb3-f91a-65ffdb4bef95@gmail.com> (raw)
In-Reply-To: <618777.1717984674@sss.pgh.pa.us>
References: <CAAvxfHdBPOyEGS7s+xf4iaW0-cgiq25jpYdWBqQqvLtLe_t6tw@mail.gmail.com>
	<ZmZbXK1CNMbkty0W@nathan>
	<618777.1717984674@sss.pgh.pa.us>

10.06.2024 04:57, Tom Lane wrote:
> BTW, while I approve of trying to get rid of our need for -fwrapv,
> I'm quite scared of actually doing it.  Whatever cases you may have
> discovered by running the regression tests will be at best the
> tip of the iceberg.  Is there any chance of using static analysis
> to find all the places of concern?

Let me remind you of bug #18240. Yes, that was about float8, but with
-ftrapv we can get into the trap with:
SELECT 1_000_000_000::money * 1_000_000_000::int;
server closed the connection unexpectedly

Also there are several trap-producing cases with date types:
SELECT to_date('100000000', 'CC');
SELECT to_timestamp('1000000000,999', 'Y,YYY');
SELECT make_date(-2147483648, 1, 1);

And one more with array...
CREATE TABLE t (ia int[]);
INSERT INTO t(ia[2147483647:2147483647]) VALUES ('{}');

I think it's not the whole iceberg too.

Best regards,
Alexander





view thread (85+ messages)  latest in thread

Message-ID: <31ad2cd1-db94-bdb3-f91a-65ffdb4bef95@gmail.com>
Permalink:  ../31ad2cd1-db94-bdb3-f91a-65ffdb4bef95@gmail.com/
Also on:    postgresql.org/message-id/31ad2cd1-db94-bdb3-f91a-65ffdb4bef95@gmail.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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: exclusion@gmail.com, tgl@sss.pgh.pa.us, koshy44@gmail.com, pgsql-hackers@lists.postgresql.org, andres@anarazel.de, nathandbossart@gmail.com
  Subject: Re: Remove dependence on integer wrapping
  In-Reply-To: <31ad2cd1-db94-bdb3-f91a-65ffdb4bef95@gmail.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