Python Find Pattern In Array Postgresql