def has_extension(conn, name):
    """Checks if the postgres database has a certain extension installed"""
    return conn.execute("SELECT EXISTS(SELECT TRUE FROM pg_extension WHERE extname = %s)", (name,)).scalar()