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.96) (envelope-from ) id 1wA6bG-0024Dv-28 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 13:36:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wA6bF-0008LD-0H for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 13:36:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wA6bE-0008L5-2a for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 13:36:13 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wA6bC-000000016si-36aj for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 13:36:12 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 5300C7A0169; Tue, 7 Apr 2026 09:36:08 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 07 Apr 2026 09:36:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1775568968; x=1775655368; bh=C4GQMfskJ74rakCUA9ABKMOkLvUsHGLK mntByl0Hark=; b=DY1vQ6/3E4swWtvqEiqZa+3u1G/ABJWy6H/4QXnFRzxqE/sD ftvfnyesgVTCDTc7bRwBpouNnmDAxoBObrkrxBaYNdiphcLD2eSJhX9G3uQYO6PI NDuqKfv/L7D5ocVPjQp5n1hBkdcd0yYAf4V8ji1z15aA0Cb0w53EDL8aq2sIGFKY zSIc5c8+lQnIO1dJ+5y8YKHxVZaGdSL0vnDPJAMt0hLdIUZIHcGiyWzMB2tNnf+K 3v3TqQ6EiOMJ4ACFFr0rXCJ48t2QO5Rzt0yVukEEkd8vxaFpe89TpEQWDf+ngt/4 jvUyfhFyPOqYeRVQVev2GvvrrTNj0OZC0XtmJQ== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1775568968; x= 1775655368; bh=C4GQMfskJ74rakCUA9ABKMOkLvUsHGLKmntByl0Hark=; b=S 0bAQ9Xz264OqxFmNKvFV+kjZM9KfTeZjb6FRC5Y7oeCO2JRKQAP9tWrM+rxWE+ph VbR25JiFSFDmStENUlOeAh4ElkOd1gBe+o5CYVlQBhbWaJm3EtuHSxgnOvRCBL09 vzVKnjVEYLFTHKcmYHFJvYT+j4BHsJrv1zz7w3xpdhyzjCUc8AnFj/NhcMtaOwzb umXyh3Wu8r7qS2PAXQ1LdTbL2gp7Tw76vPesOhLWET7kax7rWtJDZIXCysokUAmf 444v/WtUlHSJWlTH2Pau9YwP+n8234uqVmoLJcWOCcW41Z1vtgRYCTn808LlSZij 800sJgsxrHPqkmfjpNNYQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvtdejkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomheprfgvthgvrhcu gfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqeenuc ggtffrrghtthgvrhhnpeejhfevhedttefgfffhhfeffefggffhffelgfeiueeukeehvdeh vdefheffvdefueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhrghdpnhgspghrtghpthhtohep ledpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghmihhtrdhkrghpihhlrgduie esghhmrghilhdrtghomhdprhgtphhtthhopehghigrnhdrshhrvggvjhhithhhsehgmhgr ihhlrdgtohhmpdhrtghpthhtohepshhmihhthhhpsgdvvdehtdesghhmrghilhdrtghomh dprhgtphhtthhopehkuhhrohgurgdrhhgrhigrthhosehfuhhjihhtshhurdgtohhmpdhr tghpthhtohepshhhvhgvthgrrdhmrghlihhksehgmhgrihhlrdgtohhmpdhrtghpthhtoh epshhhlhhokhdrkhihrghlrdhoshhssehgmhgrihhlrdgtohhmpdhrtghpthhtohepvhhi ghhnvghshhdvudesghhmrghilhdrtghomhdprhgtphhtthhopegvuhhlvghrsegvuhhlvg hrthhordgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdr phhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Apr 2026 09:36:06 -0400 (EDT) Message-ID: <78ae6b84-ad9d-4820-8b09-a37d18d05a1c@eisentraut.org> Date: Tue, 7 Apr 2026 15:36:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Proposal] Adding Log File Capability to pg_createsubscriber To: Amit Kapila Cc: Gyan Sreejith , Peter Smith , "Hayato Kuroda (Fujitsu)" , shveta malik , Shlok Kyal , vignesh C , Euler Taveira , "pgsql-hackers@lists.postgresql.org" References: <4c2eb422-696c-4e34-84e7-6c6cd95781ab@eisentraut.org> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 01.04.26 06:56, Amit Kapila wrote: > On Tue, Mar 31, 2026 at 5:36 PM Peter Eisentraut wrote: >> >> On 25.03.26 09:25, Amit Kapila wrote: >>> On Wed, Mar 25, 2026 at 5:43 AM Gyan Sreejith wrote: >>>> >>>> Thank you, Kuroda-san and Chao for the suggestions and the patch. I have merged it with v18-0001, and I have fixed everything that Peter suggested. >>>> >>> >>> Pushed after minor changes. >> >> Instead of creating a new logging API in pg_createsubscriber locally, >> why not extend logging.c to support a log file. >> > > Few things we may want to consider if we want to use extended > logging.c: (a) what if we want information to be written in multiple > files (say pub/sub specific info into separate files), something like > what pg_upgrade does, (b) what if we want to write some info to only > one of terminal or log_file, we can probably extend generic API for > this. In the proposed API, you can switch the log file at any time. And there could be a separate log level for file output versus terminal output. >> This is much simpler, >> doesn't require caller changes, and could be reused elsewhere. See >> attached patches. (The 0003 and 0004 are just some additional code >> simplifications.) >> > > In 0004, > -static char logdir[MAXPGPATH]; /* Subdirectory of the user specified logdir > +static char *logdir = NULL; /* Subdirectory of the user specified logdir > > At other places like pg_upgrade, we use MAXPGPATH for a similar case > probably to have standard length on all platforms, see > make_outputdirs() in pg_upgrade.c. I think using MAXPGPATH is kind of deprecated and useless, certainly in new code. But apart from that, note that in pg_createsubscriber.c itself, subscriber_dir is dynamically allocated.