From: Bruce Momjian <bruce@momjian.us>
To: cestel@covermymeds.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13042: pg_upgrade --check succeeded but run failed due to missing thesaurus file
Date: Wed, 15 Apr 2015 21:01:34 -0400
Message-ID: <20150416010134.GA1672@momjian.us> (raw)
In-Reply-To: <20150413151005.2527.42400@wrigleys.postgresql.org>
References: <20150413151005.2527.42400@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On Mon, Apr 13, 2015 at 03:10:05PM +0000, cestel@covermymeds.com wrote:
> pg_restore: creating FUNCTION plainto_or_tsquery("text")
> pg_restore: creating FUNCTION to_weighted_tsvector("text")
> pg_restore: creating TEXT SEARCH DICTIONARY cmm_thesaurus
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 1745; 3600 60173 TEXT
> SEARCH DICTIONARY cmm_thesaurus postgres
> pg_restore: [archiver (db)] could not execute query: ERROR: could not open
> thesaurus file "/usr/pgsql-9.4/share/tsearch_data/cmm_thesaurus.ths": No
> such file or directory
> Command was: CREATE TEXT SEARCH DICTIONARY "cmm_thesaurus" (
> TEMPLATE = "pg_catalog"."thesaurus",
> dictfile = 'cmm_thesaurus', dic...
Uh, ideally pg_upgrade would be able to detect every possible case of
restore failure, but unfortunately it can't. It does look through
pg_proc and check that all shared object files referenced exist in the
new cluster. What it does not check, as you have seen, is for
dictionary files.
I looked at at how hard it would be to check for text search dictionary
files, and it looks hard. The file specification is stored in an SQL
text string:
test=> SELECT dictinitoption FROM pg_ts_dict;
dictinitoption
------------------------------------------------------------------
dictfile = 'mythesaurus', dictionary = 'pg_catalog.english_stem'
pg_upgrade would need to parse that string, then add a .ths extension to
the name, as specified here:
./backend/tsearch/dict_thesaurus.c:
filename = get_tsearch_config_filename(filename, "ths");
I don't see how this could be done easily, and yours is the first report
of this problem. I am happy that the debugging log files allowed you to
find the cause and complete the upgrade successfully.
I could document this limitation.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: bruce@momjian.us, cestel@covermymeds.com
Subject: Re: BUG #13042: pg_upgrade --check succeeded but run failed due to missing thesaurus file
In-Reply-To: <20150416010134.GA1672@momjian.us>
References: <20150413151005.2527.42400@wrigleys.postgresql.org> <20150416010134.GA1672@momjian.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