Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDGLq-0002PL-5A for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Aug 2021 01:14:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mDGLp-0008TE-1e for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Aug 2021 01:14:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDFRu-0008C8-Qv for pgsql-bugs@lists.postgresql.org; Tue, 10 Aug 2021 00:16:55 +0000 Received: from mail.jasonk.me ([144.202.108.247]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDFRs-0005E3-N3 for pgsql-bugs@lists.postgresql.org; Tue, 10 Aug 2021 00:16:54 +0000 Received: by mail.jasonk.me (Postfix, from userid 1000) id 6B6A111B2F7; Mon, 9 Aug 2021 17:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jasonk.me; s=mail; t=1628554609; bh=+S8iggXPJgwRCp5egFLQkR5+HX/4mJanqLZbjuxDTOw=; h=Date:From:To:Subject:From; b=qyBnvezKAM8bmyT/QMasz6ZgW9A1mtFAe10d5nWpIwJajSdQ8QPNAIi8skMsAZNnE TLeKzk4cOdrdZRQgZd46Z7rpO6V5zcLw9S/lNdq4CTW/4MlUjsfwLzANO6DPGJuvR1 AJsJsnckXTWSX3bveJqOFeGw4Uf/KwlzRB5UWD+jbi9K9JhvZGhGAjkr3NvS0auKPO oqk7j/GemM9fFS02IuSc2h2ssNEb4trUpVROcYIrGINojpj7F1Am8Xljg+uZERK+Dn Eb0NViLjHoFLxSUJJHb6k/5Id1SbwOJn013N3Oxq004rE6Kpgdmrx2VoHRne5cq9Ui SCJmQk3FdSk4A== Date: Mon, 9 Aug 2021 17:16:49 -0700 From: Jason Kim To: pgsql-bugs@lists.postgresql.org Subject: Missing SELECT output on btree_gin char, BTLess* strategy Message-ID: <20210810001649.htnltbh7c63re42p@jasonk.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.