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

Поиск
Список
Период
Сортировка
От Bossart, Nathan
Тема Re: logical decoding/replication: new functions pg_ls_logicaldir and pg_ls_replslotdir
Дата
Msg-id D3D7B42F-9675-4B30-BD10-F82D8AE9A02D@amazon.com
обсуждение исходный текст
Ответ на Re: logical decoding/replication: new functions pg_ls_logicaldir and pg_ls_replslotdir  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: logical decoding/replication: new functions pg_ls_logicaldir and pg_ls_replslotdir  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
On 10/30/21, 2:36 AM, "Bharath Rupireddy" <bharath.rupireddyforpostgres@gmail.com> wrote:
> I've added 3 functions pg_ls_logicalsnapdir, pg_ls_logicalmapdir,
> pg_ls_replslotdir, and attached the patch. The sample output looks
> like [1]. Please review it further.

I took a look at the patch.

+    char        path[MAXPGPATH + 11];

Why are you adding 11 to MAXPGPATH here?  I would think that MAXPGPATH
is sufficient.

+    filename = text_to_cstring(filename_t);
+    snprintf(path, sizeof(path), "%s/%s", "pg_replslot", filename);
+    return pg_ls_dir_files(fcinfo, path, false);

I think we need to do some additional input validation here.  It's
pretty easy to use this to see the contents of other directories.

        postgres=# SELECT * FROM pg_ls_replslotdir('../');
                 name         | size  |      modification
        ----------------------+-------+------------------------
         postgresql.conf      | 28995 | 2021-11-17 18:40:33+00
         pg_hba.conf          |  4789 | 2021-11-17 18:40:33+00
         postmaster.opts      |    39 | 2021-11-17 18:43:07+00
         postgresql.auto.conf |    88 | 2021-11-17 18:40:33+00
         pg_ident.conf        |  1636 | 2021-11-17 18:40:33+00
         postmaster.pid       |    95 | 2021-11-17 18:43:07+00
         PG_VERSION           |     3 | 2021-11-17 18:40:33+00
        (7 rows)

Nathan


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Melanie Plageman
Дата:
Сообщение: Re: Parallel Full Hash Join
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Propose a new hook for mutating the query bounds