BUG #17302: gist index prevents insertion of some data

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: exclusion(at)gmail(dot)com
Subject: BUG #17302: gist index prevents insertion of some data
Date: 2021-11-28 18:00:01
Message-ID: 17302-dea8025c932a92f1@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

The following bug has been logged on the website:

Bug reference: 17302
Logged by: Alexander Lakhin
Email address: exclusion(at)gmail(dot)com
PostgreSQL version: 14.1
Operating system: Ubuntu 20.04
Description:

The last statement in the following sequence of queries:
CREATE TABLE point_tbl (f1 point);
CREATE INDEX gpointind ON point_tbl USING gist (f1);
INSERT INTO point_tbl SELECT '(0,0)'::point FROM generate_series(1, 1000)
g;
INSERT INTO point_tbl VALUES ('(1e-300,-1e-300)'::point);
produces:
ERROR: value out of range: underflow
(The error occurs inside gist_box_penalty()->box_penalty()->size_box().)
But the following sequence:
CREATE TABLE point_tbl (f1 point);
INSERT INTO point_tbl SELECT '(0,0)'::point FROM generate_series(1, 1000)
g;
INSERT INTO point_tbl VALUES ('(1e-300,-1e-300)'::point);
executes without an error. Moreover, the same index can be created
successfully after the insertion. The error is also depends on number of the
points inserted in the first step.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-11-29 03:58:32 BUG #17303: statement_timeout does not work always
Previous Message Tom Lane 2021-11-28 16:51:06 Re: BUG #17301: SELECT gets weird result while two transactions are submitted concurrently

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2021-11-28 18:02:47 Re: [Proposal] Add foreign-server health checks infrastructure
Previous Message Sasasu 2021-11-28 15:37:18 [PATCH] buffile: ensure start offset is aligned with BLCKSZ