Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nc61e-0000uF-R9 for pgsql-general@arkaria.postgresql.org; Wed, 06 Apr 2022 13:48:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nc61d-0006Dp-Jw for pgsql-general@arkaria.postgresql.org; Wed, 06 Apr 2022 13:48:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nc61d-0006Dg-9u for pgsql-general@lists.postgresql.org; Wed, 06 Apr 2022 13:48:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nc61b-0003rA-4x for pgsql-general@lists.postgresql.org; Wed, 06 Apr 2022 13:48:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 236DmfIm3035286; Wed, 6 Apr 2022 09:48:41 -0400 From: Tom Lane To: "David G. Johnston" cc: "m7onov@gmail.com" , "pgsql-general@lists.postgresql.org" Subject: Re: Cascade view drop permission checks In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Wed, 06 Apr 2022 00:13:36 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3035284.1649252921.1@sss.pgh.pa.us> Date: Wed, 06 Apr 2022 09:48:41 -0400 Message-ID: <3035285.1649252921@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Tuesday, April 5, 2022, m7onov@gmail.com wrote: >> It seems strange to me that somebody who is not a member of owner role can >> drop an object bypassing permission checks. >> Is this behaviour OK? > The system dropped the now defunct view, not alice. Bob accepted that risk > by basing the view on an object owned by another role. I suppose other > behaviors are possible but not really worth exploring. (a) this behavior is what is required by the SQL standard. (b) what other behavior would be better? Dropping the table and leaving a broken view behind isn't good. Neither is refusing to let the owner drop her object. regards, tom lane