Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGlZq-0002UQ-Lu for pgsql-sql@arkaria.postgresql.org; Mon, 20 Nov 2017 12:53:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eGlZq-0006DY-9O for pgsql-sql@arkaria.postgresql.org; Mon, 20 Nov 2017 12:53:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eGlYm-0004So-Lz for pgsql-sql@postgresql.org; Mon, 20 Nov 2017 12:52:24 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eGlYk-0001yz-Eu for pgsql-sql@postgresql.org; Mon, 20 Nov 2017 12:52:23 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 226ED989031F for ; Mon, 20 Nov 2017 05:52:21 -0700 (MST) Date: Mon, 20 Nov 2017 05:52:21 -0700 (MST) From: queralt To: pgsql-sql@postgresql.org Message-ID: <1511182341138-0.post@n3.nabble.com> In-Reply-To: References: <1510654656203-0.post@n3.nabble.com> Subject: Re: Line number returned in Postgres Raise Exception sentence MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org 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; ServerErrorMessage sem = 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