1set enable_seqscan=off;
2CREATE TABLE test_macaddr8 (
3	i macaddr8
4);
5INSERT INTO test_macaddr8 VALUES
6	( '22:00:5c:03:55:08:01:02' ),
7	( '22:00:5c:04:55:08:01:02' ),
8	( '22:00:5c:05:55:08:01:02' ),
9	( '22:00:5c:08:55:08:01:02' ),
10	( '22:00:5c:09:55:08:01:02' ),
11	( '22:00:5c:10:55:08:01:02' )
12;
13CREATE INDEX idx_macaddr8 ON test_macaddr8 USING gin (i);
14SELECT * FROM test_macaddr8 WHERE i<'22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i;
15            i
16-------------------------
17 22:00:5c:03:55:08:01:02
18 22:00:5c:04:55:08:01:02
19 22:00:5c:05:55:08:01:02
20(3 rows)
21
22SELECT * FROM test_macaddr8 WHERE i<='22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i;
23            i
24-------------------------
25 22:00:5c:03:55:08:01:02
26 22:00:5c:04:55:08:01:02
27 22:00:5c:05:55:08:01:02
28 22:00:5c:08:55:08:01:02
29(4 rows)
30
31SELECT * FROM test_macaddr8 WHERE i='22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i;
32            i
33-------------------------
34 22:00:5c:08:55:08:01:02
35(1 row)
36
37SELECT * FROM test_macaddr8 WHERE i>='22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i;
38            i
39-------------------------
40 22:00:5c:08:55:08:01:02
41 22:00:5c:09:55:08:01:02
42 22:00:5c:10:55:08:01:02
43(3 rows)
44
45SELECT * FROM test_macaddr8 WHERE i>'22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i;
46            i
47-------------------------
48 22:00:5c:09:55:08:01:02
49 22:00:5c:10:55:08:01:02
50(2 rows)
51
52