X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3B33F52E81 for ; Thu, 28 Jul 2005 11:00:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59157-08 for ; Thu, 28 Jul 2005 14:00:51 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id ADE3552E7E for ; Thu, 28 Jul 2005 11:00:47 -0300 (ADT) Received: (qmail 20574 invoked from network); 28 Jul 2005 14:00:50 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 28 Jul 2005 14:00:50 -0000 Mime-Version: 1.0 (Apple Message framework v733) Content-Transfer-Encoding: 7bit Message-Id: <50AD47FA-2BB3-40DC-AE2B-29D7B0C0FDF7@fastcrypt.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: List From: Dave Cramer Subject: Proposed patch for showing originating query on error Date: Thu, 28 Jul 2005 10:00:46 -0400 X-Mailer: Apple Mail (2.733) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.014 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/394 X-Sequence-Number: 13542 This just adds an exception to the existing backend exception showing the originating query. Given that the backend doesn't show us this information, a few people have asked for it. Dave *** 426,437 **** --- 432,451 ---- StatementResultHandler handler = new StatementResultHandler (); result = null; + try + { connection.getQueryExecutor().execute(queryToExecute, queryParameters, handler, maxrows, fetchSize, flags); + } + catch( SQLException ex ) + { + handler.handleError(new PSQLException(GT.tr("Original Query -->") + queryToExecute.toString(queryParameters), PSQLState.UNKNOWN_ST ATE)); + throw ex; + } result = firstUnclosedResult = handler.getResults(); }