Missing SELECT output on btree_gin char, BTLess* strategy

From: Jason Kim <git(at)jasonk(dot)me>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Missing SELECT output on btree_gin char, BTLess* strategy
Date: 2021-08-10 00:16:49
Message-ID: 20210810001649.htnltbh7c63re42p@jasonk.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The expected output in contrib/btree_gin/expected/char.out is wrong for the
first two SELECTs using the BTLess* strategies: they should not be empty.

set enable_seqscan=off;

CREATE TABLE test_char (
i "char"
);

INSERT INTO test_char VALUES ('a'),('b'),('c'),('d'),('e'),('f');

CREATE INDEX idx_char ON test_char USING gin (i);

SELECT * FROM test_char WHERE i<'d'::"char" ORDER BY i;
SELECT * FROM test_char WHERE i<='d'::"char" ORDER BY i;

gives

i
---
(0 rows)

i
---
(0 rows)

If Bitmap Scan is turned off, we get output, as expected:

set enable_bitmapscan=off;
SELECT * FROM test_char WHERE i<'d'::"char" ORDER BY i;
SELECT * FROM test_char WHERE i<='d'::"char" ORDER BY i;

gives

i
---
a
b
c
(3 rows)

i
---
a
b
c
d
(4 rows)

I tried the following and got the same results:

- Do the inserts after the CREATE INDEX.
- Create the index with fastupdate turned off: CREATE INDEX ... WITH
(fastupdate = off).
- Reconnect (and don't forget to disable sequential scan).
- Stop and start the server: pg_ctl restart.

I'm on 15devel, but this issue appears to have been around for years.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2021-08-10 01:37:50 Re: Missing SELECT output on btree_gin char, BTLess* strategy
Previous Message Heikki Linnakangas 2021-08-09 20:29:47 Re: SEGFAULT on a concurrent UPDATE of mix of local and foreign partitions