pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_dump: Fix dumping of security labels on subscriptions and eve
Date: Tue, 16 Sep 2025 07:51:11 +0000
Message-ID: <E1uyQT0-000y2m-26@gemulon.postgresql.org> (raw)

pg_dump: Fix dumping of security labels on subscriptions and event triggers.

Previously, pg_dump incorrectly queried pg_seclabel to retrieve security labels
for subscriptions, which are stored in pg_shseclabel as they are global objects.
This could result in security labels for subscriptions not being dumped.

This commit fixes the issue by updating pg_dump to query the pg_seclabels view,
which aggregates entries from both pg_seclabel and pg_shseclabel.
While querying pg_shseclabel directly for subscriptions was an alternative,
using pg_seclabels is simpler and sufficient.

In addition, pg_dump is updated to dump security labels on event triggers,
which were previously omitted.

Backpatch to all supported versions.

Author: Jian He <jian.universality@gmail.com>
Co-authored-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CACJufxHCt00pR9h51AVu6+yPD5J7JQn=7dQXxqacj0XyDhc-fA@mail.gmail.com
Backpatch-through: 13

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dff7591a7041b4ccbb42806c6492a29d86fece86

Modified Files
--------------
src/bin/pg_dump/pg_backup_archiver.c | 12 +++++++-----
src/bin/pg_dump/pg_dump.c            |  7 ++++++-
2 files changed, 13 insertions(+), 6 deletions(-)



view thread (7+ messages)

Message-ID: <E1uyQT0-000y2m-26@gemulon.postgresql.org>
Permalink:  ../E1uyQT0-000y2m-26@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uyQT0-000y2m-26@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: pg_dump: Fix dumping of security labels on subscriptions and eve
  In-Reply-To: <E1uyQT0-000y2m-26@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox