[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-general
Subject: Re: How to get an md5/sha256 hash of a really large object in psql?
From: Alex Shan <3341018 () gmail ! com>
Date: 2023-07-31 12:14:31
Message-ID: CAAFmqa84GnfZzRm2svwed1_OSu7uuz4O7ApLYQC0+bfhGqLoVw () mail ! gmail ! com
[Download RAW message or body]
Great, thanks a lot!
I will test it on my system.
Myself, I tried to do it in C with libpq, but got stuck at reading a LO...
On Sat, 29 Jul 2023 at 19:57, Erik Wienhold <ewie@ewie.name> wrote:
> > "SELECT md5(lo_get(loid));" doesnt work — "large object is too large".
> >
> > Is there any other way to do it?
>
> Is plpython3u [1] an option for you? In that case you can use Python's
> hashlib
> in a custom function and feed every page from pg_largeobject to a selected
> hash
> function.
> ...
> --
> Erik
[Attachment #3 (text/html)]
<div dir="ltr"><div dir="ltr">
<div>Great, thanks a lot!</div><div><br></div><div>I will test it on my \
system.</div><div><br></div><div>Myself, I tried to do it in C with libpq, but got \
stuck at reading a LO...<br></div><div><br></div><div><br></div><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 29 Jul 2023 at 19:57, \
Erik Wienhold <<a href="mailto:ewie@ewie.name" \
target="_blank">ewie@ewie.name</a>> wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">> "SELECT md5(lo_get(loid));" doesnt work — \
"large object is too large".<br> ><br>
> Is there any other way to do it?<br>
<br>
Is plpython3u [1] an option for you? In that case you can use Python's \
hashlib<br> in a custom function and feed every page from pg_largeobject to a \
selected hash<br> function.<br>
...<font color="#888888"><br>--<br>
Erik</font></blockquote></div>
</div><br></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic