From: Tom Lane <tgl@sss.pgh.pa.us>
To: jian xu <jamesxu@outlook.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: creating gist index on ltree column failed
Date: Wed, 23 Sep 2020 10:37:17 -0400
Message-ID: <1427099.1600871837@sss.pgh.pa.us> (raw)
In-Reply-To: <MN2PR05MB68321416773DB46AFCAA323EA1380@MN2PR05MB6832.namprd05.prod.outlook.com>
References: <MN2PR05MB68321416773DB46AFCAA323EA1380@MN2PR05MB6832.namprd05.prod.outlook.com>
jian xu <jamesxu@outlook.com> writes:
> I tried to create gist index on a ltree column, first I got error
> ERROR: stack depth limit exceeded
Hm. What PG version is this? If it's up-to-date, can you provide some
sample data that causes such problems?
> one thing I notice is, there are some rows with many levels(more than 1k levels) in the ltree, if I delete those rows, creating gist index works
I tried to reproduce this using just that information, but all I got was
regression=# create table t (f1 ltree);
CREATE TABLE
regression=# create index on t using gist(f1);
CREATE INDEX
regression=# insert into t select ('0.' || (select string_agg(g::text,'.') from generate_series(1,100) g))::ltree;
INSERT 0 1
regression=# insert into t select ('0.' || (select string_agg(g::text,'.') from generate_series(1,1000) g))::ltree;
ERROR: index row requires 16048 bytes, maximum size is 8191
which is perhaps an annoying limitation, but it's not a bug.
(I'm kind of wondering about the use-case for such long ltrees, anyway.)
regards, tom lane
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, jamesxu@outlook.com, pgsql-admin@lists.postgresql.org
Subject: Re: creating gist index on ltree column failed
In-Reply-To: <1427099.1600871837@sss.pgh.pa.us>
* 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