Re: Inconsistencies restoring public schema ownership from pg_dump - Mailing list pgsql-bugs

From jhm713
Subject Re: Inconsistencies restoring public schema ownership from pg_dump
Date
Msg-id 1535743378066-0.post@n3.nabble.com
Whole thread Raw
In response to Inconsistencies restoring public schema ownership from pg_dump  (Chris Pacejo <cpacejo@clearskydata.com>)
List pgsql-bugs
I just wanted to echo that this has also caused me problems. We just used
pg_restore and pg_dump to migrate a bunch of databases to a newer version of
postgres. Some of the databases had changed the ownership of the public
schema, and that was lost in the migration.

Maybe changing the owner of the public schema is considered a bad idea, but
our use case is that we (the postgres admins) support a group of developers
that creates many database driven apps. Most of the databases are secured,
but some are public. By letting that group own the public role (they already
own the database and all its other contents), they can decide whether to
grant or revoke permission on the public schema without granting any of them
superuser access.

Basically, what I am suggesting is that, assuming an unmodified public
schema, running these commands
pg_dump -Fc -f test.pg test
pg_restore -s test.pg | grep -i 'alter schema'

should output:
ALTER SCHEMA public OWNER TO postgres;

And of course if the owner had been changed, that would also be reflected.



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html


pgsql-bugs by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
Next
From: Andres Freund
Date:
Subject: Re: BUG #15270: __builtin_isinf conflict when building using clang