Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSgoV-00FHDh-Mc for pgsql-docs@arkaria.postgresql.org; Wed, 24 Jan 2024 17:13:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rSgoU-006nkq-I1 for pgsql-docs@arkaria.postgresql.org; Wed, 24 Jan 2024 17:13:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSgoU-006nki-AR for pgsql-docs@lists.postgresql.org; Wed, 24 Jan 2024 17:13:22 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSgoR-003A0f-Rg for pgsql-docs@lists.postgresql.org; Wed, 24 Jan 2024 17:13:21 +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 40OHDD1X167868; Wed, 24 Jan 2024 12:13:13 -0500 From: Tom Lane To: "David G. Johnston" cc: Alvaro Herrera , Laurenz Albe , gparc@free.fr, Daniel Gustafsson , pgsql-docs Subject: Re: SQL command : ALTER DATABASE OWNER TO In-reply-to: References: <202401241656.hbks4btwvjnf@alvherre.pgsql> Comments: In-reply-to "David G. Johnston" message dated "Wed, 24 Jan 2024 10:02:31 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <167866.1706116393.1@sss.pgh.pa.us> Date: Wed, 24 Jan 2024 12:13:13 -0500 Message-ID: <167867.1706116393@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > postgres=# grant all on database newdb2 to testowner; > -- as I am logged in as davidj this grant should actually happen, with > davidj as the grantor > -- the grants that materialize from ownership has the owning role as the > grantor Yes. The FM points out somewhere that if a superuser does a GRANT, it's executed as though by the object owner. That provision predates when we supported explicit GRANTED BY clauses in GRANT. I'm not sure we'd have made it work like that if we had GRANTED BY already, but I'm afraid of the compatibility implications if we change it now. regards, tom lane