Re: MD5 sums of large objects - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: MD5 sums of large objects
Date
Msg-id 20070409010727.GA80424@winnie.fuhr.org
Whole thread Raw
In response to Re: MD5 sums of large objects  ("Dirk Jagdmann" <jagdmann@gmail.com>)
Responses Re: MD5 sums of large objects  ("Dirk Jagdmann" <jagdmann@gmail.com>)
List 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


pgsql-sql by date:

Previous
From: "Dirk Jagdmann"
Date:
Subject: Re: MD5 sums of large objects
Next
From: Karthikeyan Sundaram
Date:
Subject: Another question in functions