dimitri/prefix — Issue #3: <@ seems working incorrect
Author: vazir
Created: 2012-02-10 11:39:20+00:00
State: open

Dmitri,
Looks there is misbehavior of @> and <@ operators, please take a look at the output
I use pgsql 9.1 with this latest git of your module.

Attempt to match
select '441873'::public.prefix_range <@ '4418731234'::public.prefix_range

is false while 'is contained by' should be true.

It seems have worked in previous PG versions, but i currently do not have 8.x installs to check.

select a, b,
a <= b as "<=", a < b as "<", a = b as "=", a <> b as "<>", a >= b as ">=", a > b as ">",
a @> b as "@>", a <@ b as "<@", a && b as "&&"
from (select a::prefix_range, b::prefix_range
from (values('441873', '4418731234'),
('441873', '4418731234')
) as t(a, b)
) as x;

a | b | <= | < | = | <> | >= | > | @> | <@ | &&
--------+------------+----+---+---+----+----+---+----+----+----
441873 | 4418731234 | f | f | f | t | t | t | t | f | t
441873 | 4418731234 | f | f | f | t | t | t | t | f | t
(2 rows)