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 1sbLRk-00Fup9-QB for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2024 14:45:56 +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 1sbLRj-000MtN-Cn for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2024 14:45:55 +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 1sbLRi-000MrQ-OJ for pgsql-hackers@lists.postgresql.org; Tue, 06 Aug 2024 14:45:55 +0000 Received: from fhigh7-smtp.messagingengine.com ([103.168.172.158]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sbLRf-003OR8-TB for pgsql-hackers@postgresql.org; Tue, 06 Aug 2024 14:45:53 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 4EDA8114B060; Tue, 6 Aug 2024 10:45:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 06 Aug 2024 10:45:50 -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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1722955550; x= 1723041950; bh=fXyTxxvLm5DH6uneTaW3Vqh7N7SHLvkf9L6iFuBG5qo=; b=Z YcAxS89D0w18j7m1pvGy+4VTmzRnKrW5Ai3q+115psb3/KT/kAc2kL8SiqM3DEgO 3nu5BWqd6TT1iAhyynKFdXfHTpTOGBjqJ4fllCyCDPMK9306aFpltvG5lYvraHgX n/6IRcuxmsizyuZhkn3tyPmfQ2bd6t5SdidQkerNM0Q6o0kD0CHuUCd2pwU0lMlT GVmZZw0MXPiUtIAvsheq9FJ5p4Ty9AEq/FnI4F2jnCjlMO5ADp4c4SuWawYeXP1q cC+J76ljziSDKcTb2bus9P49tQkqnVyFp1NiORjj5d+q56xLLC1GQdeBNV7AEOCF erXpnJBQzWUZXGuZlTQSA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrkeekgdektdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtghpthhtoheptd X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Aug 2024 10:45:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1722955548; bh=yCLBmQ9zb+kNAjy5lGIxlEwO9LxpiZhtSF2HgnMIqcU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=EwG4kzEz+iblk9YgqdX4UpzGZaEcioLQzoK4SYNdhhNYDWdhO7HDaJkg9nUiPGdae D5NkDFGHuQpp9aClGAF/gjtBPY/hDqKk5NyuyBRIQ9DlcjvvzJWsTbONGEC0FaKEWa WoXfXPh71VbvZSD6ICi/F6NmKHgOt/Y1MTJl5V/BuFCB9TjyCu9yozBOZoEi1b3CxE 4NFX2d1E7yzOSbdkXd7xWQdMlKind7nlUY8pII/BjU+kXOFD4Q0BeGuhxWOB/s1tRO 1oVOvpcFtJ8d2NQ+hEN8F9yWdGNuPo0Ok54esmYCcCJVYkkzbnmrxDOj65WHuEKiqI 1MZwEG1tXLweA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 151F014DB; Tue, 6 Aug 2024 16:45:48 +0200 (CEST) Date: Tue, 6 Aug 2024 10:45:48 -0400 From: Alvaro Herrera To: Kirill Reshke Cc: pgsql-hackers Subject: Re: Support multi-column renaming? Message-ID: <202408061445.j6jnp6jpl5cg@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 2024-Aug-06, Kirill Reshke wrote: > I have noticed that ALTER TABLE supports multiple column actions > (ADD/DROP column etc), but does not support multiple column renaming. > Looking closely on gram.y, the only reason for this is that RenameStmt > is defined less flexible than alter_table_cmds (which is a list). All > other core infrastructure is ready to allow $subj. > > So is it worth a patch? Hmm, yeah, maybe it'd be better if ALTER TABLE RENAME is not part of RenameStmt but instead part of AlterTableStmt. Probably not a super trivial code change, but it should be doable. The interactions with different subcommands types in the same command should be considered carefully (as well as with ALTER {VIEW,SEQUENCE,etc} RENAME, which I bet we don't want changed due to the implications). -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Java is clearly an example of money oriented programming" (A. Stepanov)