Re: [BUG] temporary file usage report with extended protocol and unnamed portals

Guillaume Lelarge <guillaume.lelarge@dalibo.com>

From: Guillaume Lelarge <guillaume.lelarge@dalibo.com>
To: Sami Imseih <samimseih@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Frédéric Yhuel <frederic.yhuel@dalibo.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Benoit Lobréau <benoit.lobreau@dalibo.com>, Pierrick Chovelon <pierrick.chovelon@dalibo.com>
Date: 2025-04-20T07:37:27Z
Lists: pgsql-hackers
Hi,

On 20/04/2025 00:42, Sami Imseih wrote:
> [...]
>> I'm frankly inclined to do nothing, but if we must do something,
>> the way to fix it here would be to transiently set debug_query_string
>> to NULL so that the actions of PortalDrop aren't blamed on any
>> particular query.
> 
> I think this is better, because I rather we avoid lines like the below in which
> there are temp files being reported all with STATEMENT logging
> of a different query. It's better to just not show STATEMENT at all.
> 

We should definitely avoid blaming the wrong query. I'd prefer we always 
log queries using temp files but if this isn't doable easily or without 
mistakes, then don't log the query at all.


-- 
Guillaume Lelarge
Consultant
https://dalibo.com



Commits

  1. Drop unnamed portal immediately after execution to completion

  2. Override log_error_verbosity to "default" in test 009_log_temp_files

  3. Add tests for logging of temporary file removal and statement