Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C48FD6335F3 for ; Wed, 16 Jun 2010 18:35:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 65707-01 for ; Wed, 16 Jun 2010 21:35:23 +0000 (UTC) X-Greylist: delayed 02:51:48.060892 by SQLgrey-1.7.6 Received: from smtp.fhcrc.org (JARCON.FHCRC.ORG [140.107.42.30]) by mail.postgresql.org (Postfix) with ESMTP id 5403963218F for ; Wed, 16 Jun 2010 18:35:24 -0300 (ADT) Received: from [10.6.125.58] (HIVWALL.SCHARP.ORG [140.107.164.65]) by smtp.fhcrc.org (Postfix) with ESMTP id 4586C18A42 for ; Wed, 16 Jun 2010 14:35:22 -0700 (PDT) Message-ID: <4C19439A.90806@scharp.org> Date: Wed, 16 Jun 2010 14:35:22 -0700 From: Scott Langley User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Java .pgpass reader References: <4C1912D0.8010405@scharp.org> <87bpbaoj7e.fsf@cbbrowne-laptop.afilias-int.info> In-Reply-To: <87bpbaoj7e.fsf@cbbrowne-laptop.afilias-int.info> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-10 required=5 tests=BAYES_40=-0.001 X-Spam-Level: X-Archive-Number: 201006/61 X-Sequence-Number: 20631 Hi Chris: Would you be willing to share your code for this? I'm still wanting to / planning to implement this for an individual JDBC connection as the Java process that will use it runs once a week as a cron job. And to Radoslaw: Your point about the relatively weak security of storing passwords in .pgpass files is well-taken. But I'm neither the SysAdmin nor the DBA at where I work so I can't easily change policy. However, we are at least required to change our database passwords on a regular basis. Scott Chris Browne wrote: > slangley@scharp.org (Scott Langley) writes: > >> Did anyone ever implement code in Java to read Postgres configuration >> information from a user's .pgpass file - or a more general >> pg_service.conf - as discussed in this thread back in 2006? >> > > We've done this; it turned out to be something to do not at the level > of an individual connection, but rather in a connection pool > implementation. > > That turns out to be not so useful as a "general" solution that would > be included in the JDBC driver :-(. >