Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v3uDE-005QGB-3o for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Oct 2025 10:37:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v3uDA-000hco-Ta for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Oct 2025 10:37:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v3uDA-000hcc-9V for pgsql-hackers@lists.postgresql.org; Wed, 01 Oct 2025 10:37:29 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v3uD8-000r0i-0q for pgsql-hackers@lists.postgresql.org; Wed, 01 Oct 2025 10:37:28 +0000 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 1ACA3EC00D9; Wed, 1 Oct 2025 06:37:26 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Wed, 01 Oct 2025 06:37:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1759315046; x= 1759401446; bh=dQsodpjne0MnAJhhfWX2B1juWblSRekYnFPipUivZqM=; b=Z VKXgHEQlMuLkyeL3metSqi8b7V/3a71PRcEf9pGqRGicDM+WGFy7Dku4ciJcQqxT Fx0d+96le4GqVAfmN2kqb+j2G8BFxYhZ54EsCiCV34P0kXt/wvP0cuN8Z7iCnN3+ RksycWp+WidNWwvWTPQwNr2ihQc6jqi6MefHlu8BvxuZ2o8rAtd5dbBwTn6zvklz GvlweEochAasDhaGBvyoPlul/frV+QY3iG+T59xGrPNIhed6p5Qq6zXJ4KqCggrG RlyYD70EmIjCsIuZQ3u/+EbK6ChZd7LsXii0kDBCxPpvT5o2CRXRNWblLdK+icXW 1KoP30Ifx/a3cqilJ845Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1759315046; x=1759401446; bh=d Qsodpjne0MnAJhhfWX2B1juWblSRekYnFPipUivZqM=; b=wj+Q8dTo3UESauNrk AWJfonhm5HJDCnVy9rf9hO9IWcTgeJ6X+OLQxekr/5oTR2izFkj1DGFMFYn2G6uA wOhAYFItFLk0D9mxWsaGknIhbakJnWAN1ZkDbx9Bu8BfRV9UD5uPtGV93S+PZDhG DNy5uPh2yrTpZ+JYuGnlj4tCsJ8qGywnjzpyNXE9hUtzpYfhha+WH2WCPMyJFzk2 I0CB03dRkdOOTfDOpTlaS3Uw35dCqMXacs+kYq65HkhifEGiEMtFjpPv0c/wYhaY SlmEGLTMyWl7fUF/zMMo+0vWVTA9s+/HNAVRmdp6J6C29YkLCTI3DLyUj6extplZ yQk2Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdekvdeludcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpemllhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrf grthhtvghrnhepudefhffgkedufffgjeduudejjeehjeetuedvkeegveehjeeugfefheev tdefkedunecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhdpfihikhhish houhhrtggvrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtth hopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehkuhhrohgurgdrhhgrhigr thhosehfuhhjihhtshhurdgtohhmpdhrtghpthhtohepshhmihhthhhpsgdvvdehtdesgh hmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhs rdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Oct 2025 06:37:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1759315040; bh=ItOekfZO85yHXJDHrG0KC/3rb4seQrD9yfmjVeo8bp0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Y5eEql3cqSt8UZwJuJiXA6C+IZjhbF7QGou3fePuykYdNIV/Rg0/P67DEkhyKUOzT Bgg9V2iJ/2QYr/v4yvpkQb2AlUiu8t3Y+x8doWdpU5bHYUUY/TD8a1mGDGuFIhJUck eAjLljSwPYpzTfWFrQE3Gex52vlb41fB33/bF79MLKLxF4CrS48jN+vJAeyPINILFf /7/NuNbT1yN7JjL4/vBHaEl4YJQDNZIlHA6GrYeKWl4iOcVX2P75m9Ihr+PMVJmyY0 lTADG0v7gE54YYBkmMPrJKf3RVBDg2ivRnBL4BujerYEZBaJDMW1H72K4mVu/+oNJ5 FuRkqPPRBrNIg== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 95EB876; Wed, 01 Oct 2025 12:37:20 +0200 (CEST) Date: Wed, 1 Oct 2025 12:37:20 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Peter Smith Cc: "Hayato Kuroda (Fujitsu)" , PostgreSQL Hackers Subject: Re: pg_createsubscriber --dry-run logging concerns Message-ID: <202510011031.6emshjc2co4s@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Oct-01, Peter Smith wrote: > (code below may not work; it's just for illustrative purposes) > > #define pg_log_info_checkdry(...) do {\ > if (dry_run)\ > pg_log_generic(PG_LOG_INFO, PG_LOG_PRIMARY, "[dry-run NOP]" __VA_ARGS__);\ > else;\ > pg_log_generic(PG_LOG_INFO, PG_LOG_PRIMARY, __VA_ARGS__);\ > } while (0); I like this kind of idea best. However I think it might be better to do it the other way around: have the normal pg_log_info() check dry_run, and have a special one for the messages that are to be identical in either mode. I'm not sure how difficult this is to implement, though. pg_subscriber is not the only program with a dry-run mode; it looks like pg_archiveclean, pg_combinebackup, pg_resetwal, pg_rewind have one. Is it worth maybe doing something at the common/logging.c level rather than specifically pg_createsubscriber? -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ […] indem ich in meinem Leben oft an euch gedacht, euch glücklich zu machen. Seyd es! A menudo he pensado en vosotros, en haceros felices. ¡Sedlo, pues! Heiligenstädter Testament, L. v. Beethoven, 1802 https://de.wikisource.org/wiki/Heiligenstädter_Testament