POSTGRESQL-ESSENTIALS practice question 14 of 15

You need to reload the PostgreSQL configuration without restarting the server. Which function should you use?

Full set: 71 questions
Answer options
A: pg_restart_conf()
B: pg_reload_conf() Correct answer
C: reload_configuration()
D: refresh_config()
Correct Answer:
B. pg_reload_conf()
Explanation

The pgreloadconf() function is the correct and standard SQL-callable function used to signal the main PostgreSQL server process to reload its configuration files. This includes postgresql.conf, pghba.conf, and pgident.conf. Executing this function applies changes to configuration parameters that do not require a full server restart, thereby avoiding service interruption. This is equivalent to running pgctl reload on the command line or sending a SIGHUP signal to the postmaster process.

Why Incorrect

A. pgrestartconf(): This function does not exist in PostgreSQL. The name implies a restart, which is the action the user is explicitly trying to avoid.
C. reloadconfiguration(): This is not a standard, built-in PostgreSQL function. While descriptive, it does not follow the pg naming convention for many administrative functions.
D. refreshconfig(): This is not a valid PostgreSQL function for this purpose. The correct function for reloading configuration is pgreloadconf().

References

1. PostgreSQL 16 Documentation: Chapter 9. Functions and Operators, Section 9.27. Server Signaling Functions. The documentation explicitly lists pgreloadconf() and describes its purpose: "Signals the server to reload its configuration files."

Source: PostgreSQL Official Documentation, https://www.postgresql.org/docs/16/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE

2. PostgreSQL 16 Documentation: Chapter 20. Server Setup and Operation, Section 20.2. Managing the Server. This section details methods for reloading the configuration, stating: "To trigger a configuration file reload, you can either send the SIGHUP signal to the postmaster process, or run the SQL function pgreloadconf() from a SQL session..."

Source: PostgreSQL Official Documentation, https://www.postgresql.org/docs/16/managing-the-server.html

3. Carnegie Mellon University, Database Systems Courseware (15-445/645): Lecture #21 - Logging & Recovery. While discussing system administration, the lecture notes often refer to the need to reload configurations after changes, a task accomplished by pgctl reload or the equivalent SQL function pgreloadconf().

Source: CMU Database Group, https://15445.courses.cs.cmu.edu/fall2022/notes/21-recovery.pdf (See administrative commands section).

Scroll to Top