Re: Issue with past commit: Allow fractional input values for integer GUCs ... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Issue with past commit: Allow fractional input values for integer GUCs ...
Date
Msg-id 2945739.1598474863@sss.pgh.pa.us
Whole thread Raw
In response to Re: Issue with past commit: Allow fractional input values for integer GUCs ...  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Issue with past commit: Allow fractional input values for integer GUCs ...  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Issue with past commit: Allow fractional input values for integer GUCs ...
Next
From: "Bossart, Nathan"
Date:
Subject: Re: XMAX_LOCK_ONLY and XMAX_COMMITTED (fk/multixact code)