pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_dump No comment for policy
3+ messages / 3 participants
[nested] [flat]
Commits from this thread:
2020-02-17 f31364676d 6da7d36305 bd2cd138f9 3380b99312 d9ec8d1d7d f9d7bb68da Teach pg_dump to dump comments on RLS policy objects.
* pg_dump No comment for policy
@ 2020-02-16 21:41 Marc Munro <marc@bloodnok.com>
2020-02-17 17:59 ` Re: pg_dump No comment for policy Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Marc Munro @ 2020-02-16 21:41 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
Severity: Low
PG Server: Versions 9.5 and 10.3
pg_dump: version 10.3
I have created a policy with a comment on it. pg_dump does not dump
the comment.
Here is my entire schema definition:
--------------------------------------------------------------------
create table rls (
username text not null,
details text not null
);
create policy only_owner on rls
for all
to session_user
using (username = user)
with check (details != 'xyzzy');
comment on policy only_owner on public.rls is 'Another comment';
--------------------------------------------------------------------
pg_dump extracts the table and policy but not the comment.
I can manually extract the comment with a query:
select p.polname,
quote_literal(obj_description(p.oid, 'pg_policy')) as comment
from pg_catalog.pg_policy p;
Initially tried with postgres server 9.5.21 running from psql 10.3.
Also
tried with postgres server 10.3 running from psql 10.3.
I am not at all anxious for this to be fixed. Just thought you should
know.
__
Marc
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg_dump No comment for policy
2020-02-16 21:41 pg_dump No comment for policy Marc Munro <marc@bloodnok.com>
@ 2020-02-17 17:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-03-18 02:19 ` Re: pg_dump No comment for policy Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2020-02-17 17:59 UTC (permalink / raw)
To: Marc Munro <marc@bloodnok.com>; +Cc: pgsql-bugs@lists.postgresql.org
Marc Munro <marc@bloodnok.com> writes:
> I have created a policy with a comment on it. pg_dump does not dump
> the comment.
Ugh, yeah, there's no dumpComment() call in dumpPolicy().
Easy enough to fix, but now I wonder if we missed the same elsewhere.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg_dump No comment for policy
2020-02-16 21:41 pg_dump No comment for policy Marc Munro <marc@bloodnok.com>
2020-02-17 17:59 ` Re: pg_dump No comment for policy Tom Lane <tgl@sss.pgh.pa.us>
@ 2020-03-18 02:19 ` Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 3+ messages in thread
From: Bruce Momjian @ 2020-03-18 02:19 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Marc Munro <marc@bloodnok.com>; pgsql-bugs@lists.postgresql.org
On Mon, Feb 17, 2020 at 12:59:37PM -0500, Tom Lane wrote:
> Marc Munro <marc@bloodnok.com> writes:
> > I have created a policy with a comment on it. pg_dump does not dump
> > the comment.
>
> Ugh, yeah, there's no dumpComment() call in dumpPolicy().
>
> Easy enough to fix, but now I wonder if we missed the same elsewhere.
FYI, this was fixed on February 17 and will appear in the next minor
release:
commit f31364676d
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Mon Feb 17 18:40:02 2020 -0500
Teach pg_dump to dump comments on RLS policy objects.
This was unaccountably omitted in the original RLS patch.
The SQL syntax is basically the same as for comments on triggers,
so crib code from dumpTrigger().
Per report from Marc Munro. Back-patch to all supported branches.
Discussion: https://postgr.es/m/1581889298.18009.15.camel@bloodnok.com
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-03-18 02:19 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-16 21:41 pg_dump No comment for policy Marc Munro <marc@bloodnok.com>
2020-02-17 17:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-03-18 02:19 ` Bruce Momjian <bruce@momjian.us>
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