Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id ADFF39FB25F for ; Tue, 26 Sep 2006 06:08:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 96396-03 for ; Tue, 26 Sep 2006 09:08:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id 6E3509FA2D5 for ; Tue, 26 Sep 2006 06:08:32 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GS8v6-0007sQ-Qb for pgsql-jdbc@postgresql.org; Tue, 26 Sep 2006 11:08:04 +0200 Received: from ppp-82-135-75-58.dynamic.mnet-online.de ([82.135.75.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Sep 2006 11:08:04 +0200 Received: from spam_eater by ppp-82-135-75-58.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Sep 2006 11:08:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Small problem with embedded comments in a statement Date: Tue, 26 Sep 2006 11:07:52 +0200 Lines: 24 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: ppp-82-135-75-58.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200609/113 X-Sequence-Number: 15831 Hello, When running the following query: String sql = "select * from table1\n" + "--select * from table2;\n" + "--select * from table3"; I get an error: org.postgresql.util.PSQLException: Multiple ResultSets were returned by the query. But as the second and third SELECT are behing a comment, they should be ignored, right? Actually when removing the semicolon after table2, then everything works fine. Is this a bug in the JDBC driver, or is this intended behaviour? Best regards Thomas P.S.: before you ask why I run such a SQL statement: I'm maintaining an open-source query tool and sometimes unwanted statements are simply un-commented from within the editor, but the application still sends the whole string that the user supplied.