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 1m1aeh-0007lG-03 for pgsql-general@arkaria.postgresql.org; Thu, 08 Jul 2021 20:29:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m1aef-0008Me-St for pgsql-general@arkaria.postgresql.org; Thu, 08 Jul 2021 20:29:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1aef-0008MV-KG for pgsql-general@lists.postgresql.org; Thu, 08 Jul 2021 20:29:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1aed-0001iW-Jc for pgsql-general@lists.postgresql.org; Thu, 08 Jul 2021 20:29:53 +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 168KTncD2041982; Thu, 8 Jul 2021 16:29:49 -0400 From: Tom Lane To: "David G. Johnston" cc: Christopher Causer , "pgsql-generallists.postgresql.org" Subject: Re: pg_dump's restore gives "operator does not exist: public.iprange = public.iprange" but copy paste works In-reply-to: References: <8a602a2a-e0b8-42ef-8468-21fa2eb25bd9@www.fastmail.com> <2040892.1625774942@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Thu, 08 Jul 2021 13:24:13 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2041980.1625776189.1@sss.pgh.pa.us> Date: Thu, 08 Jul 2021 16:29:49 -0400 Message-ID: <2041981.1625776189@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > IIUC, functions can force a search_path even during dump/restore by being > created with one specified as part of the create function command. Since > the issue is with stored objects moreso than queries generically is it > feasible to approach the view solution by adding a "SET" clause to CREATE > VIEW as well? Don't see the point. The issue here is what search_path applies at view definition time, and you have syntax to control that today: SET search_path = whatever; CREATE VIEW ... ; RESET search_path; So the problem is not lack of a server feature, it's persuading pg_dump to emit something other than what it does now. regards, tom lane