From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Andrus <kobruleht2@hot.ee>
To: pgsql-general@postgresql.org
Subject: Re: permission denied for large object 200936761
Date: Mon, 1 Feb 2021 09:34:40 -0800
Message-ID: <0cf7c8fe-00fb-0998-d372-d5545234572f@aklaver.com> (raw)
In-Reply-To: <6e8bd48a-9c0b-e045-05ee-1cbe334b2bba@hot.ee>
References: <47c92baa-949b-92d1-c162-1f0d8348fb50@hot.ee>
<2eee8862-ea29-3e9c-30ff-82ec7ad4d99f@aklaver.com>
<08f90e7b-8d08-d46e-abb7-85dd68bc3078@hot.ee>
<f4bf75cc-cb4a-9154-4189-2ae8e539ccf9@aklaver.com>
<6e8bd48a-9c0b-e045-05ee-1cbe334b2bba@hot.ee>
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 = <lomowner>;
>
> Andrus.
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, kobruleht2@hot.ee
Subject: Re: permission denied for large object 200936761
In-Reply-To: <0cf7c8fe-00fb-0998-d372-d5545234572f@aklaver.com>
References: <47c92baa-949b-92d1-c162-1f0d8348fb50@hot.ee> <2eee8862-ea29-3e9c-30ff-82ec7ad4d99f@aklaver.com> <08f90e7b-8d08-d46e-abb7-85dd68bc3078@hot.ee> <f4bf75cc-cb4a-9154-4189-2ae8e539ccf9@aklaver.com> <6e8bd48a-9c0b-e045-05ee-1cbe334b2bba@hot.ee> <0cf7c8fe-00fb-0998-d372-d5545234572f@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox