Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvpC2-0008Ik-OX for pgsql-bugs@arkaria.postgresql.org; Fri, 31 Aug 2018 19:34:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fvpC0-0000ag-GH for pgsql-bugs@arkaria.postgresql.org; Fri, 31 Aug 2018 19:34:52 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvp0d-0007RD-Mx for pgsql-bugs@lists.postgresql.org; Fri, 31 Aug 2018 19:23:07 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fvp0V-0002Dj-3g for pgsql-bugs@postgresql.org; Fri, 31 Aug 2018 19:23:06 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 10B2AED87335 for ; Fri, 31 Aug 2018 12:22:58 -0700 (MST) Date: Fri, 31 Aug 2018 12:22:58 -0700 (MST) From: jhm713 To: pgsql-bugs@postgresql.org Message-ID: <1535743378066-0.post@n3.nabble.com> In-Reply-To: References: Subject: Re: Inconsistencies restoring public schema ownership from pg_dump MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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