Re: Run Vacuum Through JDBC

Lists: pgsql-general
From: Yan Cheng CHEOK <yccheok(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Run Vacuum Through JDBC
Date: 2010-05-11 05:38:15
Message-ID: 749824.82816.qm@web65709.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I was wondering, how can I check whether Vacuum operation had been executed without problem?

I use the following Java code to execute Vacuum operation

final Statement st2 = connection.createStatement();
st2.executeUpdate("VACUUM FULL ANALYZE VERBOSE");
st2.close();

Nothing print out at console.

I check at server status through pgadmin, also get no hint whether Vacuum operation had been executed.

Thanks and Regards
Yan Cheng CHEOK


From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Yan Cheng CHEOK <yccheok(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Run Vacuum Through JDBC
Date: 2010-05-11 07:12:11
Message-ID: 4BE9034B.2070008@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 11/05/10 13:38, Yan Cheng CHEOK wrote:
> I was wondering, how can I check whether Vacuum operation had been executed without problem?
>
> I use the following Java code to execute Vacuum operation
>
> final Statement st2 = connection.createStatement();
> st2.executeUpdate("VACUUM FULL ANALYZE VERBOSE");
> st2.close();
>
> Nothing print out at console.
>
> I check at server status through pgadmin, also get no hint whether Vacuum operation had been executed.

That looks like Java / JDBC code.

If so - if executing the statement doesn't throw SQLException, then it
worked. Same as all other SQL.

--
Craig Ringer

Tech-related writing: http://soapyfrogs.blogspot.com/


From: Kris Jurka <books(at)ejurka(dot)com>
To: Yan Cheng CHEOK <yccheok(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Run Vacuum Through JDBC
Date: 2010-05-11 18:58:17
Message-ID: alpine.BSO.2.00.1005111457130.11093@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, 10 May 2010, Yan Cheng CHEOK wrote:

> I was wondering, how can I check whether Vacuum operation had been
> executed without problem?
>
> final Statement st2 = connection.createStatement();
> st2.executeUpdate("VACUUM FULL ANALYZE VERBOSE");
> st2.close();
>
> Nothing print out at console.
>

The results of the vacuum are available in Statement.getWarnings().

Kris Jurka


From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Yan Cheng CHEOK <yccheok(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Run Vacuum Through JDBC
Date: 2010-05-11 23:57:21
Message-ID: AANLkTilIv9L9KolOItSkYeEvA2rVPi2COy9WvaWrqsWb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, May 10, 2010 at 11:38 PM, Yan Cheng CHEOK <yccheok(at)yahoo(dot)com> wrote:
> I was wondering, how can I check whether Vacuum operation had been executed without problem?
>
> I use the following Java code to execute Vacuum operation
>
> final Statement st2 = connection.createStatement();
> st2.executeUpdate("VACUUM FULL ANALYZE VERBOSE");
> st2.close();

On a side note, unless you have extenuating circumstances, vacuum is
preferred over vacuum full. If you must run vacuum full, pay
attention to possible index bloating.