pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed
3+ messages / 2 participants
[nested] [flat]

* pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed
@ 2016-04-07 01:45 Stephen Frost <sfrost@snowman.net>
  2016-04-07 17:30 ` Re: [COMMITTERS] pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Stephen Frost @ 2016-04-07 01:45 UTC (permalink / raw)
  To: pgsql-committers

In pg_dump, include pg_catalog and extension ACLs, if changed

Now that all of the infrastructure exists, add in the ability to
dump out the ACLs of the objects inside of pg_catalog or the ACLs
for objects which are members of extensions, but only if they have
been changed from their original values.

The original values are tracked in pg_init_privs.  When pg_dump'ing
9.6-and-above databases, we will dump out the ACLs for all objects
in pg_catalog and the ACLs for all extension members, where the ACL
has been changed from the original value which was set during either
initdb or CREATE EXTENSION.

This should not change dumps against pre-9.6 databases.

Reviews by Alexander Korotkov, Jose Luis Tallon

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/23f34fa4ba358671adab16773e79c17c92cbc870

Modified Files
--------------
doc/src/sgml/extend.sgml                   |   21 +
src/backend/catalog/aclchk.c               |   17 +-
src/backend/utils/adt/pg_upgrade_support.c |   12 +
src/bin/initdb/initdb.c                    |    6 +-
src/bin/pg_dump/dumputils.c                |  274 ++++++-
src/bin/pg_dump/dumputils.h                |    9 +-
src/bin/pg_dump/pg_dump.c                  | 1077 +++++++++++++++++++++++-----
src/bin/pg_dump/pg_dump.h                  |   24 +
src/bin/pg_dump/pg_dumpall.c               |    6 +-
src/include/catalog/binary_upgrade.h       |    2 +
src/include/catalog/pg_proc.h              |    2 +
src/test/regress/expected/init_privs.out   |   13 +
src/test/regress/parallel_schedule         |    2 +-
src/test/regress/serial_schedule           |    1 +
src/test/regress/sql/init_privs.sql        |   11 +
15 files changed, 1268 insertions(+), 209 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [COMMITTERS] pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed
  2016-04-07 01:45 pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed Stephen Frost <sfrost@snowman.net>
@ 2016-04-07 17:30 ` Tom Lane <tgl@sss.pgh.pa.us>
  2016-04-07 17:38   ` Re: [COMMITTERS] pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed Stephen Frost <sfrost@snowman.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2016-04-07 17:30 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-hackers@postgreSQL.org

Stephen Frost <sfrost@snowman.net> writes:
> In pg_dump, include pg_catalog and extension ACLs, if changed

This patch added a regression test step that creates some roles
and doesn't drop them again.  This is unacceptable, because

(1) it breaks the ability to do "make installcheck" more than once.

(2) it leaves roles lying around in a production installation,
if installcheck is used there.

And it doesn't even adhere to the convention we've agreed to about
naming test roles regress_something.  OK, it's not as dangerously
broken that way as rowsecurity.sql, which is (still) creating roles
named "alice" and "bob", but it's not acceptable like this.

It'd be possible to fix (1) by adding "drop if exists", but I think the
whole thing is wrongheaded due to (2).  Perhaps the needs of the test
could be met by granting/revoking some rights explicitly to current_user
(ie, the test superuser)?  That wouldn't have any real effects on a
superuser, but it would provide some grist for testing the behavior.
Or you could test this behavior in some other setting than the core
regression tests; perhaps in a TAP test for pg_dump.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [COMMITTERS] pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed
  2016-04-07 01:45 pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed Stephen Frost <sfrost@snowman.net>
  2016-04-07 17:30 ` Re: [COMMITTERS] pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-04-07 17:38   ` Stephen Frost <sfrost@snowman.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Stephen Frost @ 2016-04-07 17:38 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers@postgreSQL.org

Tom,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> It'd be possible to fix (1) by adding "drop if exists", but I think the
> whole thing is wrongheaded due to (2).  Perhaps the needs of the test
> could be met by granting/revoking some rights explicitly to current_user
> (ie, the test superuser)?  That wouldn't have any real effects on a
> superuser, but it would provide some grist for testing the behavior.

Sure, I can do that.

> Or you could test this behavior in some other setting than the core
> regression tests; perhaps in a TAP test for pg_dump.

I have to admit that I'm not terrible familiar with setting that up, but
will take a look at it.  This is what I'd really like to have as we
have far too little testing of pg_dump in the test suite.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2016-04-07 17:38 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-04-07 01:45 pgsql: In pg_dump, include pg_catalog and extension ACLs, if changed Stephen Frost <sfrost@snowman.net>
2016-04-07 17:30 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-04-07 17:38   ` Stephen Frost <sfrost@snowman.net>

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