Re: How to get an md5/sha256 hash of a really large object in psql?

From: Alex Shan <3341018(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to get an md5/sha256 hash of a really large object in psql?
Date: 2023-07-31 12:14:31
Message-ID: CAAFmqa84GnfZzRm2svwed1_OSu7uuz4O7ApLYQC0+bfhGqLoVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)ewie(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Amn Ojee Uw 2023-07-31 12:47:02 Completely Removing PostgreSQL
Previous Message jian he 2023-07-31 11:10:24 jsonb on-disk size calculation