Top
Enterprise Postgres 17 Installation and Setup Guide for Server

4.6.7 pg_statsinfo

4.6.7.1 Setting Up pg_statsinfo

  1. Set the postgresql.conf file parameters.

    • Add "pg_statsinfo" to the shared_preload_libraries parameter.

    • Specify the log file name for the log_filename parameter.

    • Specify "on" to the logging_collecto parameter.

    • Add "csvlog" to the log_destination parameter.

    • Delete "stderr" to the log_destination parameter.

    For the parameters "logging_collector" and "log_destination", pg_statsinfo will change the settings in the postmaster process as above without rewriting postgresql.conf, even if you do not make the above changes.
    Explicit rewriting is recommended because the configuration file and behavior will not match.

  2. Perform the following setup as a superuser:

    Install the pg_statsinfo module:

    # cp -r /opt/fsepv<x>server64/OSS/pg_statsinfo/* /opt/fsepv<x>server64

    Create the directories needed for pg_statsinfo to work.
    This directory is where the files for managing process IDs for pg_statsinfo processes are stored.
    The minimum required permissions for the directory are 700.
    Set the owner of the directory to the instance administrator user.
    This example sets the OS user “fsepuser” as the instance administrator.

    # mkdir /run/pg_statsinfo
    # chmod 700 /run/pg_statsinfo
    # chown fsepuser:fsepuser /run/pg_statsinfo

    The directory created above is deleted when the OS stops.
    You can configure the above directories to be created automatically on reboot by running the following command:

    # cat << EOF > /usr/lib/tmpfiles.d/pg_statsinfo-<x>.conf
    d /run/pg_statsinfo 0755 fsepuser fsepuser -
    EOF
  3. Restart Fujitsu Enterprise Postgres.

Information

There are the following differences in postgresql.conf parameter settings required for statistics collection between OSS pg_statsinfo v16 and pg_statsinfo shipped with Fujitsu Enterprise Postgres:

OSS: You must specify "C" for the lc_messages parameter.

Fujitsu Enterprise Postgres: The lc_messages parameter can be any message locale supported by PostgreSQL.

Note

This feature cannot be used on instances created in WebAdmin. It can only be used via server commands.

4.6.7.2 Removing pg_statsinfo

  1. As superuser, run the following command:

    $ su -
    Password:******
    # rm -rf /opt/fsepv<x>server64/filesCopiedDuringSetup
    # rm -rf /run/pg_statsinfo
    # rm -rf /usr/lib/tmpfiles.d/pg_statsinfo-<x>.conf

    Information

    The files copied during setup can be checked below.

    # find /opt/fsepv<x>server64/OSS/pg_statsinfo
  2. Set the postgresql.conf file parameters.

    • Delete "pg_statsinfo" to the shared_preload_libraries parameter.

    • Delete the log file name for the log_filename parameter.

    • Specify "off" to the logging_collecto parameter.

    • Delete "csvlog" to the log_destination parameter.

    • Add "stderr" to the log_destination parameter.

  3. Restart Fujitsu Enterprise Postgres.