pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joseph Shraibman <jks@selectacast.net>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Getting vacuum results
Date: Tue, 13 Sep 2005 18:52:34 -0400
Message-ID: <43275832.5020207@selectacast.net> (raw)
In-Reply-To: <Pine.BSO.4.62.0509131712530.31592@leary.csoft.net>
References: <df8hfc$2jcb$1@news.hub.org>
	<Pine.BSO.4.62.0509131712530.31592@leary.csoft.net>

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();
> 	}
> }
> 
> 



view thread (7+ messages)  latest in thread

Message-ID: <43275832.5020207@selectacast.net>
Permalink:  ../43275832.5020207@selectacast.net/
Also on:    postgresql.org/message-id/43275832.5020207@selectacast.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: jks@selectacast.net, books@ejurka.com
  Subject: Re: Getting vacuum results
  In-Reply-To: <43275832.5020207@selectacast.net>
  References: <df8hfc$2jcb$1@news.hub.org> <Pine.BSO.4.62.0509131712530.31592@leary.csoft.net> <43275832.5020207@selectacast.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox