BUG #19018: high memory usage and "stack depth limit exceeded", with GiST index on ltree

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: dull(dot)bananas0(at)gmail(dot)com
Subject: BUG #19018: high memory usage and "stack depth limit exceeded", with GiST index on ltree
Date: 2025-08-11 22:00:52
Message-ID: 19018-a5ed1ced2ec2e2ff@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19018
Logged by: Joseph Silva
Email address: dull(dot)bananas0(at)gmail(dot)com
PostgreSQL version: 17.5
Operating system: Fedora
Description:

If I run this, then the postgres process's memory usage approaches 6 GB, and
the insertion when
i=253 fails with "stack depth limit exceeded":

```
CREATE EXTENSION ltree;

CREATE TABLE comment (path ltree);

CREATE INDEX ON comment USING gist (path);

DO $$
DECLARE
i int := 1;
p text := '0';
BEGIN
WHILE i < 1000 LOOP
p := p || '.' || i::text;
i := i + 1;
INSERT INTO comment (path) VALUES (p::ltree);
COMMIT;
END LOOP;
END
$$;
```

If index creation is delayed until after insertions, then the insertions
succeed but index creation
fails.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sajith Prabhakar Shetty 2025-08-12 04:43:20 Re: Postgres: Queries are too slow after upgrading to PG17 from PG15
Previous Message Nathan Bossart 2025-08-11 19:00:59 Re: BUG #19006: Assert(BufferIsPinned) in BufferGetBlockNumber() is triggered for forwarded buffer