def METHOD_NAME(request):
    """The base URI connection string to postgres.
    This should contain all necessary connection information except the database name.
    """
    uri = request.config.getoption('postgres_uri')
    if not uri:
        # Not set, return None; indicates the tests are not to use postgres
        return None
    # If the URI contains a database name, we need to remove it
    from sqlalchemy.engine.url import URL, make_url
    url = make_url(uri)
    url_kwargs = {
        'drivername': url.drivername,
        'username': url.username,
        'password': url.password,
        'host': url.host,
        'port': url.port,
        # Purposely remove database and query.
        # 'database': None,
        # 'query': None,
    }
    base_uri = str(URL.create(**url_kwargs))
    return base_uri