Re: MD5 sums of large objects

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Dirk Jagdmann <jagdmann(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: MD5 sums of large objects
Date: 2007-04-09 01:07:27
Message-ID: 20070409010727.GA80424@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Apr 09, 2007 at 02:07:16AM +0200, Dirk Jagdmann wrote:
> this works like charm. Although I did fix the argument for lo_lseek:

Oops; thanks for fixing that.

> INV_READ constant integer := 262144; -- 0x40000 from libpq-fs.h

You could also use a hex constant (the cast to integer is necessary):

INV_READ constant integer := x'40000'::integer;

> IF id is null THEN
> RETURN NULL;
> END IF;

The above check is unnecessary since the function is marked STRICT,
aka RETURNS NULL ON NULL INPUT.

> I vote for this function beeing included either somewhere in the
> contrib directories, as you often don't need the full power of
> pgcrypto is md5 suffices for your hashing needs.

You could make a proposal in pgsql-hackers but I think 8.3 is in
feature freeze so don't expect to see it until 8.4, if it's accepted
at all. There's always PgFoundry :-)

--
Michael Fuhr

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Karthikeyan Sundaram 2007-04-09 01:59:13 Another question in functions
Previous Message Dirk Jagdmann 2007-04-09 00:07:16 Re: MD5 sums of large objects