Re: Re; pg_dump from Java

From: "Michael Schmidt" <michaelmschmidt(at)msn(dot)com>
To: "Markus Schaber" <schabi(at)logix-tt(dot)com>
Cc: "PostgreSQL JDBC" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Re; pg_dump from Java
Date: 2006-04-10 16:52:51
Message-ID: BAY101-DAV12EF21A7E0DE2CD3BC3F44A3CC0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Markus,

Thanks for the info about these environment variables - pretty handy stuff! However, it seems a possible drawback in using them is that they could compromise cross-platform compatibility. Also, there was mention that PGPASSWORD could pose security issues on some systems. As I have it set up now, the user enters the password into the application on the first database access and it is stored for the duration of the session only.

Michael Schmidt

> I've continued to work on the problem (stubbornness + free time is a
> deadly combination) and have gotten a solution others might find
> helpful. In Java 1.5 (5.0 per their new numbering) there is a new
> ProcessBuilder class. It is a different way to create a runtime process
> that allows setting environmental variables.

Maybe you can also use the appropriate environmental variable to pass
the password to pg_dump, it should work for all libpq based applications¹.

http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html<http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html>

This should work even nicer than parsing stdout / stderr.

HTH,
Markus

¹ Exception is debian, they put wrappers into the path which don't
honour those variables, and do their own magic.
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in EU! www.ffii.org<http://www.ffii.org/> www.nosoftwarepatents.org<http://www.nosoftwarepatents.org/>

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Andres Olarte 2006-04-11 01:51:15 Re: I just can't use the org.postgresql.Driver class... Please help!
Previous Message Markus Schaber 2006-04-10 15:53:30 Re: No automatic reconnect after network error