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

From Sami Imseih
Subject Re: [BUG] temporary file usage report with extended protocol and unnamed portals
Date
Msg-id CAA5RZ0vGPa=UjiNiS0gK1zHVhysSBPMSaGU5Qc=1PrVKJ6ODCw@mail.gmail.com
Whole thread Raw
In response to Re: [BUG] temporary file usage report with extended protocol and unnamed portals  (Sami Imseih <samimseih@gmail.com>)
List pgsql-hackers
I found several issues with v4. It does not deal correctly with pipelining,
and we should only really be concerned with dropping an unnamed
portal only.

So, v5 now moves the DropPortal call after the unnamed portal was
executed to completion ( as v4 was doing ), but does so only in the
case in which we are not inside a transaction-control statement or
the portal was executing a command that can be run inside a
transaction block.

Also, I realize that explicit cursors ( DECLARE CURSOR ) will
only log temp file at cursor close and in which case, the statement
associated with the temp file logging is the CLOSE command:

i.e.

```
2025-04-26 18:46:38.084 UTC [10415] LOG:  temporary file: path
"base/pgsql_tmp/pgsql_tmp10415.0", size 1014030336
2025-04-26 18:46:38.084 UTC [10415] STATEMENT:  close mycursor_1;
```

I don't think there is much we can do there, or should we.

--
Sami Imseih

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Avoid circular header file dependency
Next
From: Alexander Korotkov
Date:
Subject: Re: Removing unneeded self joins