Re: BUG #15460: Error while creating index or constraint
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: paul.vanderlinden@mapcreator.eu
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>,
Heikki Linnakangas <hlinnaka@iki.fi>
Date: 2018-10-29T13:04:58Z
Lists: pgsql-bugs
On Mon, Oct 29, 2018 at 12:53 PM Peter Geoghegan <pg@bowt.ie> wrote:
> Is it possible for you to provide me with a dump of the data, or a
> minimal test case? You can provided it to me off-list if that's
> easier, possibly using Google drive or something. I realize that the
> amount of data involved here isn't trivial, so this may be difficult.
It might also be helpful to see if amcheck shows any problems with the
indexes you can create without error. You could run:
CREATE EXTENSION amcheck;
SELECT bt_index_check(index => c.oid, heapallindexed => true),
c.relname,
c.relpages
FROM pg_index i
JOIN pg_opclass op ON i.indclass[0] = op.oid
JOIN pg_am am ON op.opcmethod = am.oid
JOIN pg_class c ON i.indexrelid = c.oid
JOIN pg_namespace n ON c.relnamespace = n.oid
WHERE am.amname = 'btree'
-- Don't check temp tables, which may be from another session:
AND c.relpersistence != 't'
-- Function may throw an error when this is omitted:
AND c.relkind = 'i' AND i.indisready AND i.indisvalid
ORDER BY c.relpages DESC;
Hopefully this won't find any problems/raise any errors, but if it
does then they'll likely be relevant. It might take several minutes to
run the query, or maybe even several hour if there is lots of data.
You may have to use your own judgement when it comes to determining
what's worth checking, and what you don't have time to check (e.g.,
add something extra to the where clause, so that only some indexes get
checked). I'm suggesting this because it isn't very much work, and may
shed some light on the problem. Though the likelihood is that it won't
find anything wrong.
--
Peter Geoghegan
Commits
-
Have BufFileSize() ereport() on FileSize() failure.
- 1a990b207b86 12.0 landed
- 95c45718126f 11.2 landed
-
Use 64 bit type for BufFileSize().
- fa2ceaca4358 11.2 landed
- aa5518304213 12.0 landed
-
Adjust trace_sort log messages.
- cb6f8a9a7243 12.0 landed
- 886319d71bd5 11.1 landed
-
Fix some sloppiness in the new BufFileSize() and BufFileAppend() functions.
- 445e31bdc749 11.0 cited