Add tests for logging of temporary file removal and statement
authorMichael Paquier <[email protected]>
Thu, 16 Oct 2025 00:02:51 +0000 (09:02 +0900)
committerMichael Paquier <[email protected]>
Thu, 16 Oct 2025 00:02:51 +0000 (09:02 +0900)
commit76bba033128acd8bde70f532383f80b26cc9baae
tree8c3149335c1ea8b69865dbaf8b90842a7d234fa6
parent079480dc20223dfe03d60fcabda9c0a65e30d0d5
Add tests for logging of temporary file removal and statement

Temporary file usage is sometimes attributed to the wrong query in the logs
output.  One identified reason is that unnamed portal cleanup (and
consequently temp file logging) happens during the next BIND message as
a, after debug_query_string has already been updated to the new query.

Dropping an unnamed portal in the next BIND message is a rather old
protocol behavior (fe19e56c572f, also mentioned in the docs).
log_temp_files is a bit newer than that, as of be8a4318815.

This commit adds tests to track which query is displayed next to the
temporary file(s) removed when a portal is dropped, and in some cases if
a query is displayed or not.  We have not concluded how to improve the
situation yet; these tests will at least help in checking what changes
in the logs depending on the proposal discussed and how it affects the
scenarios tracked by this new test.

Author: Sami Imseih <[email protected]>
Author: Frédéric Yhuel <[email protected]>
Reviewed-by: Mircea Cadariu <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/3d07ee43-8855-42db-97e0-bad5db82d972@dalibo.com
src/test/modules/test_misc/meson.build
src/test/modules/test_misc/t/009_log_temp_files.pl [new file with mode: 0644]