Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iS10x-0003wp-Hx for pgsql-general@arkaria.postgresql.org; Tue, 05 Nov 2019 15:45:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iS10v-0007Qk-5T for pgsql-general@arkaria.postgresql.org; Tue, 05 Nov 2019 15:45:01 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iS10u-0007QE-SB for pgsql-general@lists.postgresql.org; Tue, 05 Nov 2019 15:45:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iS10s-0001Ww-Be for pgsql-general@lists.postgresql.org; Tue, 05 Nov 2019 15:45:00 +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 xA5FipIN009663; Tue, 5 Nov 2019 10:44:51 -0500 From: Tom Lane To: Adrian Klaver cc: Michael Shapiro , pgsql-general@lists.postgresql.org Subject: Re: select view definition from pg_views feature request In-reply-to: References: <31367.1572815723@sss.pgh.pa.us> Comments: In-reply-to Adrian Klaver message dated "Tue, 05 Nov 2019 07:01:37 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <9661.1572968691.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 05 Nov 2019 10:44:51 -0500 Message-ID: <9662.1572968691@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver writes: > On 11/5/19 6:43 AM, Michael Shapiro wrote: >> Can I set search_path='' (ie to a string that does not match any >> existing schema)? Would that be the proper way to guarantee that the >> definition for any view will always be fully-qualified? > [ example ] If you read the documentation about search_path, you'll find out that setting it to empty means that only the pg_catalog schema is present in the effective search path (and maybe your pg_temp schema, if you have created any temp tables). So system catalog references, references to built-in functions and operators, and temp table names will not be qualified. Everything else will be. regards, tom lane