]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Simplify truncate_query_log() callers
authorFujii Masao <fujii@postgresql.org>
Thu, 9 Jul 2026 23:37:59 +0000 (08:37 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 9 Jul 2026 23:37:59 +0000 (08:37 +0900)
commit5594f209c3eff6e478e1d6109094f14b59bd3dce
treef998f13944316dc506e3db159ebae73ba8486e89
parent999a8412bbabec4811195fee7e315c282c97f694
Simplify truncate_query_log() callers

truncate_query_log() returns NULL when statement truncation is
disabled or the supplied query does not need to be truncated. Therefore,
callers do not need to check log_statement_max_length before calling
it.

Remove the redundant checks and let truncate_query_log() make the
decision in one place. This simplifies the statement and duration
logging code without changing its behavior.

Author: Jim Jones <jim.jones@uni-muenster.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwFOV+7nOdfoO=kfVH=-fRA9aQE1YcHHLYty3nfQ9rQ4RA@mail.gmail.com
src/backend/tcop/postgres.c