Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 80E919FAD5A for ; Mon, 22 Jan 2007 01:44:33 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 53505-07 for ; Mon, 22 Jan 2007 01:44:30 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bay0-omc2-s2.bay0.hotmail.com (bay0-omc2-s2.bay0.hotmail.com [65.54.246.138]) by postgresql.org (Postfix) with ESMTP id E50DB9FB255 for ; Mon, 22 Jan 2007 01:44:29 -0400 (AST) Received: from hotmail.com ([65.54.169.77]) by bay0-omc2-s2.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sun, 21 Jan 2007 21:44:28 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 21 Jan 2007 21:44:28 -0800 Message-ID: Received: from 71.221.112.215 by BAY114-DAV5.phx.gbl with DAV; Mon, 22 Jan 2007 05:44:27 +0000 X-Originating-IP: [71.221.112.215] X-Originating-Email: [michaelmschmidt@msn.com] X-Sender: michaelmschmidt@msn.com From: "Michael Schmidt" To: "PostgreSQL JDBC" , "Michael Schmidt" References: Subject: Re: pg_dump in PostgreSQL version 8.2 not working in Java app Date: Sun, 21 Jan 2007 22:44:26 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0014_01C73DAD.B46198C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: MSN 9 X-MimeOLE: Produced By MSN MimeOLE V9.50.0034.2000 Seal-Send-Time: Sun, 21 Jan 2007 22:44:26 -0700 X-OriginalArrivalTime: 22 Jan 2007 05:44:28.0500 (UTC) FILETIME=[61BF9140:01C73DE8] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.538 tagged_above=0 required=5 tests=AWL, BAYES_50, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, HTML_MESSAGE, MSGID_FROM_MTA_HEADER, SPF_PASS X-Spam-Level: * X-Archive-Number: 200701/139 X-Sequence-Number: 16504 This is a multi-part message in MIME format. ------=_NextPart_000_0014_01C73DAD.B46198C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Folks, I've continued working on this problem and the plot thickens. I'm not = even able to get output from psql.exe through Java. I ran the following = simple test code: // String[] parms =3D new String[] = {"C:\\Windows\\System32\\ipconfig.exe", ""}; String[] parms =3D new String[]{"C:\\Program = Files\\PostgreSQL\\8.2\\bin\\psql.exe","-Upostgres"}; File f =3D new File(parms[0]); if (!f.isFile()) { System.out.println("Error - this isn't a file"); } ProcessBuilder pb =3D new ProcessBuilder(parms); pb.redirectErrorStream(true); Process p =3D pb.start(); BufferedReader br =3D new BufferedReader(new = InputStreamReader(p.getInputStream())); String line; while ((line =3D br.readLine()) !=3D null) { System.out.println(line); } System.out.println("Exit with " + p.exitValue()); The ipconfig utility simply outputs the internet configuration. I used = the "" String to simulate a parameter. This code identifies parm[0] as = a valid file, outputs the configuration, and returns an exit code of 0, = as it should. When I switch the parms (comment out the ipconfig = String[] line and remove the comments from the psql.exe String[] line), = the process hangs. So, with identical code, ipconfig works and psql = hangs. What the hey? And again, this did not happen with 8.1. Michael Schmidt ------=_NextPart_000_0014_01C73DAD.B46198C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Folks,
I've continued working on this problem and the plot thickens.  = I'm not=20 even able to get output from psql.exe through Java.  I ran the = following=20 simple test code:
 
// String[] parms =3D new String[]=20 {"C:\\Windows\\System32\\ipconfig.exe", ""};
String[] parms =3D new String[]{"C:\\Program Files\\PostgreSQL\\8.2\\bin\\psql.exe","-Upostgres"};
File f =3D new File(parms[0]);
if = (!f.isFile())=20 {
    System.out.println("Error - this isn't a file");
}
ProcessBuilder pb =3D new = ProcessBuilder(parms);
pb.redirectErrorStream(true);
Process p =3D pb.start();
BufferedReader br =3D new BufferedReader(new=20 InputStreamReader(p.getInputStream()));
String line;
while = ((line =3D=20 br.readLine()) !=3D null) {
    System.out.println(line);
}
System.out.println("Exit with " + = p.exitValue());
 
The ipconfig utility simply outputs the internet=20 configuration.  I used the "" String to simulate a parameter.  = This=20 code identifies parm[0] as a valid file, outputs the = configuration,=20 and returns an exit code of 0, as it should.  When I switch the = parms=20 (comment out the ipconfig String[] line and remove the comments from the = psql.exe String[] line), the process hangs.  So, with identical = code,=20 ipconfig works and psql hangs.  What the hey?  And again, this = did not=20 happen with 8.1.
 
Michael Schmidt
------=_NextPart_000_0014_01C73DAD.B46198C0--