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 1pUwH3-0007nw-JR for pgsql-admin@arkaria.postgresql.org; Wed, 22 Feb 2023 21:03:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pUwH2-0001g6-1Z for pgsql-admin@arkaria.postgresql.org; Wed, 22 Feb 2023 21:03:36 +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 1pUwH1-0001cs-MR for pgsql-admin@lists.postgresql.org; Wed, 22 Feb 2023 21:03:35 +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 1pUwGz-0006Ub-Is for pgsql-admin@lists.postgresql.org; Wed, 22 Feb 2023 21:03:34 +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 31ML3VIW285759; Wed, 22 Feb 2023 16:03:31 -0500 From: Tom Lane To: "David G. Johnston" cc: Teju Jakkidi vlogs , pgsql-admin Subject: Re: Alter default privileges is not working for roles In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Wed, 22 Feb 2023 11:32:58 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <285757.1677099811.1@sss.pgh.pa.us> Date: Wed, 22 Feb 2023 16:03:31 -0500 Message-ID: <285758.1677099811@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 Wed, Feb 22, 2023 at 10:53 AM Teju Jakkidi vlogs < > teja.jakkidi05@gmail.com> wrote: >> alter default privileges for role ownerrole >> Now our expectation is that if there is any table created by any user > The specification of "ownerrole" in that command means that said default > privileges only are created if "ownerrole" is the one creating the objects > - not "created by any user". It's hard to say for sure when we've been shown no details, but I suspect what the OP is describing is event triggers that issue ALTER OWNER commands after the fact. The default privileges mechanism is only applied at the instant of object creation; we do not want ALTER OWNER or SET SCHEMA or similar commands having random side-effects on existing privileges. regards, tom lane