Re: [GENERAL] Negative numbers to DOMAIN casting

2016-12-14 Thread Matija Lesar
Hi Tom, thank you for the explanation. Regards, Matija Lesar On 14 December 2016 at 15:53, Tom Lane wrote: > Matija Lesar writes: > > I have uint4 domain created like this: > > CREATE DOMAIN uint4 AS int8 > >CHECK(VALUE BETWEEN 0 AND 4294967295); > > > If I try to cast negative number to

Re: [GENERAL] Negative numbers to DOMAIN casting

2016-12-14 Thread Tom Lane
Matija Lesar writes: > I have uint4 domain created like this: > CREATE DOMAIN uint4 AS int8 >CHECK(VALUE BETWEEN 0 AND 4294967295); > If I try to cast negative number to this domain check constraint is not > validated: > SELECT -1::uint4, pg_typeof(-1::uint4), 1::uint4, pg_typeof(1::uint4);