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 1sLteu-00HAFz-9T for pgsql-general@arkaria.postgresql.org; Tue, 25 Jun 2024 00:03:40 +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 1sLter-00ClbL-EX for pgsql-general@arkaria.postgresql.org; Tue, 25 Jun 2024 00:03:37 +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 1sLter-00ClbD-3t for pgsql-general@lists.postgresql.org; Tue, 25 Jun 2024 00:03:37 +0000 Received: from fout1-smtp.messagingengine.com ([103.168.172.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sLteo-002xxi-OM for pgsql-general@postgresql.org; Tue, 25 Jun 2024 00:03:36 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.nyi.internal (Postfix) with ESMTP id 092971380469; Mon, 24 Jun 2024 20:03:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 24 Jun 2024 20:03:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1719273814; x=1719360214; bh=IaI36ErJ+LdpJ26tuVQF+2hNw1VrGvioGaEznh4Hptg=; b= P1q1G8BblmRB00Hihs/wZlhbKy9Lcz8MTHzXfUwielbNYwzQo3cfXzFf/aa69IAg UN71dgMnjTqQ/XaGEoY/k4PIJBrfHp1AMsCzR6254yLigSCoC8KIET/TdRQK0Ylq SPZ4GtALc9bJoz8wA1VGCfRg10KTtUszSWBuT/oZCTDVJNBpHKfAwlDhHIXeeRnK BYtcMGwTKgv0Arr5pn40+OXnNdtLZtCllTMy1KOsnxB3FWEQfltnOueyDrS/SXJe P2CpaLlqaLO94S0k02a8wVYkfVOvm7XNxKWD+eeqIZhjTueqRD/yC6BJWCGPADy3 8v5kBu1ff7QItWa61d7TvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719273814; x= 1719360214; bh=IaI36ErJ+LdpJ26tuVQF+2hNw1VrGvioGaEznh4Hptg=; b=u aSa4OFzkFTYmvUjMOqkl5cthWXlczZRihaog9fcg/MNFWWmbxA2bDyTD9I0DJSQF aRkREvkhISR05G79DkKmcXCyQHd856ks96HkjsJ468Buac5BtmyMrANY/UgCh2hP xaCe76SrcmwIYWv+M70w41nJEj9cy/VlsJ8mAhKyb63j5kLfH/g5RKa/46tGhjm0 i8AvUWCIa1DXPvg/gWzAmwh1Z2lKPT6YbqvGlRYnN+3a6Mlj96rE4l8pliz9PQ5K Apbxd7vNueei/e5a7uHz1rqa/5zbY2Ao6N1bIl/8DRGOLZ0PJVfR/0GAa7YckAc1 mBiHBurK9dD8mPTp02MZg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegvddgfeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeelgeevkeekkeeuiefgtdevieeluefhfedufeetkeej ffekjeeujeehgeehgeektdenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Jun 2024 20:03:33 -0400 (EDT) Message-ID: Date: Mon, 24 Jun 2024 17:03:32 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: schema privileges and drop role To: Matt Zagrabelny , "pgsql-general@postgresql.org >> PG-General Mailing List" References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/24/24 17:00, Matt Zagrabelny wrote: > Greetings, > > I have a database that I recently changed the ownership for and now I am > attempting to drop the previous owner of the database: > > test_db=# drop ROLE legacy_owner; > ERROR:  role "legacy_owner" cannot be dropped because some objects > depend on it > DETAIL:  privileges for schema public > > I don't know where to look to find out what I need to alter to be able > to remove the legacy role and internet searches came up fruitless. Generally best to start with the docs: https://www.postgresql.org/docs/current/sql-droprole.html "A role cannot be removed if it is still referenced in any database of the cluster; an error will be raised if so. Before dropping the role, you must drop all the objects it owns (or reassign their ownership) and revoke any privileges the role has been granted on other objects. The REASSIGN OWNED and DROP OWNED commands can be useful for this purpose; see Section 22.4 for more discussion." > > Does anyone have any hints or advice on where to look? > > Thanks for the help! > > -m -- Adrian Klaver adrian.klaver@aklaver.com