Re: pg_upgrade fails with non-standard ACL

From: Artur Zakirov <zaartur(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Grigory Smolkin <g(dot)smolkin(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>
Subject: Re: pg_upgrade fails with non-standard ACL
Date: 2019-11-27 02:35:14
Message-ID: 997a1fd1-f83d-9c21-ad39-5b757ff2c354@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you for reviews!

On 2019/11/21 17:53, Michael Paquier wrote:
> On Fri, Nov 15, 2019 at 11:30:02AM +0300, Grigory Smolkin wrote:
>> On 11/9/19 5:26 AM, Michael Paquier wrote:
>>> Another question I have: do we need to care more about other extra
>>> ACLs applied to other object types? For example a subset of columns
>>> on a table with a column being renamed could be an issue. Procedure
>>> renamed in core are not that common still we did it.
>>
>> I think that all objects must be supported.
>
> The unfortunate part about the current approach is that it is not
> really scalable from the point of view of the client. What the patch
> does is to compare the initdb-time ACLs and the ones stored in
> pg_proc. In order to support all object types we would need to have
> more client-side logic to join properly with all the catalogs holding
> the ACLs of the objects to be compared. I am wondering if it would be
> more simple to invent a backend function which uses an input similar
> to pg_describe_object() with (classid, objid and objsubid) that
> returns the ACL of the corresponding object after looking at the
> catalog defined by classid. This would simplify the client part to
> just scan pg_init_privs...

I've started to implement new backend function similar to
pg_describe_object() and tried to make new version of the patch. But I'm
wondering now if it is possible to backpatch new functions to older
Postgres releases? pg_upgrade will require a presence of this function
on an older source cluster.

Other approach is similar to Anastasia's patch, which is scanning
pg_proc, pg_class, pg_attribute and others to get modified ACL's and
compare it with initial ACL from pg_init_privs. Next step is to find
objects which names or signatures were changed using
pg_describe_object() and scanning pg_depend of new cluster (there is a
problem here though: there are no entries for relations columns).

--
Artur

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2019-11-27 02:38:39 Re: progress report for ANALYZE
Previous Message Amit Langote 2019-11-27 02:34:26 Re: progress report for ANALYZE