Re: intentional or oversight? pg_dump -c does not restore default priviliges on schema public

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>, pgsql-general(at)postgresql(dot)org
Subject: Re: intentional or oversight? pg_dump -c does not restore default priviliges on schema public
Date: 2017-02-11 21:31:17
Message-ID: 306a4b5b-4586-14e1-ff82-7ac509e859f1@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/11/2017 01:14 PM, Frank van Vugt wrote:
> Hi Adrian,
>
> Op zaterdag 11 februari 2017 13:02:29 schreef Adrian Klaver:
>> What version of Postgres?
>
> Ah, sorry, missed copying that in:
>
> postgres=# select version();
> version
> ------------------------------------------------------------------------------
> PostgreSQL 9.6.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.2, 64-bit
> (1 row)
>
>

I see the same thing now. A diff reveals:

aklaver(at)tito:~> diff /tmp/publictest95 /tmp/publictest96
5,6c5,6
< -- Dumped from database version 9.5.5
< -- Dumped by pg_dump version 9.5.5
---
> -- Dumped from database version 9.6.1
> -- Dumped by pg_dump version 9.6.1
9a10
> SET idle_in_transaction_session_timeout = 0;
47,56d47
<
<
< --
< -- Name: public; Type: ACL; Schema: -; Owner: postgres
< --
<
< REVOKE ALL ON SCHEMA public FROM PUBLIC;
< REVOKE ALL ON SCHEMA public FROM postgres;
< GRANT ALL ON SCHEMA public TO postgres;
< GRANT ALL ON SCHEMA public TO PUBLIC;

That seems to cause a problem:

aklaver(at)tito:~> psql -d publictest -U guest
Null display is "NULL".
psql (9.5.5)
Type "help" for help.

publictest=> create table public.public_test(id int);
CREATE TABLE

aklaver(at)tito:~> /usr/local/pgsql96/bin/psql -d publictest -U guest -p 5442
Null display is "NULL".
psql (9.6.1)
Type "help" for help.

publictest=> create table public.public_test(id int);
ERROR: permission denied for schema public
LINE 1: create table public.public_test(id int);

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank van Vugt 2017-02-11 21:38:55 Re: intentional or oversight? pg_dump -c does not restore default priviliges on schema public
Previous Message Tom Lane 2017-02-11 21:23:23 Re: Custom shuffle function stopped working in 9.6