Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 972369FA5F7 for ; Sun, 8 Apr 2007 22:07:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 59265-07 for ; Sun, 8 Apr 2007 22:07:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id A180C9FA49E for ; Sun, 8 Apr 2007 22:07:36 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id l3917SH2013656 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 8 Apr 2007 19:07:31 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id l3917Sr2080563; Sun, 8 Apr 2007 19:07:28 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id l3917R82080562; Sun, 8 Apr 2007 19:07:27 -0600 (MDT) (envelope-from mfuhr) Date: Sun, 8 Apr 2007 19:07:27 -0600 From: Michael Fuhr To: Dirk Jagdmann Cc: pgsql-sql@postgresql.org Subject: Re: MD5 sums of large objects Message-ID: <20070409010727.GA80424@winnie.fuhr.org> References: <5d0f60990704081003p615530acx86257a70bff33fa4@mail.gmail.com> <20070408173757.GA78999@winnie.fuhr.org> <5d0f60990704081707m56b29423ob5d63103623305b2@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d0f60990704081707m56b29423ob5d63103623305b2@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/98 X-Sequence-Number: 28098 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