Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yq3vO-0000Gj-MZ for pgsql-bugs@arkaria.postgresql.org; Wed, 06 May 2015 18:20:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yq3vO-0001pQ-1b for pgsql-bugs@arkaria.postgresql.org; Wed, 06 May 2015 18:20:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yq3vN-0001ox-2k for pgsql-bugs@postgresql.org; Wed, 06 May 2015 18:20:01 +0000 Received: from mout.gmx.net ([212.227.17.22]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.84) (envelope-from ) id 1Yq3vK-000889-55 for pgsql-bugs@postgresql.org; Wed, 06 May 2015 18:20:00 +0000 Received: from auth1-smtp.messagingengine.com ([66.111.4.227]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lkjuq-1ZQVCb00ZA-00aS9x for ; Wed, 06 May 2015 20:19:57 +0200 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 4F05A20DEC for ; Wed, 6 May 2015 14:19:54 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 06 May 2015 14:19:54 -0400 X-Sasl-enc: G3oNTh8aP4Lv2LKcPFQlx8XBK9I0Jo/eWgMYOI16GES3 1430936394 Received: from [192.168.1.147] (unknown [204.145.120.11]) by mail.messagingengine.com (Postfix) with ESMTPA id 014086800DB; Wed, 6 May 2015 14:19:53 -0400 (EDT) Message-ID: <554A5B49.5000107@gmx.net> Date: Wed, 06 May 2015 14:19:53 -0400 From: Peter Eisentraut User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Corey Huinker , Michael Paquier CC: pgsql-bugs@postgresql.org Subject: Re: BUG #13179: pg_upgrade failure. References: <20150427211555.2546.8955@wrigleys.postgresql.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:6ul71u5SLJqB4SUuK7NzcTMvhmjGgEvKIvloiGgqAfUp2GZzzfV rDMyjeEdfp0LQ9QYXWIQk5smWX0J1vu/6SEqGCndsymLZFX3PYSyXvhY0tvThFqhy/tfI8u qK1FZeaHULUJ64BgSigG5nzkJqGjTLMbKBtw0JAx1ZVHVyH52HS/inAVOBaPNWyYpyQT+d0 FZ4/FmyLKFdeiPNNIubOw== X-UI-Out-Filterresults: notjunk:1; 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 5/6/15 12:09 PM, Corey Huinker wrote: > Apologies for the delay, machine availability was an issue. > > Steps to reproduce. > > 1. Create a 9.3 instance. > 2. Create a database in that instance, run this script in that instance: > > > begin; > > create type custom_type_t as enum('one','two'); > > create function pointless_function() returns custom_type_t > language sql immutable as $$ > select 'one'::custom_type_t; > $$; This function definition does not record the current schema path, so the function will fail to execute when run under a different schema setting. You should either explicitly qualify custom_type_t in the body or use SET search_path FROM CURRENT in the definition. > > create schema other_schema; > > create materialized view other_schema.some_mview > as > select pointless_function() as pointless_value; > > end; > > > 3. Install 9.4 and attempt a pg_upgrade migration. > > Error log is as follows. > > > command: "/usr/lib/postgresql/9.4/bin/pg_dump" --host "/tmp" --port > 50432 --username "postgres" --schema-only --quote-all-identifiers > --binary-upgrade --format=custom > --file="pg_upgrade_dump_16384.custom" "pg_upgrade_bug" >> > "pg_upgrade_dump_16384.log" 2>&1 > > > command: "/usr/lib/postgresql/9.4/bin/pg_restore" --host "/tmp" > --port 50432 --username "postgres" --exit-on-error --verbose > --dbname "pg_upgrade_bug" "pg_upgrade_dump_16384.custom" >> > "pg_upgrade_dump_16384.log" 2>&1 > pg_restore: connecting to database for restore > pg_restore: creating pg_largeobject pg_largeobject > pg_restore: creating pg_largeobject_metadata pg_largeobject_metadata > pg_restore: creating SCHEMA other_schema > pg_restore: creating SCHEMA public > pg_restore: creating COMMENT SCHEMA "public" > pg_restore: creating TYPE custom_type_t > pg_restore: creating FUNCTION pointless_function() > pg_restore: creating MATERIALIZED VIEW some_mview > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Error from TOC entry 171; 1259 16421 > MATERIALIZED VIEW some_mview postgres > pg_restore: [archiver (db)] could not execute query: ERROR: type > "custom_type_t" does not exist > LINE 2: select 'one'::custom_type_t; > ^ > QUERY: > select 'one'::custom_type_t; > > CONTEXT: SQL function "pointless_function" during startup > Command was: > -- For binary upgrade, must preserve pg_type oid > SELECT binary_upgrade.set_next_pg_type_oid('16423'::pg_catalog.oid); > > > -- ... -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs