Re: Remove duplicate static function check_permissions in slotfuncs.c and logicalfuncs.c

Euler Taveira <euler@eulerto.com>

From: "Euler Taveira" <euler@eulerto.com>
To: "Bharath Rupireddy" <bharath.rupireddyforpostgres@gmail.com>, "PostgreSQL Hackers" <pgsql-hackers@lists.postgresql.org>
Date: 2021-09-12T16:46:35Z
Lists: pgsql-hackers
On Sat, Sep 11, 2021, at 5:28 AM, Bharath Rupireddy wrote:
> We have two static check_permissions functions (one in slotfuncs.c
> another in logicalfuncs.c) with the same name and same code for
> checking the privileges for using replication slots. Why can't we have
> a single function CheckReplicationSlotPermissions in slot.c? This way,
> we can get rid of redundant code. Attaching a patch for it.
Good catch! Your patch looks good to me.


--
Euler Taveira
EDB   https://www.enterprisedb.com/

Commits

  1. Remove code duplication for permission checks with replication slots

  2. Re-implement the ereport() macro using __VA_ARGS__.