Re: Resetting recovery target parameters in pg_createsubscriber

From: Andrey Rudometov <unlimitedhikari(at)gmail(dot)com>
To: Alena Vinter <dlaaren8(at)gmail(dot)com>
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Ilyasov Ian <ianilyasov(at)outlook(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Resetting recovery target parameters in pg_createsubscriber
Date: 2025-12-13 05:07:35
Message-ID: CAF6JsWii_yNsmjzu4W=f+LF=ZpENt5FwZ3wup-k6Evd+4NX02w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Alena!

While reading through your patch, i noticed backend's include of
+#include "storage/fd.h"

which, as I understand, is needed for
+err = durable_rename(filename_with_original_contents, filename, ERROR);
+durable_rename(filename, filename_with_original_contents, FATAL);

Postgres' source code actually has two different durable_rename
signatures - one for frontend, and one for backend. As
pg_createsubscriber uses frontend definitions, I suggest replacing
this durable_rename with one from common/file_utils.h.

A patch with my approach to replacement is in attachments
(to be applied after yours).

p.s. I wonder why this builds at all - as far as I have tried, using
BE in FE usually leads to a ton of compilation errors or, at least,
warnings treated as errors - p.e, in this case backend definition
uses ereport(), which does not work in frontend utilities.

--
best regards,
Andrey Rudometov

Attachment Content-Type Size
v1-0001-Change-createsubscriber-s-durable_rename-to-fe.patch text/x-patch 1.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-12-13 05:16:28 virtual generated column as partition key
Previous Message Bryan Green 2025-12-13 04:46:45 Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain