Re: BUG #17530: pg_dump comment on triggers is "off" by comparison to all of the other objects...

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: wolakk(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17530: pg_dump comment on triggers is "off" by comparison to all of the other objects...
Date: 2022-06-23 04:02:01
Message-ID: CAKFQuwaCSqBk8ZrjL5ckzRzg1xXwXx2fWuTj-uQjOF5NOWKRLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jun 22, 2022 at 8:29 PM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 17530
> Logged by: Kirk Wolak
> Email address: wolakk(at)gmail(dot)com
> PostgreSQL version: 14.3
> Operating system: Windows
> Description:
>
> I've been parsing through the file for our own system, and discovered the
> Name: <value>
> for the trigger is not quite the name of the trigger. I've included an
> example of FUNCTIon for reference.
>

A function is a standalone object where a trigger cannot exist without
being attached to a trigger. Extrapolating the behavior of the later from
the former is not all that productive. It definitely doesn't constitute
evidence of a bug.

>
> It's "change_log"<space>"id_change_log"; but the actual trigger name is
> "id_change_log" on the table "change_log"
>

Parent -> Child is a very common way to write this kind of thing so the
order seems perfectly fine.

>
> I would have EXPECTED $ as the function has, but that's part of it's "name"
> in the function case.
>

I would think introducing a symbol that physically joins the two components
together would be more confusing, not less. One might come to assume it
really is the full actual name of the trigger when it is not.

> Basically, it's not the correct name. It should simply be "id_change_log"
> (IMO, to be consistent with every other comment I've seen)
>

You'll have to show the table name somewhere. If you change this to be
just the object name (which has merit) what do you do with that? No matter
what you do triggers are unique and so will have some unique aspect to
them. Lacking some other similar parent->child but independent object
(i.e., not columns) object to compare against, and the fact this is both
structured (I am curious what it does for names that require double-quotes,
can that space be relied upon to be unambiguous?) and mostly meant for
human consumption, I'd be inclined to leave well enough alone.

########### Issue is here:
> --
> -- Name: change_log id_change_log; Type: TRIGGER; Schema: logspc; Owner:
> postgres
> --
>
> CREATE TRIGGER id_change_log BEFORE INSERT ON logspc.change_log [...]

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Julien Rouhaud 2022-06-23 04:11:01 Re: BUG #17530: pg_dump comment on triggers is "off" by comparison to all of the other objects...
Previous Message David G. Johnston 2022-06-23 03:45:26 Re: BUG #17529: SQL Error [57P01]: FATAL: terminating connection due to administrator command