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: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: 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:27:25
Message-ID: CAKFQuwajVi8gsFDyWKSMy7Bxzx+CEUVrMArpKRap_OoY9wwY0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jun 22, 2022 at 9:11 PM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:

> Hi,
>
> On Wed, Jun 22, 2022 at 11:05:45PM +0000, PG Bug reporting form 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.
> >
> > 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...).
>
>
I think my only complaint here would be:

--
-- Name: test table 2 test trigger 2; Type: TRIGGER; Schema: testschema;
Owner: vagrant
--

CREATE TRIGGER "test trigger 2" BEFORE INSERT ON testschema."test table 2"
FOR EACH ROW EXECUTE FUNCTION public.do_nothing();

I suppose it's not a big deal that the name isn't parsable, but doing the
equivalent of: <quote_ident($table_name) quote($trigger_name)> would have
merit.

Also, the argument about name uniqueness only extends to "within a given
schema" yet we placed the schema name into its own section.

Again, I don't see much need to make a change so far, but given an
compelling use case not otherwise readily solvable it would be something to
entertain, IMO.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-06-23 04:29:18 Re: BUG #17530: pg_dump comment on triggers is "off" by comparison to all of the other objects...
Previous 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...