def _get_pgsql_command(name, host="localhost", password=None, port=5432, user="postgres"):
    """Get a postgres-related command using commonly required parameters.

    :param name: The name of the command.
    :type name: str

    :param host: The host name.
    :type host: str

    :param password: The password to use.
    :type password: str

    :param port: The TCP port number.
    :type port: int

    :param user: The user name that will be used to execute the command.

    :rtype: list[str]

    """
    a = list()

    if password:
        a.append('export PGPASSWORD="%s" &&' % password)

    a.append(name)

    a.append("--host=%s" % host)
    a.append("--port=%s" % port)
    a.append("--username=%s" % user)

    return a