Bruce Momjian <> writes:
> A larger problem is this:

>       test=> SELECT ''::inet - ''::inet;
>        ?column?
>       -----------
>        -16843265
>       (1 row)

> Should subtraction return int8?

Probably, and for that matter the addition operators should take int8;
on IPV6 data even that's not really wide enough.

> We don't have an unsigned data type.  Of course we also have this
> excitement:

>       test=> SELECT ''::inet +  1000000;
>         ?column?
>       ------------
>       (1 row)

> so we underflow and overflow cleanly.  Not great, but it works.

"Cleanly" isn't the adjective I'd use for that.  There should be an
overflow error.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not

Reply via email to