From: | Imre Samu <pella(dot)samu(at)gmail(dot)com> |
---|---|
To: | Jagmohan Kaintura <jagmohan(at)tecorelabs(dot)com> |
Cc: | "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: murmur3 hash binary data migration from Oracle to PostgreSQL |
Date: | 2023-04-25 15:42:49 |
Message-ID: | CAJnEWwnwsvJ=OEajB+-o+Dm2geMgEBedsRWMN+xAKqH-dj4Y_Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
>
> No we want to generate murmur3 format only.
>
If you need a server-side murmur3 function
- one alternative is the https://github.com/markokr/pghashlib extension.
psql (15.2 (Debian 15.2-2))
Type "help" for help.
db=# create extension hashlib;
CREATE EXTENSION
db=#
select hash_string('', 'murmur3');
select hash_string('a', 'murmur3');
select hash_string('abcdefg', 'murmur3');
select encode(hash128_string('abcdefg', 'murmur3'), 'hex');
+-------------+
| hash_string |
+-------------+
| 0 |
+-------------+
(1 row)
+-------------+
| hash_string |
+-------------+
| 1009084850 |
+-------------+
(1 row)
+-------------+
| hash_string |
+-------------+
| -2009294074 |
+-------------+
(1 row)
+----------------------------------+
| encode |
+----------------------------------+
| 069b3c88000000000000000000000000 |
+----------------------------------+
(1 row)
In my test, I have used this fork:
https://github.com/bgdevlab/pghashlib/tree/bgdevlab/builds
RUN mkdir -p /pghashlib \
&& git clone --depth 1 --branch bgdevlab/builds
https://github.com/bgdevlab/pghashlib.git /pghashlib \
&& cd /pghashlib \
&& make USE_PGXS=1 \
&& make USE_PGXS=1 install \
&& rm -rf /pghashlib
Regards,
Imre
From | Date | Subject | |
---|---|---|---|
Next Message | Christophe Pettus | 2023-04-25 16:17:32 | VACUUM (INDEX_CLEANUP OFF) and GIN indexes |
Previous Message | Adrian Klaver | 2023-04-25 15:02:48 | Re: FW: Error! |