Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffTVq-0005Kg-Av for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Jul 2018 17:11:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ffTVo-00049D-MH for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Jul 2018 17:11:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffTVo-000495-Fo for pgsql-bugs@lists.postgresql.org; Tue, 17 Jul 2018 17:11:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffTVm-0004sq-02 for pgsql-bugs@lists.postgresql.org; Tue, 17 Jul 2018 17:11:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w6HHBcWs017167; Tue, 17 Jul 2018 13:11:38 -0400 From: Tom Lane To: kwhickey@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15282: Materialized view with transitive TYPE dependency fails refresh using pg_restore and psql In-reply-to: <153184074037.1405.15097715315257989847@wrigleys.postgresql.org> References: <153184074037.1405.15097715315257989847@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Tue, 17 Jul 2018 15:19:00 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17165.1531847498.1@sss.pgh.pa.us> Date: Tue, 17 Jul 2018 13:11:38 -0400 Message-ID: <17166.1531847498@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Bug_reporting_form?= writes: > A materialized view runs a select query that uses a function on one of its > projected columns which internally uses an enum TYPE to map the column value > to an enum value. > Action and Resulting Error: > Trying to restore a database setup in the above way will fail with error: > ERROR: type "" does not exist If this started happening recently, the problem is likely that the type is not in the restrictive search_path that dump/restore now uses. You could possibly fix it just by schema-qualifying the type name in the function body. However, that may only let you get as far as the next failure of the same kind. A better fix is to add a "SET search_path" clause to the function definition so that it works independently of what the caller's search path is. regards, tom lane