Re: Issue with past commit: Allow fractional input values for integer GUCs ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Greg Nancarrow <gregn4422(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Issue with past commit: Allow fractional input values for integer GUCs ...
Date: 2020-08-26 20:47:43
Message-ID: 2945739.1598474863@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> I don't think any of these cases should be allowed. Surely if we
> allowed 384.234 to be inserted into an integer column, everyone would
> say that we'd lost our minds.

regression=# create table itable (f1 int);
CREATE TABLE
regression=# insert into itable values (384.234);
INSERT 0 1
regression=# table itable;
f1
-----
384
(1 row)

It's always worked like that, and nobody's complained about it.
I suspect, in fact, that one could find chapter and verse in the
SQL spec that requires it, just like "numeric" values should get
rounded if you write too many digits.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2020-08-26 21:12:36 Re: XMAX_LOCK_ONLY and XMAX_COMMITTED (fk/multixact code)
Previous Message Robert Haas 2020-08-26 20:12:22 Re: Issue with past commit: Allow fractional input values for integer GUCs ...