pg_similarity
pg_similarity copied to clipboard
Hamming does not support bytea type
Unfortunately there's a) no good way to convert between postgres's bytea type (variable length byte strings) and varbit (variable length bit strings) due to well, read the whole thread here: http://archives.postgresql.org/pgsql-patches/2006-05/msg00041.php
mostly seems to be endianness/arguments that byte strings and bitstrings aren't really the same thing, yadda, yadda,
Anyway, I'm gonna try to write a hamming_bytea function and submit a pull request, but we'll see how far I get before I realize I have no idea what I'm doing. Anyway, looks like you're treating "text" as a bytestring anyway, so I should be able to copy/paste that code somehow, or something, maybe.