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 1l6d68-0004Ro-AT for pgsql-general@arkaria.postgresql.org; Mon, 01 Feb 2021 17:34:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l6d67-00043U-9d for pgsql-general@arkaria.postgresql.org; Mon, 01 Feb 2021 17:34:47 +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 1l6d65-00043N-Tm for pgsql-general@lists.postgresql.org; Mon, 01 Feb 2021 17:34:47 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6d63-000671-1x for pgsql-general@postgresql.org; Mon, 01 Feb 2021 17:34:44 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B27295C015A; Mon, 1 Feb 2021 12:34:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 01 Feb 2021 12:34:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=f 9s4s0euko+063wYo6rf+9RcLeazSk0o1EzkcHc3wdI=; b=qeUGdu9IvlJnLroT2 MKXZVglQiiffdknkkPxIzvWabR1+be5FJ7MyLkTIdfypX7YKwFGG1mzGE4Y682Ww 50Za1Tqv0qtDe+bouZv0Md7VCp4PEe9S2+lD5ajSkudYidlWEafZmE1tT5KFusaP xW9L/hOH1MQ6YGq3Dm2q940ym28ua3hWzLJm0wYT9GxHTy3rfKFplU7qN4/dJrlD pSn1cXc3dNfLgH6elS+oF0zehpRUC7r4+ycDKSvPmgJngrC8ncC2g2TqGqUkEeKT UAlWsoFTR078Yn/Zgis1leQPJsT6orl/Y8qxjFmvXSjEqPJ22zFZ1V9+IyDELcB9 Jg7cg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=f9s4s0euko+063wYo6rf+9RcLeazSk0o1EzkcHc3w dI=; b=glxcNefuGq41mekxJerKu8rjf4/kl0NXmOG9TbOVG7DvVyTBH1tMftjNM mSH+NrWZ/v6Y/A5VSoC/vJw9P/NdzSqi/u94Ab7bYnDcbm3bK08ssAY2okNnBikw GorxK3RxUCcpIZYG5IDAOyz3T4/jwWxOTYDZLpQP7/Ntjkfe33FMzZcgVxCSfC2K aEYEBVjSEC0r5RF/hHF7Gwigpl6diDGZEfb/I+XJKOXIX1JhTeu0HhC36BvUUQNA Hwpv/Ra83SAMWBQIy4Ur5wdWuPsyEqEjPRu7L6qfGei8iMtD5b3rOFPU9SXic5Vj 2WNp2xka7zxdxrdS2xPJUcRSCYQPg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeekgddutdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepuddufeejte evffehgfduhedthfdvteekieeuheefveevudetkeelueehgeduhefhnecuffhomhgrihhn pehpohhsthhgrhgvshhqlhdrohhrghenucfkphepleejrdduudefrddvudejrddvjeenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgr nhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.4] (97-113-217-27.tukw.qwest.net [97.113.217.27]) by mail.messagingengine.com (Postfix) with ESMTPA id CB3B01080064; Mon, 1 Feb 2021 12:34:40 -0500 (EST) Subject: Re: permission denied for large object 200936761 To: Andrus , pgsql-general@postgresql.org References: <47c92baa-949b-92d1-c162-1f0d8348fb50@hot.ee> <2eee8862-ea29-3e9c-30ff-82ec7ad4d99f@aklaver.com> <08f90e7b-8d08-d46e-abb7-85dd68bc3078@hot.ee> <6e8bd48a-9c0b-e045-05ee-1cbe334b2bba@hot.ee> From: Adrian Klaver Message-ID: <0cf7c8fe-00fb-0998-d372-d5545234572f@aklaver.com> Date: Mon, 1 Feb 2021 09:34:40 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <6e8bd48a-9c0b-e045-05ee-1cbe334b2bba@hot.ee> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/1/21 9:13 AM, Andrus wrote: > Hi! > > >Well the user that runs the pg_dump needs to have permissions on the > large objects. For more information see below. > > How to add permissions to non-superusers for this.? > > GRANT command > > GRANT { { SELECT | UPDATE } [, ...] | ALL [ PRIVILEGES ] } > ON LARGE OBJECT/|loid|/ [, ...] > TO/|role_specification|/ [, ...] [ WITH GRANT OPTION ] > > Requires large object id. How to grant backup privilege if there are no > large objects in database ? Your query below says there are and also returns the oid for them. > > Should *lo_compat_privileges > * > > set in postgresql.conf  or is there better way ? Changing lo_compat_privileges is an option but it is just moving the problem down the road. The actual fix is to find out what the large objects are there for, who owns them, are they still necessary?. Then based on the answers make the changes needed to future proof further interaction with them. > >>> -n public -n firma74 >>> >>> command line options are used. >>> >>>> >>>> You can query that to see what is there. I would not go about >>>> deleting until you find what the large objects are for. >>>> >>> select * from pg_largeobject >>> >>> returns empty table. >> > select * from  pg_largeobject_metadata > > returns 3 rows: > > Oid                      Lomowner > >   200936761       30152 > >   200936762      30152 > >   200936767       30152 > > How to find table and schema which is referenced by this ? Large objects exist independent of those. The important part of the above is lomowner. Use that oid to find the role that owns the objects here: https://www.postgresql.org/docs/12/view-pg-roles.html select rolname from pg_roles where oid = ; > > Andrus. > > -- Adrian Klaver adrian.klaver@aklaver.com