Hamming distance for PostgreSQL