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 1vMRtA-00A0yS-1y for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Nov 2025 14:13:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vMRt8-007j6Z-39 for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Nov 2025 14:13:27 +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 1vMRt8-007j6R-0s for pgsql-hackers@lists.postgresql.org; Fri, 21 Nov 2025 14:13:26 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vMRt5-000jWs-22 for pgsql-hackers@lists.postgresql.org; Fri, 21 Nov 2025 14:13:26 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3E4911400130; Fri, 21 Nov 2025 09:13:22 -0500 (EST) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-06.internal (MEProxy); Fri, 21 Nov 2025 09:13:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; 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=1763734402; x=1763820802; bh=GoffSEFFwMcKRzy1nAYvS6juSWeal8RoXnxgw6PLPSc=; b= pwy8dPw/QvZzGKIcZr9hT0wNYfPFAFZPQxIWO5xzcaFvoloYgroTRUU7MaeQxlNZ G46udDILTMxQjPKbOCPbtEdSKhiCowgvcjc17NUsQ64Jy/ZE4Su3tsHhrzNZ93Ug rXganvFPOfH4Vlf4Loz+/kR8J7I8iHXLzHzs5p79SPxh3y4wjv4zovNVrYXY5ndY kX4A3R3HNxknkU/u+dBEDHuOa6PbofhHQYegqfSLnaHKVgEHRM2BOij+giK0xtBf J6X8Q+VvWBQKrwW7iJ+VpuTMilyNtspmgeYp8aD7V4Ogv+uX86omXGw3IT3Hbt9f dsdDnNcR6+IjUGDfN44mFQ== 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=fm3; t=1763734402; x= 1763820802; bh=GoffSEFFwMcKRzy1nAYvS6juSWeal8RoXnxgw6PLPSc=; b=j rXAHnklIFfADsTq9rQwQco6MvsdCPmoAwwVCEfG0TvvVPwV7Yhycyi0Ww6msdQ5d TwofKaww7CnUgJqKsDZkpcfBOEJ9x8oV2nEPpexa/xd4AHsnvA/VglQmc3srOpcF IYOxPaW6fGA/XbP+coIDSS6dj6Kw+k8qEtGRsntDLm76GkUPDyXUg7vMN0wTmbtg FFoyNkLG/PBeKBfqY88Y68+NaWk2okfuGBxzYjVS8m2cpexM52CVbFjj2kv9MkOz pzK/3SlJcbyshV/pEOhS36qd6qVXoU825Abe1h1ycaHg+1zUcjfliMYoKKWKMlKB LqG5XTfOgveC5Fq1Mm5gw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvfedtudejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfgfhulhgv rhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecuggftrf grthhtvghrnhephfdtteehfffghfeiuefhgeejtddtveffteelfefhledvhfeikefgudei ueeufefhnecuffhomhgrihhnpeguvggsihgrnhdrnhgvthdpvghnthgvrhhprhhishgvug gsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepvghulhgvrhesvghulhgvrhhtohdrtghomhdpnhgspghrtghpthhtohepgedpmhhoug gvpehsmhhtphhouhhtpdhrtghpthhtoheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhi phdrohhrghdprhgtphhtthhopegrnhgurhgvshesrghnrghrrgiivghlrdguvgdprhgtph htthhopehjrghpihhnlhhisehhohhtmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhq lhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 854131820074; Fri, 21 Nov 2025 09:13:21 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: AGl55nTq-Okk Date: Fri, 21 Nov 2025 11:13:01 -0300 From: "Euler Taveira" To: "Alvaro Herrera" Cc: japin , "Andres Freund" , pgsql-hackers@lists.postgresql.org Message-Id: <6594c13d-6582-46f3-93fd-86e69275262d@app.fastmail.com> In-Reply-To: <202511191005.57xh2abe6zrx@alvherre.pgsql> References: <202511191005.57xh2abe6zrx@alvherre.pgsql> Subject: Re: log_min_messages per backend type Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Nov 19, 2025, at 7:44 AM, Alvaro Herrera wrote: > On 2025-Nov-18, Euler Taveira wrote: >> The "backend type" terminology is exposed. > > Something appearing in the source code does not equate it being exposed > to end users. Things are exposed when they are in the documentation, or > when the SQL interface requires you to use the term. So I don't think > the fact that BackendType appears in the code forces us to use that name > in the user-visible interface now. > It is *already* exposed. $ grep -B 3 -A 3 'backend type' doc/src/sgml/config.sgml The backend type corresponds to the column backend_type in the view pg_stat_activity, -- character count of the error position therein, location of the error in the PostgreSQL source code (if log_error_verbosity is set to verbose), application name, backend type, process ID of parallel group leader, and query id. Here is a sample table definition for storing CSV-format log output: $ grep -B 3 -A 3 'backend_type' doc/src/sgml/config.sgml The backend type corresponds to the column backend_type in the view pg_stat_activity, but additional types can appear -- query_pos integer, location text, application_name text, backend_type text, leader_pid integer, query_id bigint, PRIMARY KEY (session_id, session_line_num) -- Client application name backend_type string Type of backend $ psql -c "SELECT backend_type FROM pg_stat_activity" -d postgres backend_type ------------------------------ client backend autovacuum launcher logical replication launcher io worker io worker io worker checkpointer background writer walwriter (9 rows) > In the glossary, we talk about "processes"; in the definitions there, > "backend" is one type of process. So in this list of "backend types" > that you want to introduce, what you really should be talking about is > "process types", where "backend" is one of the options. > >> It is even available in the >> pg_stat_activity view. I agree that "backend" is not a good name to define a >> Postgres process. I don't think we should be inconsistent only in this patch. >> Even if the proposal is to rename enum BackendType (I won't propose it as part >> of this patch), it would make some extension authors unhappy according to >> codesearch.debian.net. > > I don't think we should rename the BackendType enum. That's in the > source code, not in the documentation or the SQL interface, so we don't > need to care. > I think you missed my point here. As I said if your proposal will let us with 2 terminologies (backend type and process type) as shown above. We can debate if we (1) keep the current terminology (backend type), (2) use the proposed one (process type) or (3) use a mixed variation (keep the SQL interface -- backend_type column but change the description to "process type"). I wouldn't like to break compatibility (pg_stat_activity changes tend to break a lot of stuff) so I'm fine with (1) and (3). >> > I think the list of backend types is pretty hard to read. What do you >> > think about using >> > >> > to create a friendlier representation? >> >> I tried but didn't like the result. See the attached image. > > Well, I like it very much. The original is a solid wall of text, very > hard to read, where you have to squint hunting commas in order to > distinguish one item from the next. (Maybe you are young and have good > eyesight, but you won't be young forever.) In the screenshot you show, > the list of possible process types to use is nicely separated, which > makes it very easy to catch at a glance. Maybe remove "the table", > which is obviously inappropriate, and just say "Valid process types are > listed below, each corresponding to either postmaster, an auxiliary > process type or a backend". > I don't have a strong preference. One advantage of this suggestion is that it is visually easier to identify the types. > (Note your original wording says "a backend type, corresponding to [blah > blah] or a backend" which makes no sense -- how is a backend a type of > backend? It isn't. It's a type of process.) > I'm rewriting that paragraph. >> Good question. The current patch uses "backend" to B_INVALID (that's exactly the >> MyBackendType for postmaster -- see below). I think it is reasonable to create a >> new category "postmaster" and assign it to B_INVALID. > > I guess that would work, but I think it's inadequate. Maybe we could > add a new value B_POSTMASTER and have postmaster switch to that as early > as possible. Then anything that still has B_INVALID must necessarily be > an improperly identified process. Users wouldn't assign a value to that > one (the GUC wouldn't let you); instead those would always use the > default value. Hopefully nobody would see that very often, or at all. > I will create a separate patch for this suggestion. -- Euler Taveira EDB https://www.enterprisedb.com/