Re: pg_restore --no-policies should not restore policies' comment

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_restore --no-policies should not restore policies' comment
Date: 2025-09-09 04:00:15
Message-ID: CAHGQGwGaO+kCXrKAjKLtoeF6y6VrR5HJ8_1BW644wa8Z9=cdhw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 4, 2025 at 6:00 PM jian he <jian(dot)universality(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2025-09-09 04:40:42 Re: Potential problem in commit f777d773878 and 4f7f7b03758
Previous Message 邱宇航 2025-09-09 03:58:51 Re: Memory leak of SMgrRelation object on standby