pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank van Vugt <ftm.van.vugt@foxi.nl>
To: pgsql-general@postgresql.org
Subject: intentional or oversight? pg_dump -c does not restore default priviliges on schema public
Date: Sat, 11 Feb 2017 21:42:17 +0100
Message-ID: <3534542.o3cNaKiDID@techfox> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

L.S.

I noticed the following and wondered whether this is intentional or an 
oversight in pg_dump's '-c' option?

The clean option causes the public schema to be dropped and recreated, but 
this is done with the default schema priviliges, which are not the same as the 
ones assigned during create database:


*** USING PSQL

postgres=# create database publictest;

postgres=# \c publictest;

publictest=# \dn+
                          List of schemas
  Name  |  Owner   |  Access privileges   |      Description       
--------+----------+----------------------+------------------------
 public | postgres | postgres=UC/postgres+| standard public schema
        |          | =UC/postgres         | 
(1 row)



*** USING SHELL

host:~ # pg_dump -c -f /tmp/publictest -h localhost -Fp -U postgres publictest



*** USING PSQL

publictest=# \i /tmp/publictest

publictest=# \dn+
                        List of schemas
  Name  |  Owner   | Access privileges |      Description       
--------+----------+-------------------+------------------------
 public | postgres |                   | standard public schema
(1 row)

publictest=# grant usage on schema public to public;
GRANT
publictest=# grant create on schema public to public;
GRANT

testje=# \dn+
                          List of schemas
  Name  |  Owner   |  Access privileges   |      Description       
--------+----------+----------------------+------------------------
 public | postgres | postgres=UC/postgres+| standard public schema
        |          | =UC/postgres         | 
(1 row)



-- 

Best,




Frank.



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



view thread (18+ messages)  latest in thread

Message-ID: <3534542.o3cNaKiDID@techfox>
Permalink:  ../3534542.o3cNaKiDID@techfox/
Also on:    postgresql.org/message-id/3534542.o3cNaKiDID@techfox

 · 

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-general@postgresql.org
  Cc: ftm.van.vugt@foxi.nl
  Subject: Re: intentional or oversight? pg_dump -c does not restore default priviliges on schema public
  In-Reply-To: <3534542.o3cNaKiDID@techfox>

* 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