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 1w9lMG-001ivj-1g for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 14:55: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 1w9lME-009QZ3-34 for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 14:55: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 1w9lME-009QYu-1y for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 14:55:19 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w9lMC-00000000uls-1quX for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 14:55:18 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-b9358dd7f79so740212866b.1 for ; Mon, 06 Apr 2026 07:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775487316; cv=none; d=google.com; s=arc-20240605; b=b0JG59cQoahDsfwkOnj0+9hai2chGimOiqrRbGL0KuHVlyR1VcxpJB4Y95nuiGcM20 xzt1Mxq9IlXLsW7ua4mEVD/71wdZ5biEBz4L1dU4uzc7MSnMQlt1LHxdwI+q7qM7qM4y ZGdtfSb8CffoGRaMLzIG+HQPplxD8mqJVAE5c2CT4EjF744UZKsZZVAFr9XCcbrimAQR SHtgRxHeubSwKTXggzePTZhZqT5H4DmwcWLlOFbAnhQg9NppAZf3wQY9e4TcRXi5eRvU +gH3V/xDq0v2MmR+aIxm7DfPxDlPXlI2W+6cF+4luvMZDkfyKhVE79uXpI78b4v24xgh 6+vg== 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=0vW+nXXfbESeqI39rNuklh0ZDPw17FTv8rrg4ZO4Dzk=; fh=x4xgi4tdDukVB0fBuAIe3vORvD36rbbTBlhrrGN8QbM=; b=aQ8cascAZsYxpOwuwXY02hOzd1LoLThUnUJKHSZy3zeHc9legJsjkLuRZCEs26PEXk TOLwug1NXxwBHpC2bDH0pRdRS42VgH6+lz5yP6FP+ax8wTy0t2LbWEegRVBIgrHk2fnv z9Rthvh8ifbNL9E1Y8oBXUatqWLOhYuX/zH5rrkbhU8MfmgcxdxAfyo02sMV+RYQvkSC FXSlbbM94ZHTCGFNGaGJD3MKRtRTq21TfYCl2DOnz9UMJ2QzALbVD7CzdF0yB2PiF6Me o0vHulGH11LwAs+6Z7Q5VlkoZgywpa1Vv1gXs5UMFrf35byiPfCNXV9OT+pQCHO3VDU6 0nQQ==; 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=20251104; t=1775487316; x=1776092116; 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=0vW+nXXfbESeqI39rNuklh0ZDPw17FTv8rrg4ZO4Dzk=; b=nDsfO1CJZm4XCqyLcUPwKfCmwZkQX5USBdhzAKP2ERaSnMLzNBRkwOTup26tqNrnHm aSLCJZzXByrjBJZ12oEVyS8lnLTINTGgj/vSit8P97IyHTo7qTkBMOvOSOR4AWGH+bl5 P5VhF8BG4+CQIED4xyiLrCrjvcmEB5FAVFj24O5/MtVT/lpINwtqBRnepPzatDTinOHl LTb4p5hZytXVk0pHaYW+13dijMK5Onp0ZzQ9fw4FuU5hoU64zMsJIwrjdXhA/sgBWqmt 1mE7Mn+nmAFKt65bnO6Lq/15BPH1g9tvbbs9++GarevWHelVq7IiQnHbT5BnoGVc5B2G PbBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775487316; x=1776092116; 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=0vW+nXXfbESeqI39rNuklh0ZDPw17FTv8rrg4ZO4Dzk=; b=eGUltI7mqgp1JRK2HipPTMzSQNkt5aT4RTBkpGxFouNFeBtt37A1Z7KiYewSuMktA1 bwB8KD0S+CJOzgQzBQLV01Z7/S0NgHmUFmwpqO+AoJpzWRfAbQTbGvKMnrY2+Vs9s5P1 ZdXRc27/d4q9v23lq6mrDy5sRpxs2CnHypPpNaW4KjQvavfMMo1mskzImREN9f8Lr0Oj 6QGaZX1AklJBgrxDbgMOhkegy6kKEDVH0uzeW1INgXS9SBRI/YPK3XDPqh8v6ks9c0VK SyLXYJm5/LUOy6g9ebpfR72nU/F68sieAYlrJ9G4cV7uEqaCKiwTE8HFAMtYCSxlUas0 qhJA== X-Gm-Message-State: AOJu0YyHDwBbkf2q+aYw20VYNAOnIrBtGqazR80eQgxArGcXatVbVEeO 7U/vznI6PRbiB/D1Oqssbs4+1LateTY7ws/b5EkZ9rIIdYMWj1VsZ4nuk6wdSI01SArDrR3zcoi xWLzRGOy94k2/yVPZ/vkkhFtlPimVlsk= X-Gm-Gg: AeBDiev0FcRkgofesPRxOomcYpqMUNyZwW9gpU2MMHGpQhTSFnI5xRa7oh4i10yM8Uw 61yCWXDRZFJh/6ThEGGCjI2lpuhSA2XaQ2Lka/SjMmG1no4yUC88yBphQnL68jRLu/F9X4E6Rkh f548vWTXyf3NOm6iDSL2GAhGXlrf8dRgzBHm8PMVWeSbIi8BkIMh23ksqWqPDF9STrsJ9q5I1NP bGlbe0JDg5HH+wAWyPtZMZgNyT358XKOrak1NFKhBxBBf8FzkPO/0WxzaL4jS8I0lOmseapwp44 r52SOkfmjCZCtR76kgfswWZHV/VfKOzhmFTV4hD/IJ8p23lOVg== X-Received: by 2002:a17:907:3895:b0:b96:dec7:5209 with SMTP id a640c23a62f3a-b9c67678f40mr660759066b.17.1775487315723; Mon, 06 Apr 2026 07:55:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Robert Haas Date: Mon, 6 Apr 2026 10:55:02 -0400 X-Gm-Features: AQROBzA8LGyQASXg1F_G_zgstZ-EETyt09f2HNYSFMnftHylRMKqWi6XQgH5Gm4 Message-ID: Subject: Re: pgsql: Reduce log level of some logical decoding messages from LOG to D To: Fujii Masao Cc: PostgreSQL Hackers 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, Apr 2, 2026 at 8:45=E2=80=AFPM Fujii Masao = wrote: > > If something goes wrong, enabling the messages for the future > > won't tell you what went wrong in the past. I am wondering whether a > > better approach might be to set the LOG level based on context -- that > > is, if it's actually logical decoding, log this at LOG, but if it's > > just someone peeking at a slot or similar, reduce the log level to > > DEBUG1 or, really, probably more like DEBUG3. > > You are suggesting something like that logical walsender and > pg_logical_slot_get_changes() should log at LOG, while the slotsync worke= r > should use DEBUG? Sorry, I may be misunderstanding, since the slotsync wo= rker > can also use logical decoding mechanism internally. Could you clarify wha= t you > have in mind by "peeking at a slot or similar"? No, what I mean is that if someone runs an SQL function from the foreground, they probably don't want that to result in a LOG message, but if background activity results in such a message, the LOG message is probably a good idea. The reasons are: 1. Somebody might run many foreground queries that rely on the logical decoding infrastructure, so logging something every time such a query is executed could produce a lot of log spam. But there shouldn't be so much background logical decoding for this to be an issue. 2. If logical replication is not working, that may be a major issue for the DBA. A problem running pg_logical_slot_get_changes() is likely not as critical (and if it is, they can always lower client_min_messages or log_min_messages for that session only). --=20 Robert Haas EDB: http://www.enterprisedb.com