Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cceV3-0006Ai-N1 for pgsql-general@arkaria.postgresql.org; Sat, 11 Feb 2017 20:42:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cceV2-0000Qg-LR for pgsql-general@arkaria.postgresql.org; Sat, 11 Feb 2017 20:42:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cceV0-0000QS-WB for pgsql-general@postgresql.org; Sat, 11 Feb 2017 20:42:27 +0000 Received: from d96425fa.static.ziggozakelijk.nl ([217.100.37.250] helo=storagefox.foxi.nl) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cceUt-0006oc-9L for pgsql-general@postgresql.org; Sat, 11 Feb 2017 20:42:26 +0000 Received: from techfox.localnet (techfox.foxi [192.168.0.31]) by storagefox.foxi.nl (8.14.9/8.14.9) with ESMTP id v1BKgHlC001990; Sat, 11 Feb 2017 21:42:17 +0100 From: Frank van Vugt 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> Organization: Foxi Group User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org 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