Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWkah-0000Ti-KK for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Dec 2018 16:08:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gWkag-0004t4-Bw for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Dec 2018 16:08:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWkaH-0000R0-Es for pgsql-bugs@lists.postgresql.org; Tue, 11 Dec 2018 16:08:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWkaE-0003Vy-MI for pgsql-bugs@lists.postgresql.org; Tue, 11 Dec 2018 16:08:32 +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 wBBG8Tpb010844; Tue, 11 Dec 2018 11:08:29 -0500 From: Tom Lane To: git17@ska67.de cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15546: alter large object n owner to new owner In-reply-to: <15546-0558c75fd2025e7c@postgresql.org> References: <15546-0558c75fd2025e7c@postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Tue, 11 Dec 2018 13:15:36 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10842.1544544509.1@sss.pgh.pa.us> Date: Tue, 11 Dec 2018 11:08:29 -0500 Message-ID: <10843.1544544509@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Bug_reporting_form?= writes: > Documentation describes: > ALTER LARGE OBJECT large_object_oid OWNER TO { new_owner | CURRENT_USER | > SESSION_USER } > You must be superuser or owner of the large object to use ALTER LARGE > OBJECT. > If you want to use this statement for assigning a "new owner", you have to > be a superuser. > If you are only the owner of the large object, you receive an error message > Postgresql-Error 42501 saying that you must be in the role of the "new > owner". Yeah, the ALTER LARGE OBJECT page could use improvement. The correct general rule is explained in section 5.6: An object can be assigned to a new owner with an ALTER command of the appropriate kind for the object, e.g. ALTER TABLE. Superusers can always do this; ordinary roles can only do it if they are both the current owner of the object (or a member of the owning role) and a member of the new owning role. Most other ALTER-something pages have wording like "To alter the owner, you must also be a direct or indirect member of the new owning role", but this seems to have been missed in the ALTER LARGE OBJECT docs. regards, tom lane