From: Tom Lane <tgl@sss.pgh.pa.us>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: wolakk@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17530: pg_dump comment on triggers is "off" by comparison to all of the other objects...
Date: Thu, 23 Jun 2022 00:29:18 -0400
Message-ID: <3760003.1655958558@sss.pgh.pa.us> (raw)
In-Reply-To: <20220623041101.yuhz6euhtekectkt@jrouhaud>
References: <17530-a13411896e59c64a@postgresql.org>
<20220623041101.yuhz6euhtekectkt@jrouhaud>
Julien Rouhaud <rjuju123@gmail.com> writes:
> On Wed, Jun 22, 2022 at 11:05:45PM +0000, PG Bug reporting form wrote:
>> It's "change_log"<space>"id_change_log"; but the actual trigger name is
>> "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
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rjuju123@gmail.com, 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: <3760003.1655958558@sss.pgh.pa.us>
* 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