Re: log_min_messages per backend type
Euler Taveira <euler@eulerto.com>
From: "Euler Taveira" <euler@eulerto.com>
To: japin <japinli@hotmail.com>, "Alvaro Herrera" <alvherre@alvh.no-ip.org>
Cc: "Andres Freund" <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org
Date: 2025-10-05T14:18:53Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow log_min_messages to be set per process type
- 38e0190ced71 19 (unreleased) landed
-
Assign "backend" type earlier during process start-up
- 0c8e082fba8d 19 (unreleased) landed
-
Use integer backend type when exec'ing a postmaster child
- f1cd34f95272 19 (unreleased) landed
-
Sort guc_parameters.dat alphabetically by name
- fce7c73fba4e 19 (unreleased) cited
-
Create a separate file listing backend types
- dbf8cfb4f02e 19 (unreleased) cited
Attachments
- v4-0001-log_min_messages-per-backend-type.patch (text/x-patch) patch v4-0001
On Thu, Jul 31, 2025, at 8:34 PM, Japin Li wrote: > On Thu, 31 Jul 2025 at 18:51, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote: >> On 2025-Aug-01, Japin Li wrote: >> >>> If we set the log level for all backend types, I don't think a generic log >>> level is necessary. >> >> I don't understand what you mean by this. Can you elaborate? >> > For example: > > ALTER SYSTEM SET log_min_messages TO > 'archiver:info, autovacuum:info, backend:info, bgworker:info, > bgwriter:info, checkpointer:info, ioworker:info, logger:info, > slotsyncworker:info, startup:info, walreceiver:info, walsender:info, > walsummarizer:info, walwriter:info'; > > Given that we've set a log level for every backend type and > assigned[BACKEND_NUM_TYPES] is true, a generic level seems redundant. > The main reason I didn't consider this idea was that this GUC assignment will fail as soon as a new backend type is added. Restore a dump should work across major versions. > I think we can avoid memory allocation by using pg_strncasecmp(). > loglevel does not required a memory allocation but I didn't include the btype part because it complicates the error message that uses btype a few lines above. This new patch contains the following changes: - patch was rebased - use commit dbf8cfb4f02 - use some GUC memory allocation functions - avoid one memory allocation (suggested by Japin Li) - rename backend type: logger -> syslogger - adjust tests to increase test coverage - improve documentation and comments to reflect the current state -- Euler Taveira EDB https://www.enterprisedb.com/