X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6BACDD8AC5 for ; Tue, 13 Sep 2005 19:52:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02335-03 for ; Tue, 13 Sep 2005 22:52:35 +0000 (GMT) Received: from a1.selectacast.net (a1.selectacast.net [199.107.233.208]) by svr1.postgresql.org (Postfix) with ESMTP id 71FCDD81CE for ; Tue, 13 Sep 2005 19:52:35 -0300 (ADT) Received: from tupari.net (h-66-166-198-124.nycmny83.covad.net [66.166.198.124]) by a1.selectacast.net (8.12.8/8.12.8) with ESMTP id j8DMqbPP023415; Tue, 13 Sep 2005 18:52:37 -0400 Received: from [192.168.1.3] (jks-desktop [192.168.1.3]) by tupari.net (8.13.1/8.12.8) with ESMTP id j8DMqYlR003932; Tue, 13 Sep 2005 18:52:34 -0400 Message-ID: <43275832.5020207@selectacast.net> Date: Tue, 13 Sep 2005 18:52:34 -0400 From: Joseph Shraibman User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050716 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Subject: Re: Getting vacuum results References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.07 required=5 tests=[AWL=0.020, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/45 X-Sequence-Number: 13830 It's funny. Your test program works, but in my server I get this: Got SQLException: Something unusual has occured to cause the driver to fail. Please report this exception. ... and nothing else. Kris Jurka wrote: > > > On Thu, 1 Sep 2005, Joseph Shraibman wrote: > >> If I run VACUUM VERBOSE from jdbc, how do I get the output? There are >> no SQLWarnings attached to the resultset. >> > > SQLWarnings are attached to the Statement because VACUUM does not > produce a query result. The attached test case shows this working fine > for me. The one complication is that vacuum puts out some of its > interesting information in the Detail: part of the log message. The > JDBC driver doesn't normally put this information into the warning > message, so you must either increase the loglevel URL parameter or use > the 8.1 series and write pg specific code to access the individual > fields of the ServerErrorMessage class. We plan to increase the number > of fields used to construct the error string to include the Detail > field, but haven't gotten around to it yet. > > Kris Jurka > > > ------------------------------------------------------------------------ > > import java.sql.*; > > public class Vacuum { > > public static void main(String args[]) throws Exception { > Class.forName("org.postgresql.Driver"); > Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/jurka?loglevel=1","jurka",""); > Statement stmt = conn.createStatement(); > stmt.execute("VACUUM VERBOSE"); > SQLWarning warn = stmt.getWarnings(); > System.out.println(warn); > while (warn != null) { > warn = warn.getNextWarning(); > System.out.println(warn); > } > stmt.close(); > conn.close(); > } > } > >