X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 829B953F68 for ; Thu, 12 May 2005 19:40:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09520-03 for ; Thu, 12 May 2005 22:40:24 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id B15A3533A2 for ; Thu, 12 May 2005 19:40:22 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j4CMeIaY020574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 May 2005 16:40:22 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j4CMeIjm055776; Thu, 12 May 2005 16:40:18 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j4CMeICr055775; Thu, 12 May 2005 16:40:18 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 12 May 2005 16:40:18 -0600 From: Michael Fuhr To: subhash@nmsu.edu Cc: pgsql-sql@postgresql.org Subject: Re: md5 in pg_shadow? Message-ID: <20050512224017.GA55711@winnie.fuhr.org> References: <1115931677.4283c41db0689@webmail.nmsu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1115931677.4283c41db0689@webmail.nmsu.edu> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/96 X-Sequence-Number: 21409 On Thu, May 12, 2005 at 03:01:17PM -0600, subhash@nmsu.edu wrote: > > I was trying to write a function to validate the username and its password in > the pg_shadow table. The function should take in the username and password as > arguments and see if it matches with those in the pg_shadow table. But the md5 > hashed password in pg_shadow doesnot match with what i get when i do > select 'md5' || md5('some_password'); Try this: SELECT 'md5' || md5('some_password' || 'some_user'); -- Michael Fuhr http://www.fuhr.org/~mfuhr/