Last active
June 4, 2024 12:37
-
-
Save risicle/36671aaa4bd1be162075058d98a80024 to your computer and use it in GitHub Desktop.
Rolling-hash aggregator for PostgreSQL, allowing fast exact comparison of columns across tables/databases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION hash_agg_tfunc(bytea, anyelement) RETURNS bytea AS $$ | |
SELECT sha256(convert_to($2::text, 'UTF8') || $1) | |
$$ LANGUAGE SQL; | |
CREATE AGGREGATE hash_agg (anyelement) ( | |
sfunc = hash_agg_tfunc, | |
stype = bytea, | |
initcond = '{}' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment