Re: logical decoding/replication: new functions pg_ls_logicaldir and pg_ls_replslotdir

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: logical decoding/replication: new functions pg_ls_logicaldir and pg_ls_replslotdir
Date: 2021-11-21 01:28:25
Message-ID: YZmguaKlaZBDNAeS@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 20, 2021 at 12:29:51AM +0000, Bossart, Nathan wrote:
> On 11/17/21, 11:39 PM, "Bharath Rupireddy" <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>> Please review the attached v2.
>
> LGTM. I've marked this one as ready-for-committer.

One issue that I have with this patch is that there are zero
regression tests. Could you add a couple of things in
misc_functions.sql (for the negative tests perhaps) or
contrib/test_decoding/, taking advantage of places where slots are
already created? You may want to look after the non-superuser case
where the calls should fail, and the second case where a role is part
of pg_monitor where the call succeeds. Note that any roles created in
the tests have to be prefixed with "regress_".

+ snprintf(path, sizeof(path), "%s/%s", "pg_replslot", slotname);
+ return pg_ls_dir_files(fcinfo, path, false);
"pg_replslot" could be part of the third argument here. There is no
need to separate it.

+ ordinary file in the server's pg_logical/mappings directory.
Paths had better have <filename> markups around them, no?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-11-21 01:41:17 Re: VS2022: Support Visual Studio 2022 on Windows
Previous Message Bossart, Nathan 2021-11-20 23:25:43 Re: Improving psql's \password command