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 1vfVkV-002Q61-07 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jan 2026 04:11:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vfVkT-002jDs-38 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jan 2026 04:11:18 +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 1vfVkT-002jDk-1x for pgsql-hackers@lists.postgresql.org; Tue, 13 Jan 2026 04:11:17 +0000 Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vfVkR-0008Qb-1I for pgsql-hackers@lists.postgresql.org; Tue, 13 Jan 2026 04:11:16 +0000 Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-78fc174ada4so66692227b3.2 for ; Mon, 12 Jan 2026 20:11:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768277475; x=1768882275; 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=7buvdvdu9L9TejHahH5hPXF1Q7gs1AkVrsYpk9A1iFw=; b=QpC8wHxfHf+22E7536EmmbgX09gP8EkgCUyk7EkPkFVtRpvH7mP82X/KkhJ2L1KdLq tqimxWbLK4tjXQDwnqHm89I5Wtgm4yKht3GIAvJ3EesQHyTwyXnfHKt99b9aYWEUE2j8 VB7+BGUF0aYKUrdL8SwkSY6idv7rhBmU4wzvejjWsNWnVNvR7NqwiV6HUFUkZHDp7acr Ag4Cr9EmzXzZF1t75wk8AhhJu45WcRybBs9PP8cQeoeGe4aoF2Qa0+166oLEFjVnWJ93 o3dE7Ce/S8CoAOx2XJShyc5KkcslcBLLubQKqdfxzjh6+wnRqkmXddlwXLlGSghaq1AS SnCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768277475; x=1768882275; 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=7buvdvdu9L9TejHahH5hPXF1Q7gs1AkVrsYpk9A1iFw=; b=FTpC2CfYP9kdf8NUGhha8KnoOWxOkgGUzBgyNfoXmvgr/7ebyH070C2KDffr1l56UN 9cspOdWJm7zDn/h3NmXXsr8FjENjflXAu9G3mLsZFZEt9NFAVq3VRpKqGm2f8TJMZqZq mWkSowOjTuiwcp4pVKV1wkKFVFXKVR2TNDayTyuZDd4Gk34n1tiGB52U8I3oV+9Uyvwe 5NpKzsrBHhNphyIrxOpgcEimYRIQ8rKPUV6a38zuUod77QeH0f+ZZ02Ds3dZzMdt9Ptb SNufTgZTxJWkEPsx/L4s6hMn1VBVlHD+ezPnbgnS4HSqad5S7GIhEgb5rnkd1Qsfatos 0XgA== X-Forwarded-Encrypted: i=1; AJvYcCX9XxP2xQymmY99QvnpaIX9IPpZWWCttqsLtGiXYD4P0ts0c8L/xPkKgcQ0D1jjUswFOnDnuWCSTjenGltY@lists.postgresql.org X-Gm-Message-State: AOJu0YxXrgTjBOC4qZuxT25jntX8mozgIa2kANruChhyOuKr0YOyEXcC 8186kqMM+kaFmEmIFOFpPICZMbPLvnHEIYkL5wolyo6t/QXeF9srumuUzQ6EKCozM+4/gfVyRHq Ig+gK1J2sUFxPt0eT82bjd/19xEGM2so= X-Gm-Gg: AY/fxX6do9puo7hGy0/WHsRjtq2vFza8RzTiy717edbdSwuP+MXlSTvDegaYMHwmo9c GXX+psJB1NYILPnnv1z3cMhuIBEg9yv6Ht7qCJnSldNHFyexhAcrRoSK/YTji6VEw/CJCt+ds+a 26XcYnYRNF3xPRidSdsBFAzTrA1qsSnghdgmUnu7D6GhuzEfQ203lOD5YdyWQcP7lnDwpk4T+Fu PfTU3lfgWkaud3WkGwhOFy5mQlqFZehub91GKx0Z9qQtDdfBR5qtvLp7F0as1qde1dC3uMD6Q== X-Google-Smtp-Source: AGHT+IEc12GjgpUFYmWfUaPv+KCgC1ELkV4bskJWpVG1lDncUy5aMQi1IWsXh2T9+JabY57aXhX15U4RWE4R3sD4p4I= X-Received: by 2002:a05:690e:128e:b0:646:903c:1b90 with SMTP id 956f58d0204a3-64716bc3c10mr16018904d50.41.1768277475126; Mon, 12 Jan 2026 20:11:15 -0800 (PST) MIME-Version: 1.0 References: <48261e54-c4f1-4bde-a4a9-4f3698a6b380@app.fastmail.com> In-Reply-To: From: vignesh C Date: Tue, 13 Jan 2026 09:41:02 +0530 X-Gm-Features: AZwV_QigQa3qtXhqDZ1CTKqkouL1xs79pSIRioFBs7WQEbcrryUf2l4HsnJ38Eg Message-ID: Subject: Re: [Proposal] Adding Log File Capability to pg_createsubscriber To: Gyan Sreejith Cc: Amit Kapila , Euler Taveira , "kuroda.hayato@fujitsu.com" , "pgsql-hackers@lists.postgresql.org" , Peter Smith 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 Mon, 29 Dec 2025 at 16:40, vignesh C wrote: > > On Wed, 24 Dec 2025 at 04:52, Gyan Sreejith wro= te: > > > > Thank you for the feedback everybody. As I read through this email chai= n, I found differing opinions on how logging should be implemented. This am= biguity leaves me unsure as to which solution(s) to pursue. As of right now= , I have attached the git-format patch like Hayato Kuroda recommended (but = it does not have any new changes). I am willing to implement whatever solut= ion when we reach a consensus. > > Few comments: > 1) The file permissions are 664 for pg_createsubscriber_internal.log, > pg_createsubscriber_resetwal.log but 600 for > pg_createsubscriber_server.log. The permissions should be the same for > all the files. > ... > if (opt->log_dir !=3D NULL) > out_file =3D psprintf("%s/pg_createsubscriber_resetwal.log", opt->log_dir= ); > else > out_file =3D DEVNULL; > > cmd_str =3D psprintf("\"%s\" -D \"%s\" > \"%s\"", pg_resetwal_path, > subscriber_dir, out_file); > > pg_log_debug("pg_resetwal command is: %s", cmd_str); > ... > > ... > if (opt->log_dir !=3D NULL) > { > appendPQExpBuffer(pg_ctl_cmd, " -l %s/pg_createsubscriber_server.log", > opt->log_dir); > } > > pg_log_debug("pg_ctl command is: %s", pg_ctl_cmd->data); > rc =3D system(pg_ctl_cmd->data); > ... For this, you can align the file handling and umask behavior with the logic used in syslogger.c (logfile_open). Doing so will ensure that the resulting log files are created with consistent permissions across all cases. Additionally you can include "The umask is set to 077, so access to the log file is disallowed to other users by default" in the documentation of the pg_createsubscriber log option similar to how it is mentioned in [1]. [1] - https://www.postgresql.org/docs/current/app-pg-ctl.html Regards, Vignesh