Re: BUG #13042: pg_upgrade --check succeeded but run failed due to missing thesaurus file

From: CJ Estel <CEstel(at)covermymeds(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13042: pg_upgrade --check succeeded but run failed due to missing thesaurus file
Date: 2015-04-16 14:23:54
Message-ID: D1553A8A.11067%cestel@covermymeds.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks for looking into this. Updating the documentation would be great.
If it is easy to throw a warning message that thesauri were found and
should be copied to the new location that would help people as well, even
if it doesn't do the actual check for the existence of the files.

On 4/15/15, 9:01 PM, "Bruce Momjian" <bruce(at)momjian(dot)us> wrote:

>On Mon, Apr 13, 2015 at 03:10:05PM +0000, cestel(at)covermymeds(dot)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(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> + Everyone has their own god. +

This electronic transmission is confidential and intended solely for the addressee(s). If you are not an intended addressee, do not disclose, copy or take any other action in reliance on this transmission. If you have received this transmission in error, please delete it from your system and notify CoverMyMeds LLC at privacy(at)covermymeds(dot)com(dot) Thank you.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message rogerwinter 2015-04-16 14:56:44 BUG #13066: Package postgresql92-odbc has problems
Previous Message Andres Freund 2015-04-16 13:12:39 Re: BUG #12910: Memory leak with logical decoding