Re: Support multi-column renaming?

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support multi-column renaming?
Date: 2024-08-06 14:45:48
Message-ID: 202408061445.j6jnp6jpl5cg@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-08-06 14:49:32 Re: Fix comments in instr_time.h and remove an unneeded cast to int64
Previous Message Kirill Reshke 2024-08-06 14:29:09 Re: Incremental View Maintenance, take 2