Sample Exam Questions

From the objective of OSS-DB Exam Silver
S2.3 Configuration files (postgresql.conf)

Sample Question


"A PostgreSQL server running on a host with IP address wants to accept connections from clients with IP address
Choose two appropriate lines to write in postgresql.conf."

  1. listen_addresses = ''

  2. listen_addresses = '*'

  3. isten_addresses = 'localhost'

  4. listen_addresses = ''

  5. isten_addresses = ''

※This sample exam is different from those that appear in the actual OSS-DB Exam.

Answer and Explanation

To allow PostgreSQL to accept connections over a TCP/IP network, you need to configure postgresql.conf. The important parameters are listen_addresses and port.

The PostgreSQL server listens for connections to the port number specified by port on the network interface specified by listen_addresses. For the network interface, you are supposed to specify the host name or IP address of the local host, but you can usually specify listen_addresses = '*' because * monitors all available interfaces.
If you have multiple network interfaces and you want to allow connections on only one of them, specify the name or IP address of the interface.

If listen_addresses is not specified or is localhost, only connections from clients within the local host are accepted. If you specify the IP address of another host, a socket creation error will probably occur and the database server will not start.

listen_addresses cannot be set to constrain the source client, such that connections can be made from but not from This is accomplished by configuring pg_hba.conf appropriately.

So the correct answers are B and D.