From: | Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> |
---|---|
To: | jian he <jian(dot)universality(at)gmail(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_restore --no-policies should not restore policies' comment |
Date: | 2025-07-02 09:18:00 |
Message-ID: | edfd4d46-cc69-4e6f-a42a-44fa850a9904@oss.nttdata.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2025/07/02 11:17, jian he wrote:
> On Fri, Jun 27, 2025 at 1:34 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
>>
>>> To do that, we need
>>> 1. we checked that COMMENTS on policies, the TocEntry->tag begins with
>>> "POLICY". which is true, see above code walk through.
>>> 2. We also need to make sure that no other dumpComment call results in a
>>> COMMENT command whose TocEntry->tag also starts with "POLICY".
>>> which is also true, per https://www.postgresql.org/docs/current/sql-comment.html
>>> after "COMMENT ON", the next word is fixed, and "POLICY" only occurs once.
>>>
>>>
>>> If this is what we want, we can do the same for
>>> "--no-publications", "--no-subscriptions" too.
>>
>> Agreed.
>>
>
> hi.
>
> I’ve tested the pg_restore options --no-policies, --no-publications, and
> --no-subscriptions locally.
Thanks for updating the patch! Could you add it to the next CommitFest
so we don't forget about it?
> However, I haven’t tested --no-security-labels option, so no changes were
> made for it. Testing --no-security-labels appears to need more setup, which
> didn’t seem trivial.
You're checking whether pg_restore --no-publications --no-subscriptions correctly
skips security labels for publications and subscriptions, and if not,
you'll prepare a patch. Right? I'm not sure how common it is to define security
labels on publications or subscriptions, but if the behavior is unexpected (i.e.,
the security labels are not skipped in that case), it's worth fixing.
It would probably be better to handle that in a separate patch from the one
for comments.
To set up a security label for testing, you can use the
src/test/modules/dummy_seclabel module.
Regards,
--
Fujii Masao
NTT DATA Japan Corporation
From | Date | Subject | |
---|---|---|---|
Next Message | Masahiko Sawada | 2025-07-02 09:23:39 | Re: Inconsistent LSN format in pg_waldump output |
Previous Message | Richard Guo | 2025-07-02 09:14:48 | Re: Reduce "Var IS [NOT] NULL" quals during constant folding |