Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nzhI4-0005OO-Dv for pgsql-admin@arkaria.postgresql.org; Fri, 10 Jun 2022 16:15:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nzhI3-00012U-5x for pgsql-admin@arkaria.postgresql.org; Fri, 10 Jun 2022 16:15:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nzhI2-00012D-Rm for pgsql-admin@lists.postgresql.org; Fri, 10 Jun 2022 16:15:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nzhI0-0003V8-Ip for pgsql-admin@postgresql.org; Fri, 10 Jun 2022 16:15:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 25AGF7612657054; Fri, 10 Jun 2022 12:15:07 -0400 From: Tom Lane To: Laurenz Albe cc: Pascal CROZET , pgsql-admin Subject: Re: ERROR: type "my_user_type" does not exist on REFRESH MATERIALIZED VIEW In-reply-to: References: Comments: In-reply-to Laurenz Albe message dated "Fri, 10 Jun 2022 17:57:04 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2657052.1654877707.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 10 Jun 2022 12:15:07 -0400 Message-ID: <2657053.1654877707@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > I would have to see the dump to be certain, but my guess is that you nee= d to make the function > independent from the current setting of "search_path" by schema-qualifyi= ng the data type: > DECLARE > _row my_schema.row_reporting_p; Yeah, that seems likely to be the explanation. The restore will be run under a restrictive search_path and functions that are not ready for that will fail. It may well be that this isn't the only search_path dependency in the function, in which case you might be better advised to add a "SET search_path" option to the function, instead of trying to fix all the references manually. regards, tom lane