From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: dull.bananas0@gmail.com
Subject: BUG #19018: high memory usage and "stack depth limit exceeded", with GiST index on ltree
Date: Mon, 11 Aug 2025 22:00:52 +0000
Message-ID: <19018-a5ed1ced2ec2e2ff@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 19018
Logged by: Joseph Silva
Email address: dull.bananas0@gmail.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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, dull.bananas0@gmail.com
Subject: Re: BUG #19018: high memory usage and "stack depth limit exceeded", with GiST index on ltree
In-Reply-To: <19018-a5ed1ced2ec2e2ff@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox