pg_diffix
pg_diffix copied to clipboard
Make sure to detoast varlen datums before hashing
We hash in a few places (aid, count distinct, bucket seed, ...?). Variable length data can potentially be compressed, and instead of hashing the actual value we hash the compressed bytes.
We need to detoast or at least assert that the values are OK to hash.
PG_DETOAST_DATUM_COPY if you want to make sure the result is always pfreeable.