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 1vW7p9-00Dc2d-27 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Dec 2025 06:49:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vW7p8-000aKV-1r for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Dec 2025 06:49:19 +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 1vW7p8-000aKL-0h for pgsql-hackers@lists.postgresql.org; Thu, 18 Dec 2025 06:49:19 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vW7p6-001Mi8-15 for pgsql-hackers@lists.postgresql.org; Thu, 18 Dec 2025 06:49:18 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-37a415a22ecso2486481fa.0 for ; Wed, 17 Dec 2025 22:49:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766040555; x=1766645355; 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=y+jvY1MphyWoEAPpMcAyZYr6frXydMYO06dLNIQztns=; b=BqEhEetK2beeU3tBKbQWljE9hpmW+TZJX8yPCQgqE0cj3Ou1PVKLN07ISHYnuwtuqi HXrF2Keghjjt0vntKziVPkdDv6EyDWFI3tC7gdCC7aZ5JL6Fu0ASzQ9ME4AyHXRWttfC 6AJaw5ETatKlsxlxGWMyTWdFtdJxO+HysMJ0OF52l8jMZ0m2DLjM6S7zJL3M+BrocQKT uFcvLZ9zeXy1fBKvOz/elCrX6nvMO9DRVbkGRPzKil5g5BVIPNPq2RBKLXRErKkCNrZz hmRNUHKbGtT4Wh13VeYac1wViEXroy8zToEDMwPyFL5lBaroHwvNcNRWQGJjZC+Thvor Cvvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766040555; x=1766645355; 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=y+jvY1MphyWoEAPpMcAyZYr6frXydMYO06dLNIQztns=; b=Nphu/c1yAe2c3v0UDs/vlSCjM8fm29a85iq/Zotr4ZbBJTYJgO/CwzSrVFs5Ad7JHh UCyT09EAOr4j/XbOH2MlbFFqzBju4GS88xDt4j2HTrf6E79hhoGFA/dtYRfcZt9YWg9r uLFg2UycF4dm4C6WO2EtQrEh3QChkC8iHjUiGgpZDfJSIOLsULfRW74JDFUqMtvn9Cns hXzykAaM3OWR/pQmkK+OQvAdGcVyyOaQCSAN86JJ6Iwyb6RVlImn6b5NkFv25/gBfjwn Fz9/4tCTO+8WKTPTtcTARyHIwTqeANTQJ/mr+dNhng54RTiJjptgMxhVHplWetoB/h92 aWlg== X-Forwarded-Encrypted: i=1; AJvYcCXFy1Ybuc5qGn96MItMOlhX8HIhScIGkhE70p7q7iJ93Kja1nokJqObG9r/PmkRQVU+hMY5gHGk1Tv1ag5R@lists.postgresql.org X-Gm-Message-State: AOJu0Yw8lUC43vDohiiyE6vfx1WP+0wVSGOUFSki4rpseaANFdnQEwLv N4fdoJ5Dvd6gDl1CvAIjqeEuI4E7OQ9XbEUtG1GHHNe/c58vwrPPp15PyXDccS6cr6sngq/6jC4 bJA4sfgL9eJub2/vrfaLHfwNVbrdswc4= X-Gm-Gg: AY/fxX45CEIAFLTBNUiUGWS7fD8YmB6BlcTx9lrhbtr/7OfUVgBXWnu/bBAdsES5r4z 0niAH6AOr0pk9Gh4dW3Q0oaCmqQjlLksrhq5QzvhXYYnXKv/C+CR/61Tq2gxz2ZkgFx96OvLVsi hQSEIfG27OjMxup/bfjXbZiePkW8hfg1qHMKKYPe9kE7HWo5yrF6D+2YnWAL0ywx1D5gWmpEq+K SdczqwBy1VUULdA6RJCZBtsj9GTAQBm66GWdsQU7JTqB8pjfmgbeg+ecpim9Bskkxkp0TnKuZ6F CZC8v2WrB7dct6rbhzzOnrgmbk8Y5g== X-Google-Smtp-Source: AGHT+IFw1nWL2ofWXsQOmVclgv3a8qACX2QIAFHdc/fxTYjm1G2pwb+fz81Hi35jQkPF82eHdCAH4SvOE22RwJNqD+k= X-Received: by 2002:a2e:b88f:0:b0:37a:d20:3215 with SMTP id 38308e7fff4ca-381131d4ca6mr6491711fa.6.1766040554328; Wed, 17 Dec 2025 22:49:14 -0800 (PST) MIME-Version: 1.0 References: <48261e54-c4f1-4bde-a4a9-4f3698a6b380@app.fastmail.com> In-Reply-To: <48261e54-c4f1-4bde-a4a9-4f3698a6b380@app.fastmail.com> From: Amit Kapila Date: Thu, 18 Dec 2025 12:19:02 +0530 X-Gm-Features: AQt7F2piBkk0ExY1vM-fPgRmnmbyF4mEkBlj2hweH57styB16Vra5TfAfuVm9Tk Message-ID: Subject: Re: [Proposal] Adding Log File Capability to pg_createsubscriber To: Euler Taveira Cc: vignesh C , "kuroda.hayato@fujitsu.com" , Gyan Sreejith , "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 Thu, Dec 18, 2025 at 6:59=E2=80=AFAM Euler Taveira w= rote: > > On Wed, Dec 17, 2025, at 7:07 AM, vignesh C wrote: > > > > By providing this as an option, users can store the log files outside > > the data directory, eliminating the need for any additional handling > > during backups. > > > > Do we really need an option to capture the stdout / stderr output to a fi= le? I > doubt it. There is already various ways to capture. psql and pg_upgrade a= re the > only tools that have this option. > pg_ctl also has the -l option. I think any place where long text/errors can be outputted, a log file is preferred because one could later parse it to know the exact details. Also, splitting the log as proposed here or in pg_upgrade helps to navigate the LOG like is the problem in start/stop of the server or a pub-sub setup? Similarly the log can be splitted for pub/sub specific information. There appears to be some useful information like: pg_createsubscriber: warning: two_phase option will not be enabled for replication slots pg_createsubscriber: detail: Subscriptions will be created with the two_phase option disabled. Prepared transactions will be replicated at COMMIT PREPARED. pg_createsubscriber: hint: You can use the command-line option --enable-two-phase to enable two_phase. I think it will be useful to LOG this separately from the main LOG [1] (which can contain server specific info as follows) so that users can consider running pg_createsubscriber with additional options or changing the subscriber configuration once setup is complete. [1]: [startup] LOG: database system was interrupted; last known up at 2025-12-17 14:46:07 IST [startup] LOG: starting backup recovery with redo LSN 0/06000028, checkpoint LSN 0/06000080, on timeline ID 1 [startup] LOG: entering standby mode [startup] LOG: redo starts at 0/06000028 [startup] LOG: completed backup recovery with redo LSN 0/06000028 and end LSN 0/06000120 [startup] LOG: consistent recovery state reached at 0/06000120 --=20 With Regards, Amit Kapila.