Re: pg_restore --no-policies should not restore policies' comment
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-10-17T10:23:22Z
Lists: pgsql-hackers
On Thu, Oct 16, 2025 at 11:23 PM jian he <jian.universality@gmail.com> wrote: > > As for the unnecessary code for security labels on extensions > > you mentioned earlier, I've created a patch to remove it. Patch attached. > > looks good to me. Thanks for the review! Unless there are any objections, I'll commit the patch. By the way, while reading the documentation about security labels and extensions, I noticed this section: https://www.postgresql.org/docs/devel/extend-extensions.html > PostgreSQL does not currently support extension scripts issuing CREATE POLICY > or SECURITY LABEL statements. These are expected to be set after > the extension has been created. All RLS policies and security labels on > extension objects will be included in dumps created by pg_dump. I'm not sure the last sentence is accurate - in my quick test, a security label on the pgstattuple function wasn't included in the dump. If that's correct, should we update this part of the documentation, as a separate patch? ------------------------ $ psql =# CREATE EXTENSION dummy_seclabel ; =# CREATE EXTENSION pgstattuple ; =# SECURITY LABEL ON FUNCTION pgstattuple(regclass) IS 'classified'; =# \q $ pg_dump | grep -i "security label" COMMENT ON EXTENSION dummy_seclabel IS 'Test code for SECURITY LABEL feature'; ------------------------ In the above example, SECURITY LABEL command for pgstattuple function was not included in the dump. Regards, -- Fujii Masao
Commits
-
pg_dump: Remove unnecessary code for security labels on extensions.
- 762faf702c6f 19 (unreleased) landed
-
pg_restore: Fix security label handling with --no-publications/subscriptions.
- a4dbb11bb9ac 13.23 landed
- bc476f8b8b64 14.20 landed
- 5f42008f9030 15.15 landed
- 0870397ccfbd 16.11 landed
- dc8aa2f586d0 17.7 landed
- 7aecc00b3d66 18.0 landed
- 45f50c995fb6 19 (unreleased) landed
-
pg_dump: Fix dumping of security labels on subscriptions and event triggers.
- dff7591a7041 13.23 landed
- 295c0a644af5 14.20 landed
- 165b07efe4e2 15.15 landed
- 20b23784fc31 16.11 landed
- 968141898777 17.7 landed
- 176002c5bfa6 18.0 landed
- 8e5b92928d28 19 (unreleased) landed
-
pg_restore: Fix comment handling with --no-policies.
- 2ddbfede0c61 18.0 landed
- 66dabc06b1b0 19 (unreleased) landed
-
pg_restore: Fix comment handling with --no-publications / --no-subscriptions.
- 8fbd1f8ea2e1 13.23 landed
- db900ec358bd 14.20 landed
- c8ed16050564 15.15 landed
- 97527a5e68d5 16.11 landed
- f7f9c5d65816 17.7 landed
- 77d2b155caf7 18.0 landed
- b54e8dbfe3b1 19 (unreleased) landed
-
Core support for "extensions", which are packages of SQL objects.
- d9572c4e3b47 9.1.0 cited