Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id B79D82E004C for ; Tue, 6 May 2008 15:12:13 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 17279-01-2 for ; Tue, 6 May 2008 15:12:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from app1.ihackr.net (unknown [209.61.157.9]) by developer.postgresql.org (Postfix) with ESMTP id 0CDC72E00B4 for ; Tue, 6 May 2008 15:11:30 -0300 (ADT) Received: by app1.ihackr.net (Postfix, from userid 515) id 54BC510135C; Tue, 6 May 2008 13:11:28 -0500 (CDT) Received: from [192.168.1.4] (home [71.40.241.131]) by app1.ihackr.net (Postfix) with ESMTP id 584EB1007C1; Tue, 6 May 2008 13:11:26 -0500 (CDT) Cc: pgsql-admin@postgresql.org Message-Id: From: Marcelo Martins To: Guy Deleeuw In-Reply-To: <48209C58.6020000@eurofer.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: PQconnectdb question and md5 password Date: Tue, 6 May 2008 13:11:25 -0500 References: <48202DE2.20805@eurofer.be> <7A9FA81F-5F0F-4CD0-B42A-AE9CB7B3C941@zeroaccess.org> <48209C58.6020000@eurofer.be> X-Mailer: Apple Mail (2.919.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=RDNS_NONE=0.1 X-Spam-Level: X-Archive-Number: 200805/40 X-Sequence-Number: 29124 Hi Gus, You should be able to, I'm not a C guru but on perl I can without any =20= issues. Did you setup a password for the postgres user account in postgreSQL =20 itself ? I found strange that you were trying out the password from /etc/shadow =20= file though. > ALTER USER postgres WITH ENCRYPTED PASSWORD 'secret'; What error the postgres log gives you ? On May 6, 2008, at 12:58 PM, Guy Deleeuw wrote: > Hello Marcelo, > Thanks for your respons > > I have a password and is what I need. > My pg_hba.conf have 'md5' : > host all all 127.0.0.1/32 md5 > > My question are just how I can connect from the C api with an md5 =20 > password or it's not possible ? > > Regards > Guy > > Marcelo Martins a =E9crit : >> How do you have your pg_hba.conf file setup ? >> >> If on the shell as the postgres user, you can login into the =20 >> "db_stats" database without a password being asked for than you =20 >> should not need one. >> Try out: >> >> postgres$> psql db_stats >> >> and see if you can login without asking for a PW.. check your =20 >> pg_hba.conf first though. >> >> >> On May 6, 2008, at 5:07 AM, Guy Deleeuw wrote: >> >>> Hello, >>> >>> I don't know how can I pass a md5 password to the password field ? >>> example : >>> connInfo =3D "host=3Dlocalhost port=3D5432 dbname=3Ddb_stats = user=3Dpostgres =20 >>> password=3Dsecret"; >>> pConn =3D PQconnectdb(connInfo); >>> >>> I try to replace the string 'secret' by the content of /etc/shadow =20= >>> but without succ=E8s. >>> >>> Thanks in advance >>> >>> Guy >>> >>> --=20 >>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) >>> To make changes to your subscription: >>> http://www.postgresql.org/mailpref/pgsql-admin >> >> > > --=20 > Guy De Leeuw > IT Manager > Eurofer > 5, avenue Ariane > Building "Integrale" (3rd floor) > 1200, Bruxelles > Belgium > Phone : +32 (2) 738 79 40 > Mobile : 00 32 498 93 65 00 > Fax : +32 (2) 736 28 22 > E-Mail : mailto:G.De_Leeuw@eurofer.be > www : http://www.eurofer.org > >