Re: [SQL] Line number returned in Postgres Raise Exception sentence - Mailing list pgsql-sql

From queralt
Subject Re: [SQL] Line number returned in Postgres Raise Exception sentence
Date
Msg-id 1511182341138-0.post@n3.nabble.com
Whole thread Raw
In response to Re: [SQL] Line number returned in Postgres Raise Exception sentence  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-sql
We have found another solution from JDBC. 
We do a catch of SQLException, then we cast the exception to PSQLException
and then we obtain the ServerErrorMessage.
In this ServerErrorMessage the getMessage() returns just the text of the
error message of the Stored Procedure we execute from the try code.
Previously, we set the server log to Terse (set log_error_verbosity=terse).

catch (SQLException se)   {    System.out.println("ServerErrorMessage");    PSQLException ps = (PSQLException)se;
ServerErrorMessagesem = ps.getServerErrorMessage();    System.out.println(sem.getMessage());     } }
 




--
Sent from: http://www.postgresql-archive.org/PostgreSQL-sql-f2142323.html


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [SQL] Line number returned in Postgres Raise Exception sentence
Next
From: Stephen Frost
Date:
Subject: [SQL] Migration to pglister - Before