-- Testing cross-types compatibility SELECT 1::int16 = 1::uint1; ?column? ---------- t (1 row) SELECT 1::int16 = 0::uint1; ?column? ---------- f (1 row) SELECT 1::int16 = 1::int1; ?column? ---------- t (1 row) SELECT 1::int16 = 0::int1; ?column? ---------- f (1 row) SELECT 1::int16 <> 0::uint1; ?column? ---------- t (1 row) SELECT 0::int16 <> 0::uint1; ?column? ---------- f (1 row) SELECT 1::int16 <> 0::int1; ?column? ---------- t (1 row) SELECT 0::int16 <> 0::int1; ?column? ---------- f (1 row) SELECT 1::int16 > 0::uint1; ?column? ---------- t (1 row) SELECT 0::int16 > 1::uint1; ?column? ---------- f (1 row) SELECT 1::int16 > 0::int1; ?column? ---------- t (1 row) SELECT 0::int16 > 1::int1; ?column? ---------- f (1 row) SELECT 0::int16 < 1::uint1; ?column? ---------- t (1 row) SELECT 1::int16 < 0::uint1; ?column? ---------- f (1 row) SELECT 0::int16 < 1::int1; ?column? ---------- t (1 row) SELECT 1::int16 < 0::int1; ?column? ---------- f (1 row) SELECT 1::int16 >= 0::uint1; ?column? ---------- t (1 row) SELECT 0::int16 >= 1::uint1; ?column? ---------- f (1 row) SELECT 1::int16 >= 1::uint1; ?column? ---------- t (1 row) SELECT 1::int16 >= 0::int1; ?column? ---------- t (1 row) SELECT 0::int16 >= 1::int1; ?column? ---------- f (1 row) SELECT 1::int16 >= 1::int1; ?column? ---------- t (1 row) SELECT 0::int16 <= 1::uint1; ?column? ---------- t (1 row) SELECT 1::int16 <= 0::uint1; ?column? ---------- f (1 row) SELECT 1::int16 <= 1::uint1; ?column? ---------- t (1 row) SELECT 0::int16 <= 1::int1; ?column? ---------- t (1 row) SELECT 1::int16 <= 0::int1; ?column? ---------- f (1 row) SELECT 1::int16 <= 1::int1; ?column? ---------- t (1 row) SELECT 120::int16 + 10::uint1; ?column? ---------- 130 (1 row) SELECT 170141183460469231731687303715884105727::int16 + 1::uint1; ERROR: int16 out of range SELECT (-120)::int16 + 10::uint1; ?column? ---------- -110 (1 row) SELECT 120::int16 + 10::int1; ?column? ---------- 130 (1 row) SELECT 170141183460469231731687303715884105727::int16 + 1::int1; ERROR: int16 out of range SELECT 120::int16 - 10::uint1; ?column? ---------- 110 (1 row) SELECT (-170141183460469231731687303715884105728)::int16 - 1::uint1; ERROR: int16 out of range SELECT (-120)::int16 - 10::uint1; ?column? ---------- -130 (1 row) SELECT 120::int16 - 10::int1; ?column? ---------- 110 (1 row) SELECT (-170141183460469231731687303715884105728)::int16 - 1::int1; ERROR: int16 out of range SELECT 120::int16 * 10::uint1; ?column? ---------- 1200 (1 row) SELECT 170141183460469231731687303715884105727::int16 * 2::uint1; ERROR: int16 out of range SELECT (-120)::int16 * 10::uint1; ?column? ---------- -1200 (1 row) SELECT 120::int16 * 10::int1; ?column? ---------- 1200 (1 row) SELECT 170141183460469231731687303715884105727::int16 * 2::int1; ERROR: int16 out of range SELECT 120::int16 / 10::uint1; ?column? ---------- 12 (1 row) SELECT 1::int16 / 0::uint1; ERROR: division by zero SELECT (-120)::int16 / 10::uint1; ?column? ---------- 0 (1 row) SELECT 120::int16 / 10::int1; ?column? ---------- 12 (1 row) SELECT 1::int16 / 0::int1; ERROR: division by zero SELECT 120::int16 % 10::uint1; ?column? ---------- 0 (1 row) SELECT 1::int16 % 0::uint1; ERROR: division by zero SELECT (-120)::int16 % 10::uint1; ?column? ---------- -120 (1 row) SELECT 120::int16 % 10::int1; ?column? ---------- 0 (1 row) SELECT 1::int16 % 0::int1; ERROR: division by zero