Re: pg_restore --no-policies should not restore policies' comment - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: pg_restore --no-policies should not restore policies' comment
Date
Msg-id CAHGQGwGaO+kCXrKAjKLtoeF6y6VrR5HJ8_1BW644wa8Z9=cdhw@mail.gmail.com
Whole thread Raw
In response to Re: pg_restore --no-policies should not restore policies' comment  (jian he <jian.universality@gmail.com>)
Responses Re: pg_restore --no-policies should not restore policies' comment
List pgsql-hackers
On Thu, Sep 4, 2025 at 6:00 PM jian he <jian.universality@gmail.com> wrote:
> in _tocEntryRestorePass
> if we do
>
>     if ((strcmp(te->desc, "COMMENT") == 0 ||
>          strcmp(te->desc, "SECURITY LABEL") == 0) &&
>         strncmp(te->tag, "EVENT TRIGGER ", 14) == 0)
>         return RESTORE_PASS_POST_ACL;
>
> then RestorePass related comments also need to be adjusted for security label?

Could you clarify which comments should be updated for SECURITY LABEL?
I don't see any references to COMMENT in RestorePass, so it doesn't look
like any updates are needed there for SECURITY LABEL either. But maybe
I'm missing something...


> we do not support security label on extension, see SecLabelSupportsObjectType.
> below the dumpExtension function code should be removed?
>
>    /* Dump Extension Comments and Security Labels */
>     if (extinfo->dobj.dump & DUMP_COMPONENT_SECLABEL)
>         dumpSecLabel(fout, "EXTENSION", qextname,
>                      NULL, "",
>                      extinfo->dobj.catId, 0, extinfo->dobj.dumpId);

Good catch! This code was introduced in commit d9572c4e3b4,
which added core support for extensions. Since security labels on
extensions are not supported, I agree that the code should be
removed in master.

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: 邱宇航
Date:
Subject: Re: Memory leak of SMgrRelation object on standby
Next
From: Dilip Kumar
Date:
Subject: Re: Potential problem in commit f777d773878 and 4f7f7b03758