Re: [BUG] temporary file usage report with extended protocol and unnamed portals - Mailing list pgsql-hackers

From Frédéric Yhuel
Subject Re: [BUG] temporary file usage report with extended protocol and unnamed portals
Date
Msg-id f805707f-889f-4076-a3c8-d24e1ea35996@dalibo.com
Whole thread Raw
In response to Re: [BUG] temporary file usage report with extended protocol and unnamed portals  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [BUG] temporary file usage report with extended protocol and unnamed portals
List pgsql-hackers

On 9/26/25 03:20, Michael Paquier wrote:
> Thinking about this problem in a twisted way, could there be an
> argument in favor of the existing logic as it is?  It is true that the
> cleanup happens when the next bind query happens.  So, in fact, one
> could also say that it makes sense to reflect when a temp file is
> cleaned up and what's the query being processed that does the cleanup.
> In this case, it is not the query that created the temp file, but the
> one that's been processed, and the portal drop is documented in
> protocol.sgml as being part of the follow-up BIND.  (I did use the
> term "twisted" here.)

Well, that is indeed a rather twisted approach ;-)

How are we going to explain this to the user?

Is it really acceptable to have this in the log?

[...] LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp525566.0", 
size 2416640
[...] STATEMENT:  SELECT 1

If we're unable to provide a proper fix, we should probably remove 
completely the "STATEMENT" log line. We can use pg_stat_statements to 
find the amount of temporary file written by a given query.



pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Add memory_limit_hits to pg_stat_replication_slots
Next
From: Ashutosh Sharma
Date:
Subject: Re: issue with synchronized_standby_slots