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 1gOsA6-0001zI-Gz for pgsql-general@arkaria.postgresql.org; Mon, 19 Nov 2018 22:36:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gOsA4-00029j-Di for pgsql-general@arkaria.postgresql.org; Mon, 19 Nov 2018 22:36:56 +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 1gOsA4-00029c-5Y for pgsql-general@lists.postgresql.org; Mon, 19 Nov 2018 22:36:56 +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 1gOsA2-0007CS-5a for pgsql-general@postgresql.org; Mon, 19 Nov 2018 22:36:55 +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 wAJMapCN031927; Mon, 19 Nov 2018 17:36:51 -0500 From: Tom Lane To: Merlin Moncure cc: david.day@redcom.com, PostgreSQL General Subject: Re: plpgsql and intarray extension; int[] - int[] operator does not exist ? In-reply-to: References: <0fd14b7dff1741b988d4f907af745cc4@exch-02.redcom.com> <15705.1542650179@sss.pgh.pa.us> Comments: In-reply-to Merlin Moncure message dated "Mon, 19 Nov 2018 14:34:32 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31925.1542667011.1@sss.pgh.pa.us> Date: Mon, 19 Nov 2018 17:36:51 -0500 Message-ID: <31926.1542667011@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Merlin Moncure writes: > On Mon, Nov 19, 2018 at 11:56 AM Tom Lane wrote: >> The search_path in the trigger probably doesn't include public. >> You could add a "SET search_path = whatever" clause to the trigger >> function definition to ensure it runs with a predictable path. > Might be worth considering: > SET LOCAL search_path = whatever > So that LOCAL makes the change local to the transaction. What I was suggesting was to create the trigger function using create function ... as $$ ...body... $$ set search_path = whatever; That makes the setting local to each function call. regards, tom lane