It is recommended that you use a connection service file. Refer to "11.2.4 Using a Connection Service File" for details.
If a connection service file will not be used, set the the necessary information in the connection information (conninfo of the connect function) or in the environment variable for database connection. Refer to "11.2.5 Using the C Library (libpq)" for more information about parameters or environment variables.