Re: Truncate logs by max_log_size
Álvaro Herrera <alvherre@kurilemu.de>
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Jim Jones <jim.jones@uni-muenster.de>
Cc: Fujii Masao <masao.fujii@gmail.com>, Fujii Masao <masao.fujii@oss.nttdata.com>,
Kirill Gavrilov <diphantxm@gmail.com>, Kirill Reshke <reshkekirill@gmail.com>,
"Andrey M. Borodin" <x4mmm@yandex-team.ru>, Euler Taveira <euler@eulerto.com>, pgsql-hackers@lists.postgresql.org
Date: 2026-02-05T10:22:19Z
Lists: pgsql-hackers
On 2026-Feb-05, Jim Jones wrote: > On 05/02/2026 03:17, Fujii Masao wrote: > > At least I'm not for now. So please feel free to work on the patch if > > you'd like! > > If nobody is planning to work on this, I can take a look at it next week. That'd be swell. My only comment at this point is that the proposed GUC name is not great. I think it should be something like log_statement_max_length, or something like that. Reading just the thread subject, people would imagine this is about the size of the log file. Another point is that the current patch does strlen() twice on each query. It might be better to do away with need_truncate_query_log() and have a single routine that both determines whether the truncation is needed and returns the truncated query if it is. If it returns NULL then caller assumes it's not needed. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix log_statement_max_length test with verbose logs
- 9bfbf5bf6190 master landed
-
Add log_statement_max_length GUC to limit logged statement text
- c8bd8387c27a master landed
-
Improve user control over truncation of logged bind-parameter values.
- 0b34e7d307e6 13.0 cited