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 1qWfKt-003zVy-S2 for pgsql-general@arkaria.postgresql.org; Thu, 17 Aug 2023 15:55:00 +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 1qWfKs-001jZK-1j for pgsql-general@arkaria.postgresql.org; Thu, 17 Aug 2023 15:54:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWfKq-001jZA-Uf for pgsql-general@lists.postgresql.org; Thu, 17 Aug 2023 15:54:57 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWfKm-000h01-RJ for pgsql-general@lists.postgresql.org; Thu, 17 Aug 2023 15:54:56 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A8EFE5C00C3; Thu, 17 Aug 2023 11:54:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 17 Aug 2023 11:54:49 -0400 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 :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1692287689; x= 1692374089; bh=qxilCjTaavP0pObIP1v4ODkxUcYD/lrwWRtXhlFkJnc=; b=O jzp2XMu+3WYZOn2cIqRYZT3gpYq0j00W+9cmJ6oIKM28XTnMv19UIRSeUtVI6WOz UNVf3Eiv1g3GSxsnZ2p/ZVIQDtkVAh9fJJgzFemWTW0QdlRuJBtukR7iroZrwvF/ WSlwOZQm6YayLcpKnStZMMoumxvuwq10EiRkxACbkMR6E3RzWOZUwnZOO+CXSrgx mztisCK22roMchu+Nt5VoOmALMkULdjcZ6ruiTZ3HTDdNdf47RS5JxybP1f8eAhw O/TAaoapFv51xaDpX8SYZ4UwJnWBq8ZJ8hNANkhjMzMarqn3ul6S0DHe7z7ALNUL DqutDk5umWfKVdFgqMtkg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudduuddgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Aug 2023 11:54:49 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 96F4CE3; Thu, 17 Aug 2023 17:54:45 +0200 (CEST) Date: Thu, 17 Aug 2023 17:54:45 +0200 From: Alvaro Herrera To: Lorusso Domenico Cc: pgsql-general@lists.postgresql.org Subject: Re: Schema renaming cascade Message-ID: <20230817155445.lr33wx2eupzu2eqf@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Aug-17, Lorusso Domenico wrote: > Hello guys, > I need to rename a schema, including each reference to it (also for > functions) Maybe you should consider removing schema name references in function source code, and instead refer to the tables (and other functions, etc) by their unqualified names, and at the same time attach a "SET search_path" clause to the function. That way, when you need to rename the schema you don't need to change the function source code, just update its "SET search_path" clause. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/