pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Arne Roland <A.Roland@index.de>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Rename of triggers for partitioned tables
Date: Mon, 19 Jul 2021 21:39:04 -0400
Message-ID: <202107200139.5zceapxcs6z7@alvherre.pgsql> (raw)
In-Reply-To: <004683a28e714bf3beb9a413a2ffbcb9@index.de>

On 2021-Jul-20, Arne Roland wrote:

> Is your patch based on master? It doesn't apply at my end.

It does ... master being dd498998a3 here,

$ patch -p1 < /tmp/renametrig-8.patch 
patching file src/backend/commands/trigger.c
patching file src/backend/parser/gram.y
patching file src/test/regress/expected/triggers.out
patching file src/test/regress/sql/triggers.sql

applies fine.

>> I don't think we need to give a NOTICE when the trigger name does not
>> match; it doesn't really matter that the trigger was named differently
>> before the command, does it?

> I'd expect the command
> ALTER TRIGGER name ON table_name RENAME TO new_name;
> to rename a trigger named "name". We are referring the trigger via it's name after all. If a child is named differently we break with that assumption. I think informing the user about that, is very valuable.

Well, it does rename a trigger named 'name' on the table 'table_name',
as well as all its descendant triggers.  I guess I am surprised that
anybody would rename a descendant trigger in the first place.  I'm not
wedded to the decision of removing the NOTICE, though  ... are there any
other votes for that, anyone?

Thanks

-- 
Álvaro Herrera           39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/





view thread (42+ messages)  latest in thread

Message-ID: <202107200139.5zceapxcs6z7@alvherre.pgsql>
Permalink:  ../202107200139.5zceapxcs6z7@alvherre.pgsql/
Also on:    postgresql.org/message-id/202107200139.5zceapxcs6z7@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, A.Roland@index.de, vignesh21@gmail.com, zyu@yugabyte.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Rename of triggers for partitioned tables
  In-Reply-To: <202107200139.5zceapxcs6z7@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox