Python Find Pattern In Array Postgres