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 1r40b8-006z9J-0E for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Nov 2023 15:17:34 +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 1r40b2-00EYFa-G7 for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Nov 2023 15:17:28 +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 1r40b2-00EYFR-7L for pgsql-bugs@lists.postgresql.org; Fri, 17 Nov 2023 15:17:28 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r40az-0061zG-NA for pgsql-bugs@lists.postgresql.org; Fri, 17 Nov 2023 15:17:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3AHFHNA8564634; Fri, 17 Nov 2023 10:17:23 -0500 From: Tom Lane To: eric.cyr@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18202: pg_constraint data isn't refreshed when using alter rename to on a constraint trigger In-reply-to: <18202-0783b23955b5d2fd@postgresql.org> References: <18202-0783b23955b5d2fd@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Fri, 17 Nov 2023 14:31:35 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <564632.1700234243.1@sss.pgh.pa.us> Date: Fri, 17 Nov 2023 10:17:23 -0500 Message-ID: <564633.1700234243@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > When we rename a constraint trigger it seems like the name is not updated in > pg_constraint. Hmm, yeah ... renametrig() is intent on renaming the entry in pg_trigger, but I see no code there that pays any attention to pg_constraint. Conversely, ALTER TABLE RENAME CONSTRAINT updates the pg_constraint entry but not the associated trigger. It's not real clear to me whether this is intentional. There's no a-priori reason why the two objects have to have the same name; but I doubt we have pg_dump support for recreating a situation where they are different. [ experiments ... ] Interestingly, pg_dump seems to dump the name from pg_trigger not the one from pg_constraint. regards, tom lane