Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rH4um-000wEB-A5 for pgsql-general@arkaria.postgresql.org; Sat, 23 Dec 2023 16:31:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rH4ui-002mav-JU for pgsql-general@arkaria.postgresql.org; Sat, 23 Dec 2023 16:31:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rH4ug-002man-PS for pgsql-general@lists.postgresql.org; Sat, 23 Dec 2023 16:31:48 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rH4ud-00BqSm-9g for pgsql-general@lists.postgresql.org; Sat, 23 Dec 2023 16:31:45 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 9F9A55C00C9; Sat, 23 Dec 2023 11:31:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 23 Dec 2023 11:31:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1703349101; x=1703435501; bh=GZeLqn5EqvX7PyqLj2lMRSm/Uoz7qmiUD0PfOE8hm+o=; b= JOlvFwXhbqyWFRDHBwnAPGoccrN3XetQB/mvpTwJARu5KUejjqrOfRyKMAsxCUCr L+fPS5NPkV6DU4D5s8KzB5eaxwpGIwD89+2DxILCmiZB4YO1uIs+vXCnhfgHSYKJ P2UHY70YU0CtbEx+OZSjj/jf1v9npHv4GUP/G/wSrDcycsIO3Kfl0mlK930WJK7W Int+o7ye5xhDuI246BJc/RaKp1ckWtoms1k9Za1sO7eE/Mhqm+teBJ8VNMNZmdXI Td+j+43p8gUwwDH8m52AMmvEiBKFa7k+8sRz1PiM8/81pJzaF8TjCq2G5yC6HIq5 kXMRd8aKowvEVr2lG2qoaw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1703349101; x= 1703435501; bh=GZeLqn5EqvX7PyqLj2lMRSm/Uoz7qmiUD0PfOE8hm+o=; b=a e7KAPAo0rLV3Rml/bY3MfK/s8mTziKlpwVCOx3hJbHt46hw3mq42z96bEKpXhgCi luI4FLiBM0AXD1Xcx3HC4g+QBWj+p1yLR2QCPYy+7/5+sAiu2GYmA25VvXIQZdM5 Ajah1NonK5818CHkTOm+JnJ4WGXE/vhXZnhNXfQ/s7gPWoA5XDeTxv9Lrh/PFWQy TOQs/SHegtEf/ZC4zZ/7gkyHzgaC6IOfiFZQVehPPNGF5t38FOsgENLxbI0ayzL1 S8HYSqBtscvs9HmLw5F+s+Csbmu/ybniuoEXwpxyIohyY4BoRI0pWcaCUUvUHKco nhe4Wd3aGHZCFbX7s44og== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdduledgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhephfeviefhveelffeftdehudekveefhfeftdegieef veetfffgfeehtdfftedutedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Dec 2023 11:31:40 -0500 (EST) Message-ID: <90ca8707-6f44-47c2-b781-0138947d7483@aklaver.com> Date: Sat, 23 Dec 2023 08:31:39 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Changing a schema's name with function1 calling function2 To: Wilma Wantren Cc: pgsql-general@lists.postgresql.org References: <9ed1070f8561f048e72c3a3683565d97@mail.eclipso.de> <07aac10034aaf87697ae401475f48909@mail.eclipso.de> <4cb2e7242b54e84f9d0c161cc56f38e4@mail.eclipso.de> <09a7102b697d2b2acd81cb12344b0170@mail.eclipso.de> Content-Language: en-US From: Adrian Klaver In-Reply-To: <09a7102b697d2b2acd81cb12344b0170@mail.eclipso.de> 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 12/23/23 08:12, Wilma Wantren wrote: > Thank you! > I had already feared that such a variable does not exist (because I had not found it). I think that's a pity, because I suspect that in at least 90% of the cases where a function needs a search_path, this variable would be the value of the search_path, so that in 90% of the cases no change to the search_path would be necessary after renaming the schema. I would say the issue is with this from your previous post: "Therefore it would be great if there was a variable which I could set in a search_path (like the variable "$user") which denotes the function's schema and which is only evaluated when the function is executed, i.e. the variable would be the value of the function's search_path in the function's meta data." search_path can be set(just off the top of head): postgresql.conf and it's include files ALTER DATABASE ALTER FUNCTION ALTER ROLE ALTER SYSTEM At any point by a user/script/function/etc. Even if such a variable existed you be chasing down the 'correct' version of search_path that had it. Basically where you are now. > Many thanks for the reference to sqitch, I'll have a look at that now. > > -- Adrian Klaver adrian.klaver@aklaver.com