Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YiYBe-0005Qu-RR for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Apr 2015 01:01:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YiYBd-0007W0-Kj for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Apr 2015 01:01:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YiYBb-0007Vr-Mh for pgsql-bugs@postgresql.org; Thu, 16 Apr 2015 01:01:43 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YiYBV-0005if-Ad for pgsql-bugs@postgresql.org; Thu, 16 Apr 2015 01:01:40 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1YiYBS-0002VA-Ch; Wed, 15 Apr 2015 21:01:34 -0400 Date: Wed, 15 Apr 2015 21:01:34 -0400 From: Bruce Momjian 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 Message-ID: <20150416010134.GA1672@momjian.us> References: <20150413151005.2527.42400@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150413151005.2527.42400@wrigleys.postgresql.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 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