Re: refactor ownercheck and aclcheck functions

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: refactor ownercheck and aclcheck functions
Date: 2022-10-19 23:24:25
Message-ID: CADkLM=dYg3urxeycJFpMRgTCPYk7=04R0CrJoC-qGOLBptWB+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 14, 2022 at 3:39 AM Peter Eisentraut <
peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:

> These patches take the dozens of mostly-duplicate pg_foo_ownercheck()
> and pg_foo_aclcheck() functions and replace (most of) them by common
> functions that are driven by the ObjectProperty table. All the required
> information is already in that table.
>
> This is similar to the consolidation of the drop-by-OID functions that
> we did a while ago (b1d32d3e3230f00b5baba08f75b4f665c7d6dac6).

Nice reduction in footprint!

I'd be inclined to remove the highly used ones as well. That way the
codebase would have more examples of object_ownercheck() for readers to
see. Seeing the existence of pg_FOO_ownercheck implies that a
pg_BAR_ownercheck might exist, and if BAR is missing they might be inclined
to re-add it.

If we do keep them, would it make sense to go the extra step and turn the
remaining six "regular" into static inline functions or even #define-s?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-10-19 23:47:24 Re: Logical WAL sender unresponsive during decoding commit
Previous Message Tom Lane 2022-10-19 22:39:32 Re: ts_locale.c: why no t_isalnum() test?