Re: md5(large_object_id) - Mailing list pgsql-general

From Pavel Stehule
Subject Re: md5(large_object_id)
Date
Msg-id CAFj8pRDFQC5=4MzJwwZbf7gH-arsYwWBJhvAYQ3sHpCZUKmYDA@mail.gmail.com
Whole thread Raw
In response to Re: md5(large_object_id)  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Responses Re: md5(large_object_id)  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List pgsql-general


2015-10-07 13:18 GMT+02:00 Karsten Hilbert <Karsten.Hilbert@gmx.net>:
On Wed, Oct 07, 2015 at 12:55:38PM +0200, Karsten Hilbert wrote:

> > > I am dealing with radiology studies aka DICOM data) one would
> > > want an md5 function which streams in parts of a large object
> > > piece by piece using md5_update and m5_finalize or some such.
> > It would certainly be possible to write a lo_md5(oid) function to do
> > this, but as far as I'm aware nobody has yet done so.  How are your
> > C skills?
>
> I had hoped someone was going to say: "Yeah, right, low
> hanging fruit, let's just do it for 9.next" :-)

Someone _with_ C skills, that is.

if the size of blobs is less than 1GB, then it should be possible in plpgsql too.

 postgres=# \lo_import ~/Desktop/001.jpg
lo_import 24577
postgres=# select md5(lo_get(24577));
┌──────────────────────────────────┐
│               md5                │
╞══════════════════════════════════╡
│ 610ccaab8c7c60e1168abfa799d1305d │
└──────────────────────────────────┘
(1 row)


Regards

Pavel


Thanks for the plperlu suggestion, btw.

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: md5(large_object_id)
Next
From: Karsten Hilbert
Date:
Subject: Re: md5(large_object_id)