postgresqlpgpool

How to reload pool_hba.conf in pgpool without restart?


How can we reload pool_hba.conf after a config change, is there a way without restarting?


Solution

  • According the documentation, it is possible to reload pgpool conf files without restarting it

    pgpool [-c][-f config_file][-a hba_file][-F pcp_config_file] reload
    

    -a, --hba-file=HBA_CONFIG_FILE Set the path to the pool_hba.conf configuration file (default: /etc/pgpool2/pool_hba.conf)

    -F, --pcp-file=PCP_CONFIG_FILE Set the path to the pcp.conf configuration file (default: /etc/pgpool2/pcp.conf)

    -f, --config-file=CONFIG_FILE Set the path to the pgpool.conf configuration file (default: /etc/pgpool2/pgpool.conf)

    So we can build the following command

    pgpool -a /etc/pgpool2/pool_hba.conf reload
    

    Also, to reload PostgreSQL configuration files you can run pg_reload_conf():

    SELECT pg_reload_conf();
    
     pg_reload_conf 
    ----------------
     t
    

    From the documentation: pg_reload_conf () → boolean

    Causes all processes of the PostgreSQL server to reload their configuration files. (This is initiated by sending a SIGHUP signal to the postmaster process, which in turn sends SIGHUP to each of its children.)