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 1gWksi-0001X5-Em for pgsql-general@arkaria.postgresql.org; Tue, 11 Dec 2018 16:27:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gWksh-0004lC-4K for pgsql-general@arkaria.postgresql.org; Tue, 11 Dec 2018 16:27:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWksg-0004l5-PE for pgsql-general@lists.postgresql.org; Tue, 11 Dec 2018 16:27:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWkse-0003xR-Dh for pgsql-general@postgresql.org; Tue, 11 Dec 2018 16:27:33 +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 wBBGRTs9019175; Tue, 11 Dec 2018 11:27:29 -0500 From: Tom Lane To: jose luis pillado cc: pgsql-general@postgresql.org Subject: Re: Search path & functions in temporary schemas In-reply-to: References: Comments: In-reply-to jose luis pillado message dated "Tue, 11 Dec 2018 17:04:25 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19173.1544545649.1@sss.pgh.pa.us> Date: Tue, 11 Dec 2018 11:27:29 -0500 Message-ID: <19174.1544545649@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk jose luis pillado writes: > This solution worked with a real schema, but it did not with a temporary > one. ... > Is there any way to make this work? The temp schema is intentionally excluded from the search path for functions and operators, because otherwise it's just too easy to trojan-horse things. If you really want to create and call a temp function, you have to schema-qualify its name when you call it. To make that a bit less messy, you can use "pg_temp" as an alias for your session's temp schema, rather than having to find out which numbered temp schema you're really using. regards, tom lane