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 1w4c0H-002McW-29 for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 09:55:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4c0F-00Gjac-3C for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 09:55:20 +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.96) (envelope-from ) id 1w4c0F-00GjaU-1l for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2026 09:55:20 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4c0E-00000000bXf-0fvP for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2026 09:55:19 +0000 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-c742bc88d87so1386938a12.1 for ; Mon, 23 Mar 2026 02:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774259717; cv=none; d=google.com; s=arc-20240605; b=U6DjfhTEM7l84/sNCjGU/Y5+00QLui+loKpQ5B72kiqq2VCBxRsDqK/m7rnnDAaGwd M1V9eKAeFnjnYnPD60FHYDAld73xPZ4fRyPbG51TG3EbPfkebXsK6/umP5XTqHk6X/JV KyQIVf//VRTBBK7stycP7zHu0fodyEVjWKE247COJTZ0ZzEShDWgKMTrVdlP5wlprxaf gEXo/YCOcdRwgbxK009DXav1XdtxF+tD39S68qmJSCBJ75MzDYvjkE6Cyh1+DGkx9RGO UsYuKZUBLH4C1lIynr/SPe19t29ceWkF3fvT6v4orjIiBjhenkz7l9AUFsjU4TzLHEnE wUJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AbukC+ZOvny3IRbqXrtZw7szHumJYiMyBHRQDob9erE=; fh=LfP7X0Z709wwgjt00sJKSBnjw4APVLV8xBPXXVKkKlQ=; b=k2cD/S3gHr0cZMT16gECXO/PqjQ+LcutF20rdvMIWtinkTmUXCN3kv5x+HPrdopYCl rhSW6lmj9ZWOgoi6IQp75wc/bGkxuyBO/h6gHWKMMem1rL2brZKIn/bE5wBA7IJtBYnp /onXRmaSvy0WLg7TtsiJdg3kT3e9mne8e3ewkEf0YvgKG3UmYEKOe1X/MAmciBAgvP6R gI9H3Rk3lT6pGPjwLTk9UgwRZSs4af/0Qmzht/ouMShvHZ8ehx+54hSNThHMBYjIY35x EI1JWOovHn/6w5AmZr+71ndv58fcrnbX+N86zXhVX3BA18XuHkGTjuCxO7V4l/L2yFPX 4yDw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774259717; x=1774864517; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=AbukC+ZOvny3IRbqXrtZw7szHumJYiMyBHRQDob9erE=; b=c/A9x0b67XuHzMYFJpY60dEaa2W8ZSBgXh5kfllfkxr4g3f/DZmIbgJN0F5zKQxRpx UhbgKl7ZSZX1I7XVHukEJJO/ROmjSk6TJcg7nWbbLdof6iPE5BDF0qunphKOofYWNvE2 g9F27hHilKeVizZF8Fk/XxcqIjBScBmcxc/5Lt0JB3WsfBcJZEQP9dUnlfTvM/dHFm6/ pOi5EutZgp3fLu5eWXrsW13mon4vNQok/iupy36UuKwlzSOX4z/nfBmRNjjgKiwVk2yQ bdbWkMQ4cAK32d1g5siqInnOtXwzVTA1i585aMu+s6zXpiG0GOmB0KGKuY/gYjBPTHxR zCBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774259717; x=1774864517; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AbukC+ZOvny3IRbqXrtZw7szHumJYiMyBHRQDob9erE=; b=qp1NwxTs3KHyyVoC5qM1X2Nfe5CU4gb+F4tM/IRMCngC3EjApInTe22RvaSmyGgnhu dffgbqAFm5syYyQLJrDVjcoKdNRdCrPXR/mUSmQeQEtZQnxXEEuWC7W0xLl4T8O0AW4d zzbhneOgWWbGfk373dSUirgm+bythVtaAel/BmCFpcJWMS36U8n+CtS/fTNiRLiDPgk2 EXII7dRynV0an51/MkXWEtdlVVpULA5fp2fGSoOnE1+MnGMWV/ufXVcgsRxyUNsUUM3r WzB7BP3RzPe4wc4l0hGI+WWAM1d4rrimFDR0D9hX2x8D/sXw/07ikPqcY2OpFXJ1itS0 7RZg== X-Forwarded-Encrypted: i=1; AJvYcCUOTBx2aCdWlCZ7dX2foijhFZuuZiToB8S+DTHq39PrnH6C3yS7ojpdMhF9/nnKu0yteDqiD2g2eQNhhjof@lists.postgresql.org X-Gm-Message-State: AOJu0YxftRxHnELaUjCAHHD3asu40Q9n1B0aZ02wqhlD/AsNleUxt7yl zHB6HtBBhHlPxkBSEYrFrYAt69dQaGfRVzQvO2jR5snC95TGSsI4kan3mnMUcxnsoNjnIazaaeF yxoSNwRhQNELw3cSHd6aL/Duk9/w56Rg= X-Gm-Gg: ATEYQzyEHeaMhY5FWJ/xIu4zl1K2zlgCnnIgCLD/9yb9Mo5qSOMWsbFHBsw1ovrtT38 k4PNxDW+yxaxP8yZOYt8wFd0IukVZi7NYcy0qf4xqfeGIRmUtXvXtors6EznnfEEOnsqLYXYNce EVOH7F5HSjW3ldqVvantOTJQ8WhWgQIW3ctTTHWkPakLAwMoiAomb4rbSQTfGIcvSUHHAQvZfgU tv9J1nLHQCpSw5/gF4ZbngvdmIJTzRF4sRKqVZ0Off03PdkfJOOD2gP8F70jm/AFhzIdqRNnhAq uXuTIyZRY+HtSxj6HZ1n70xY1+ljl8P1ADReksd/U2WnrVnUVM3QIQ== X-Received: by 2002:a05:6a20:a10c:b0:398:4bf2:4285 with SMTP id adf61e73a8af0-39bce9ebf62mr10133833637.16.1774259717116; Mon, 23 Mar 2026 02:55:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Mon, 23 Mar 2026 15:25:04 +0530 X-Gm-Features: AaiRm506NsL1gbenhMZFFEFBqfoTklJ2gkq_d06zYTh3At6K5d5BGskyBODYCsA Message-ID: Subject: Re: [Proposal] Adding Log File Capability to pg_createsubscriber To: Gyan Sreejith Cc: Amit Kapila , =?UTF-8?B?S3Vyb2RhLCBIYXlhdG8v6buS55SwIOmavOS6ug==?= , Shlok Kyal , vignesh C , Euler Taveira , "pgsql-hackers@lists.postgresql.org" , Peter Smith , shveta malik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Mar 22, 2026 at 4:39=E2=80=AFAM Gyan Sreejith wrote: > > > On Sat, Mar 21, 2026 at 5:57=E2=80=AFAM Amit Kapila wrote: >> >> >> Based on the above information, can we consider renaming the above >> >> functions to report_createsub_log() and report_createsub_fatal()? >> >> Other than the above point, 0001 LGTM. > > > I have renamed the functions. > Thanks. Few comments on 002: 1) We can get rid of below alignment related changes in unrelated test parts. ---- -$node_p->safe_psql($db1, qq( +$node_p->safe_psql( + $db1, qq( -is($result, qq(), - "table is not replicated in database $db1"); +is($result, qq(), "table is not replicated in database $db1"); -is($node_p->safe_psql($db2, "SELECT COUNT(*) FROM pg_publication WHERE pubname =3D 'pub2'"), - '1', "publication pub2 was created in $db2"); +is( $node_p->safe_psql( + $db2, "SELECT COUNT(*) FROM pg_publication WHERE pubname =3D 'pub2'"), + '1', + "publication pub2 was created in $db2"); -is($result, qq($db1|{test_pub3} +is( $result, qq($db1|{test_pub3} ---- 2) Can we simplify the logic of report_createsub_log_v to: --- if (internal_log_file_fp !=3D NULL) { va_list arg_cpy; va_copy(arg_cpy, args); internal_log_file_write(level, fmt, arg_cpy); va_end(arg_cpy); } pg_log_generic_v(level, part, fmt, args); --- We need not to invoke pg_log_generic_v in both if and else. 3) + /* Create base directory (ignore if exists) */ + if (mkdir(log_basedir, S_IRWXU) < 0 && errno !=3D EEXIST) + pg_fatal("could not create directory \"%s\": %m", log_basedir); + + /* Create BASE_DIR/$timestamp */ + if (mkdir(logdir, S_IRWXU) < 0) + pg_fatal("could not create directory \"%s\": %m", logdir); -- Instead of S_IRWXU directly, shall we use pg_dir_create_mode (which means S_IRWXU) similar to other modules (pg_upgrade, initdb, pg_dump etc) See pg_upgrade: if (mkdir(log_opts.logdir, pg_dir_create_mode) < 0) pg_fatal("could not create directory \"%s\": %m", log_opts.logdir); 4) + /* Create BASE_DIR/$timestamp */ Above comment refers to BASE_DIR which looks like some variable, but it is not. Can we please change this comment to: /* Create a timestamp-named subdirectory under the base directory */ 5) + /* append milliseconds */ append -->Append thanks Shveta