pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedtemporary file size clarification
5+ messages / 3 participants
[nested] [flat]
* temporary file size clarification
@ 2022-11-16 10:26 PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 5+ messages in thread
From: PG Doc comments form @ 2022-11-16 10:26 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: iphatiey5eu2au6@pasms.be
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/14/runtime-config-logging.html
Description:
The setting log_temp_files will enable logging of the usage of temporary
files, including their size in the log files. The setting is given in
kilobytes, which is clearly documented. However, I could not find any clear
documentation that describes the unit of size that is used in the logfiles
themselves, the log line is something like "profiles@profiles LOG:
temporary file: path "base/pgsql_tmp/pgsql_tmp31863.1", size 3137536" but
there is no size unit in the logfile or in the settings documentation. Can
you add whether the log line is in bytes/kilobytes/megabytes?
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: temporary file size clarification
@ 2022-11-23 19:43 Bruce Momjian <bruce@momjian.us>
parent: PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 5+ messages in thread
From: Bruce Momjian @ 2022-11-23 19:43 UTC (permalink / raw)
To: iphatiey5eu2au6@pasms.be; pgsql-docs@lists.postgresql.org
On Wed, Nov 16, 2022 at 10:26:38AM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/14/runtime-config-logging.html
> Description:
>
> The setting log_temp_files will enable logging of the usage of temporary
> files, including their size in the log files. The setting is given in
> kilobytes, which is clearly documented. However, I could not find any clear
> documentation that describes the unit of size that is used in the logfiles
> themselves, the log line is something like "profiles@profiles LOG:
> temporary file: path "base/pgsql_tmp/pgsql_tmp31863.1", size 3137536" but
> there is no size unit in the logfile or in the settings documentation. Can
> you add whether the log line is in bytes/kilobytes/megabytes?
Uh, I believe it is simply in bytes.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Indecision is a decision. Inaction is an action. Mark Batterson
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: temporary file size clarification
@ 2022-11-24 09:14 Daniel Gustafsson <daniel@yesql.se>
parent: Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Gustafsson @ 2022-11-24 09:14 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: iphatiey5eu2au6@pasms.be; pgsql-docs@lists.postgresql.org
> On 23 Nov 2022, at 20:43, Bruce Momjian <bruce@momjian.us> wrote:
>
> On Wed, Nov 16, 2022 at 10:26:38AM +0000, PG Doc comments form wrote:
>> The following documentation comment has been logged on the website:
>>
>> Page: https://www.postgresql.org/docs/14/runtime-config-logging.html
>> Description:
>>
>> The setting log_temp_files will enable logging of the usage of temporary
>> files, including their size in the log files. The setting is given in
>> kilobytes, which is clearly documented. However, I could not find any clear
>> documentation that describes the unit of size that is used in the logfiles
>> themselves, the log line is something like "profiles@profiles LOG:
>> temporary file: path "base/pgsql_tmp/pgsql_tmp31863.1", size 3137536" but
>> there is no size unit in the logfile or in the settings documentation. Can
>> you add whether the log line is in bytes/kilobytes/megabytes?
>
> Uh, I believe it is simply in bytes.
It is, the relevant code path for the logging is:
if ((size / 1024) >= log_temp_files)
ereport(LOG,
(errmsg("temporary file: path \"%s\", size %lu",
path, (unsigned long) size)));
I don't think it's a bad idea to specify the unit in the documentation though,
as suggested by the OP. Since the setting considers a value without unit as
kb, and the logged value is without unit, there is room for confusion.
How about something like the attached?
--
Daniel Gustafsson https://vmware.com/
Attachments:
[application/octet-stream] log_temp_files.diff (704B, ../../77B1C264-8B26-484A-9FE2-8DE82C71EAE4@yesql.se/2-log_temp_files.diff)
download | inline diff:
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 24b1624bad..9fd2075b1e 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -7501,7 +7501,7 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
Temporary files can be
created for sorts, hashes, and temporary query results.
If enabled by this setting, a log entry is emitted for each
- temporary file when it is deleted.
+ temporary file, with the file size specified in bytes, when it is deleted.
A value of zero logs all temporary file information, while positive
values log only files whose size is greater than or equal to
the specified amount of data.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: temporary file size clarification
@ 2022-11-25 20:14 Bruce Momjian <bruce@momjian.us>
parent: Daniel Gustafsson <daniel@yesql.se>
0 siblings, 1 reply; 5+ messages in thread
From: Bruce Momjian @ 2022-11-25 20:14 UTC (permalink / raw)
To: Daniel Gustafsson <daniel@yesql.se>; +Cc: iphatiey5eu2au6@pasms.be; pgsql-docs@lists.postgresql.org
On Thu, Nov 24, 2022 at 10:14:20AM +0100, Daniel Gustafsson wrote:
> > On 23 Nov 2022, at 20:43, Bruce Momjian <bruce@momjian.us> wrote:
> >
> > On Wed, Nov 16, 2022 at 10:26:38AM +0000, PG Doc comments form wrote:
> >> The following documentation comment has been logged on the website:
> >>
> >> Page: https://www.postgresql.org/docs/14/runtime-config-logging.html
> >> Description:
> >>
> >> The setting log_temp_files will enable logging of the usage of temporary
> >> files, including their size in the log files. The setting is given in
> >> kilobytes, which is clearly documented. However, I could not find any clear
> >> documentation that describes the unit of size that is used in the logfiles
> >> themselves, the log line is something like "profiles@profiles LOG:
> >> temporary file: path "base/pgsql_tmp/pgsql_tmp31863.1", size 3137536" but
> >> there is no size unit in the logfile or in the settings documentation. Can
> >> you add whether the log line is in bytes/kilobytes/megabytes?
> >
> > Uh, I believe it is simply in bytes.
>
> It is, the relevant code path for the logging is:
>
> if ((size / 1024) >= log_temp_files)
> ereport(LOG,
> (errmsg("temporary file: path \"%s\", size %lu",
> path, (unsigned long) size)));
>
> I don't think it's a bad idea to specify the unit in the documentation though,
> as suggested by the OP. Since the setting considers a value without unit as
> kb, and the logged value is without unit, there is room for confusion.
>
> How about something like the attached?
+1
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Embrace your flaws. They make you human, rather than perfect,
which you will never be.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: temporary file size clarification
@ 2022-11-28 10:20 Daniel Gustafsson <daniel@yesql.se>
parent: Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Gustafsson @ 2022-11-28 10:20 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: iphatiey5eu2au6@pasms.be; pgsql-docs@lists.postgresql.org
> On 25 Nov 2022, at 21:14, Bruce Momjian <bruce@momjian.us> wrote:
> On Thu, Nov 24, 2022 at 10:14:20AM +0100, Daniel Gustafsson wrote:
>> How about something like the attached?
>
> +1
Pushed, thanks!
--
Daniel Gustafsson https://vmware.com/
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2022-11-28 10:20 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 10:26 temporary file size clarification PG Doc comments form <noreply@postgresql.org>
2022-11-23 19:43 ` Bruce Momjian <bruce@momjian.us>
2022-11-24 09:14 ` Daniel Gustafsson <daniel@yesql.se>
2022-11-25 20:14 ` Bruce Momjian <bruce@momjian.us>
2022-11-28 10:20 ` Daniel Gustafsson <daniel@yesql.se>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox