Re: pg_start_backup question

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "db de *EXTERN*" <dbdevelopment09(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>, "Guillaume Lelarge" <guillaume(at)lelarge(dot)info>
Subject: Re: pg_start_backup question
Date: 2009-11-02 08:26:09
Message-ID: D960CB61B694CF459DCFB4B0128514C203937FEF@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

db de wrote:
> Below is what I did:
> I opened a super user connection to creat a super user
> statement. Then use the super user statement to execute
> "SELECT pg_start_backup('label')".
>
> try
> {
> superuserCont = java.sql.DriverManager.getConnection(URL, su, suPassword);
> suStatement = superuserCont.createStatement();
> boolean ret = suStatement.execute("SELECT pg_start_backup('label')");
> //LINE1
> }
> catch(SQLException e)
> {
> System.out.println("exception");
>
> //LINE2
> }
> finally
> {
> System.out.println("ret:" + ret);
>
> //LINE3
> }
>
> After LINE1 is executed, LINE3 is run and the output is:
> ret:false. LINE2 is not executed.

Maybe something else than an SQLException was thrown, and maybe
by some statement before the last in the try/catch block.

You should debug this.

Possible starting points:
- Change "catch (SQLException" to "catch (Throwable" and see if you
catch something.
- Execute it in a debugger or have status messages printed out after
every line. See which flow the execution takes.
- Set "log_statements='all'" in postgresql.conf on the database server
and see what you find in the log.
- See what you get when you issue that SQL statement with psql.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2009-11-02 08:34:22 Re: cidr data type question
Previous Message Vasiliy G Tolstov 2009-11-02 08:07:16 cidr data type question