Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 95A469FB428; Tue, 17 Oct 2006 13:41:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 73782-01; Tue, 17 Oct 2006 16:40:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) by postgresql.org (Postfix) with ESMTP id 8F1A59FB559; Tue, 17 Oct 2006 13:36:38 -0300 (ADT) Received: from [209.162.219.253] (helo=dogma.v10.wvs) by servata.com with esmtpa (Exim 4.50) id 1GZrvU-0006wy-Po; Tue, 17 Oct 2006 09:36:24 -0700 Subject: Re: [GENERAL] Database users Passwords From: Jeff Davis To: DEV Cc: pgsql-general@postgresql.org, pgsql-docs@postgresql.org In-Reply-To: <002c01c6f1fa$652d3f60$0b01a8c0@LT003> References: <002c01c6f1fa$652d3f60$0b01a8c0@LT003> Content-Type: text/plain; charset=UTF-8 Date: Tue, 17 Oct 2006 09:36:25 -0700 Message-Id: <1161102985.31645.100.camel@dogma.v10.wvs> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-7) Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, SPF_HELO_PASS X-Spam-Level: X-Archive-Number: 200610/29 X-Sequence-Number: 3750 On Tue, 2006-10-17 at 10:41 -0400, DEV wrote: > Hello all, >=20 > I have user information in a table that I want to use to add > users to the user roles tables that are part of postgresql. My > question is this: the passwords in my user table are in there as a > text file with the data being encrypted using the crypt function, is > there a way I can use this crypt password when I do a =E2=80=9CCREATE ROL= E > userid LOGIN PASSWORD 'crypt password' NOSUPERUSER INHERIT NOCREATEDB > NOCREATEROLE=E2=80=9D I know that in the current CREATE ROLE I have list= ed > will take a clear text password and encrypt it for me. What do I need > to change to use an encrypted password? >=20 If user is foo and password is bar, do: =3D# select md5('barfoo'); LOG: duration: 0.140 ms statement: select md5('barfoo'); md5 ---------------------------------- 96948aad3fcae80c08a35c9b5958cd89 (1 row) =3D# create role foo login password 'md596948aad3fcae80c08a35c9b5958cd89' nosuperuser inherit nocreatedb nocreaterole; This seems to be lacking in the docs. At least, the only place I found this information was a user comment in the 8.0 docs. Is this already in the 8.1 docs? Should we add a description of the way postgresql does the md5 hashes in the CREATE ROLE section? Regards, Jeff Davis