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 1nC2Ns-00017z-4J for pgsql-general@arkaria.postgresql.org; Mon, 24 Jan 2022 16:40:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nC2Nr-00018r-0e for pgsql-general@arkaria.postgresql.org; Mon, 24 Jan 2022 16:39:59 +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 1nC2Np-00018c-Pe for pgsql-general@lists.postgresql.org; Mon, 24 Jan 2022 16:39:58 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nC2Nm-0001Lu-Uo for pgsql-general@postgresql.org; Mon, 24 Jan 2022 16:39:56 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 86BFE5C020E; Mon, 24 Jan 2022 11:39:53 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 24 Jan 2022 11:39:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; bh=JOyRqDOe4oAf71 AXD6CXNDhWwxKjBl+9DEQglgyoMXo=; b=LdMDF8yDqjqTZadNyEHc7ZA5mgaJ04 5zCwzPcY7DYua+U3sYTaU9QDmoXTZME9WKyh3rgy7aFwZplmO7jG1+zCH36gKPZz V8PaRX/+hAjLibzjftnpSrJzhmRFqyNNB6+NMjwpDMPj6+jAzKluzruyCXFumYJj Kib7pMcFjBehUpLK+k/880ciOkU2ZSJ0kxf54GheBbG/2+55hUqeDxOZ3uvwief8 OvfW6ZegcomV5OZw8b8/z+D2T5eBqGp1G/09Gmlclhn0MLKeUCcZNZUvzzgFURIf +J/1hN6m67dmWeoa+k4WePmEUZE0jgz7XClyFDTv3Wr9LWkY0kmw5v6g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=JOyRqDOe4oAf71AXD6CXNDhWwxKjBl+9DEQglgyoM Xo=; b=nd5BHCjg19bQrIEEQ0CClq/WISX0tusnc634G8hShsQTUNiSGjNHkz5ao 8Z6TnfPGZ6fls/nqeXzmEAgomU+bclhkGrFk9ShvgeMsJLHOk32sMQ1rIFvrMF+X xR8Vg9ggI71Kqh4leKhEb+wKpGCusqBxFDTuSR/7SL59IVuO7WdhFK53JH6P1Xbb sczlOqjavRlhr5Ykma4dmbJfJo8kAgGQJKN87as8DXW9Hy7dN+eMr9vq9wj+HdER aQU0sHM55QD2b0NGdQu28Xjzehm6CJ4Fq71V21O6V1KgU28B+fdNmXhw7OV+kSh3 i/x8iFPLk65510+EDwfD4w8GKYzoQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvdeigdelfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepffduhedtudeggfekveduffehveevhfeftedthfeviedv gfeigefhieeugefggfegnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgr nhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Jan 2022 11:39:52 -0500 (EST) Message-ID: <109455c1-9dd1-70e7-ddc5-957cc65c64c5@aklaver.com> Date: Mon, 24 Jan 2022 08:39:51 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: Cannot find hstore operator Content-Language: en-US To: Dominique Devienne , "David G. Johnston" Cc: Tom Lane , Paul van der Linden , pgsql-general References: <856144.1642687523@sss.pgh.pa.us> <1585432.1642951326@sss.pgh.pa.us> From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/24/22 08:27, Dominique Devienne wrote: > On Mon, Jan 24, 2022 at 3:48 PM David G. Johnston > wrote: >> On Monday, January 24, 2022, Dominique Devienne wrote: >>> >>> After re-reading >>> https://www.postgresql.org/docs/14/sql-createfunction.html in light of >>> Tom's answer, >>> does that mean that our `SET search_path TO {0}, 'pg_temp'` >>> workaround, in the trigger below, >>> to not depend on the search_path at runtime: >>> >> >> The general trigger documentation is kind enough to point out that the sql language cannot be used to write trigger functions. > > OK, failr enough... > > But what about: >> I'd really like my DDL statements to NOT contain schema-specific names, >> to ensure proper name resolution independent of the search_path and >> completely "self-contained" in the schema itself. >> Is there any way to achieve that, beside our current `SET search_path` workaround? > > Could I please get a definitive answer about this? > > David, in the "clone-schema" thread, you kind of implied I shouldn't > have a set search_path in the triggers, > thus making my DDL schema-specific, but then when I ask about ways to If I am following your code and objects are schema specific so there is no way to avoid this. > avoid thus, and have "static" resolution > of names in those trigger functions, I'm not getting alternatives. > > Am I the only one to think that a session w/o a seach_path, which > fully qualifies table names, > should behaves exactly the same way than another session that has a > search_path and does not fully qualify table names? Objects end up being found in a schema, either you specify that schema when using the object or the server walks the search_path to find the first schema where an object with the name exists. > Because that's the only reason I added a set search_path to our > trigger functions. The alternative being to fully-qualify > all object references in those trigger functions, making the DDL even > more "schema-specific". it feels like a catch-22... > > I'm not trying to be difficult here... I'm trying to understand, FWIW. --DD > > PS: Does INVOKER vs DEFINER affect name resolution? Does that apply to > trigger functions? > > -- Adrian Klaver adrian.klaver@aklaver.com