Re: [SQL] Line number returned in Postgres Raise Exception sentence

Поиск
Список
Период
Сортировка
От queralt
Тема Re: [SQL] Line number returned in Postgres Raise Exception sentence
Дата
Msg-id 1511182341138-0.post@n3.nabble.com
обсуждение исходный текст
Ответ на Re: [SQL] Line number returned in Postgres Raise Exception sentence  (Pavel Stehule <pavel.stehule@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [SQL] Line number returned in Postgres Raise Exception sentence
Следующее
От: Stephen Frost
Дата:
Сообщение: [SQL] Migration to pglister - Before