Skip to content

INTT <> INT2 returns the same result as INTT = INT2

Summary

Inequality comparisons <> between INTT and INT2 give wrong results (the same as = instead of its negation). The problem affects only INTT <> INT2 comparisons; INT2 <> INTT comparisons work as expected.

Steps to reproduce

SELECT 1::INT2 <> 1::INTT AS result;

Expected result

┌────────┐
│ result │
├────────┤
│ f      │
└────────┘
(1 row)

Actual result

┌────────┐
│ result │
├────────┤
│ t      │
└────────┘
(1 row)

Possible fixes

Check the intt_int2_ne(intt, int2) function in intt.sql for errors.

Additional information

OS Ubuntu 22.04.5 LTS
PostgreSQL 18beta3
ids4nulls 0.3