Thread

Commits

  1. doc: Clarify unit of logging for log_temp_files

  1. temporary file size clarification

    The Post Office <noreply@postgresql.org> — 2022-11-16T10:26:38Z

    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?
    
  2. Re: temporary file size clarification

    Bruce Momjian <bruce@momjian.us> — 2022-11-23T19:43:03Z

    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
    
    
    
    
    
  3. Re: temporary file size clarification

    Daniel Gustafsson <daniel@yesql.se> — 2022-11-24T09:14:20Z

    > 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/
    
    
  4. Re: temporary file size clarification

    Bruce Momjian <bruce@momjian.us> — 2022-11-25T20:14:04Z

    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.
    
    
    
    
  5. Re: temporary file size clarification

    Daniel Gustafsson <daniel@yesql.se> — 2022-11-28T10:20:05Z

    > 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/