From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chris St Denis <chris@ctgameinfo.com>
Cc: David Geier <geidav.pg@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: crash in ltree_compare_distance() in 14.24
Date: Fri, 30 Oct 2026 09:48:19 -0400
Message-ID: <2288826.1793368099@sss.pgh.pa.us> (raw)
In-Reply-To: <1990fc2d-c56a-4111-8444-6f8f1d66d1fd@ctgameinfo.com>
References: <043a5139-1f0c-49df-b423-1cd129839aa9@ctgameinfo.com>
<497fe0b6-2f8c-4237-b749-bed21de36c01@gmail.com>
<3527d5c4-0ce4-4412-b433-2e1d36517139@ctgameinfo.com>
<23946400-3809-499d-b0bc-5f859df8ef50@gmail.com>
<1990fc2d-c56a-4111-8444-6f8f1d66d1fd@ctgameinfo.com>
Chris St Denis <chris@ctgameinfo.com> writes:
> Data corruption is possible, I recently had an incident with it, however
> my thinking was that if this was caused by corruption that the pg_dump
> would also crash the server which is not happening. That assumption may
> be incorrect.
pg_dump is pretty insensitive to corruption in user-table indexes.
It normally reads user tables only via full-table seqscans, which
won't touch the indexes at all. In this case, we can assume that
ltree_compare_distance is being asked to compute the distance between
some ltree value in the index and one in local memory (a value to be
inserted), and it seems it's being passed an incorrect pointer to
the index entry, implying corruption in the index structure.
> If corruption is the cause, can you give guidance on what I should do to
> repair/validate that data? Which index should be rebuilt/etc?
If you don't have a way to reproduce it, then there's not a lot we
can do to investigate. I'd advise just reindexing the troublesome
index and moving on. If you're unsure which is the troublesome
index, reindexing all GIST indexes on ltree columns should be
enough to deal with it.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, chris@ctgameinfo.com, geidav.pg@gmail.com
Subject: Re: crash in ltree_compare_distance() in 14.24
In-Reply-To: <2288826.1793368099@sss.pgh.pa.us>
References: <043a5139-1f0c-49df-b423-1cd129839aa9@ctgameinfo.com> <497fe0b6-2f8c-4237-b749-bed21de36c01@gmail.com> <3527d5c4-0ce4-4412-b433-2e1d36517139@ctgameinfo.com> <23946400-3809-499d-b0bc-5f859df8ef50@gmail.com> <1990fc2d-c56a-4111-8444-6f8f1d66d1fd@ctgameinfo.com> <2288826.1793368099@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