def pg_index_exists(conn, schema_name: str, table_name: str, index_name: str) -> bool:
    """
    Does a postgres index exist?

    Unlike pg_exists(), we don't need heightened permissions on the table.

    So, for example, Explorer's limited-permission user can check agdc/ODC tables
    that it doesn't own.
    """
    return (
        conn.execute(
            """
        select indexname
        from pg_indexes
        where schemaname=%(schema_name)s and
              tablename=%(table_name)s and
              indexname=%(index_name)s
              """,
            schema_name=schema_name,
            table_name=table_name,
            index_name=index_name,
        ).scalar()
        is not None
    )