Tom Lane wrote:
> Bruno Wolff III <bruno@wolff.to> writes:
>> Is a test going to get added to the regression tests to catch similar
>> regressions in the future?
>
> I've been thinking about that. It seems that the regression tests have
> fairly poor coverage of use of typmod-bearing data types in general;
> most of our tests of complicated queries tend to use "simple" datatypes
> like int or text. I don't have any immediate thoughts what to do about
> that --- massive expansion of the tests doesn't seem justified --- but
> this isn't the first bug we've hit in this area. It's just a bit more
> embarrassing than most :-(
I think at least the most simple cases should be added. At the very least a
test that would have caught this issue. This is really the first time that
I had to pull a minor release and go back to a previous version. ;-)
As far as I understand, it's as simple as this (untested):
CREATE TABLE tab (c DECIMAL(5,2) NOT NULL, CHECK (c >= 0)
);
INSERT INTO tab ('0');
Right?
Or at least:
UPDATE tab SET c='0';
Best Regards
Michael Paesold