Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o4ET5-00083q-N7 for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Jun 2022 04:29:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o4ET4-0006sV-Ju for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Jun 2022 04:29:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o4ET4-0006mS-Bo for pgsql-bugs@lists.postgresql.org; Thu, 23 Jun 2022 04:29:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o4ET1-0006Qm-RH for pgsql-bugs@lists.postgresql.org; Thu, 23 Jun 2022 04:29:21 +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 25N4TIXC3760004; Thu, 23 Jun 2022 00:29:18 -0400 From: Tom Lane To: Julien Rouhaud cc: wolakk@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17530: pg_dump comment on triggers is "off" by comparison to all of the other objects... In-reply-to: <20220623041101.yuhz6euhtekectkt@jrouhaud> References: <17530-a13411896e59c64a@postgresql.org> <20220623041101.yuhz6euhtekectkt@jrouhaud> Comments: In-reply-to Julien Rouhaud message dated "Thu, 23 Jun 2022 12:11:01 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3760002.1655958558.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 23 Jun 2022 00:29:18 -0400 Message-ID: <3760003.1655958558@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Julien Rouhaud writes: > On Wed, Jun 22, 2022 at 11:05:45PM +0000, PG Bug reporting form wrote: >> It's "change_log""id_change_log"; but the actual trigger name i= s >> "id_change_log" on the table "change_log" > That's expected, the name in the comment has a qualifier when the object= name > itself isn't guaranteed to be unique, with the format > "$table_name $trigger_name" > This is done similarly for all object types that don't have a guarantee = of > unique name (policies, rules...). Right. A couple further observations: * The relevant object names here are those of the table and trigger. The OP seems to be confusing this with the name of the function that the trigger uses --- but that could be completely different. * There's not been any attempt to make the comment labels be guaranteed-unique or machine-parseable. If, say, you made a table or trigger name that contains a space, it'd be hard to tell by looking at the pg_dump comment which space separates the table name from the trigger name, versus which one(s) are part of one of those names. If we were doing this from scratch today we'd probably be more rigorous ... but it's been like this for twenty-ish years, and I doubt there's a lot of appetite for redefining it now. regards, tom lane