Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZOtsG-0006GW-EH for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Aug 2015 20:40:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZOtsF-0005ZF-GO for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Aug 2015 20:40:47 +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.84) (envelope-from ) id 1ZOtsD-0005YQ-4s for pgsql-hackers@postgreSQL.org; Mon, 10 Aug 2015 20:40:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZOts6-0007Rj-Em for pgsql-hackers@postgreSQL.org; Mon, 10 Aug 2015 20:40:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t7AKeVHG008192; Mon, 10 Aug 2015 16:40:31 -0400 From: Tom Lane To: Peter Eisentraut cc: Andrew Dunstan , pgsql-hackers@postgreSQL.org Subject: Re: [COMMITTERS] pgsql: Fix pg_dump to dump shell types. In-reply-to: <55C902E8.2010400@gmx.net> References: <55C7CF3B.30703@dunslane.net> <20081.1439158993@sss.pgh.pa.us> <55C902E8.2010400@gmx.net> Comments: In-reply-to Peter Eisentraut message dated "Mon, 10 Aug 2015 16:00:40 -0400" Date: Mon, 10 Aug 2015 16:40:31 -0400 Message-ID: <8191.1439239231@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Peter Eisentraut writes: > On 8/9/15 6:23 PM, Tom Lane wrote: >> It looks to me like the reason for this is that pg_dump forces the >> "typacl" of a type to be '{=U}' when reading the schema data for a >> pre-9.2 type, rather than reading it as NULL (ie default permissions) >> which would result in not printing any grant/revoke commands for >> the object. >> >> I do not see a good reason for that; quite aside from this problem, >> it means there is one more place that knows the default permissions >> for a type than there needs to be. Peter, what was the rationale? > This was probably just copied from how proacl and lanacl are handled, > which predate typacl by quite a bit. Maybe there was a reason in those > days. Hm ... I wonder whether those are well-thought-out either. > It might also have something to do with how owner privileges are > handled. An explicit '{=U}' doesn't create owner privileges, unlike a > null value in that field. Maybe this is necessary if you dump and > restore between databases with different user names. But now that you mention it, isn't that completely broken? What pg_dump actually prints given this made-up data is REVOKE ALL ON TYPE myshell FROM PUBLIC; REVOKE ALL ON TYPE myshell FROM postgres; GRANT ALL ON TYPE myshell TO PUBLIC; which seems like a completely insane interpretation. There is no way that dumping a type from a pre-typacl database and restoring it into a newer one should end up with the type's owner having no privileges on it. I'm astonished that we've not gotten bug reports about that. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers