Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B441B633145 for ; Wed, 28 Jul 2010 13:09:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 35048-09 for ; Wed, 28 Jul 2010 16:09:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outbound.vnet-inc.com (outbound.vnet-inc.com [216.146.104.103]) by mail.postgresql.org (Postfix) with ESMTP id 295CE633051 for ; Wed, 28 Jul 2010 13:09:43 -0300 (ADT) Received: from [192.168.157.32] (te193.montanavision.com [216.220.28.193]) by outbound.vnet-inc.com (Postfix) with ESMTP id 833CD5B50; Wed, 28 Jul 2010 10:09:42 -0600 (MDT) Message-ID: <4C505498.5070506@ttc-cmc.net> Date: Wed, 28 Jul 2010 10:02:32 -0600 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Paul-AndrePanon@SierraSystems.com, pgsql-jdbc@postgresql.org Subject: Re: getMetaData().getTables() behaviour with JDBC3 8.3 & 8.4 drivers on windows References: <84D20D8353A4AB4F96ED08738919009A2BBBDE1C82@SCVANEX7.sierrasys.com> In-Reply-To: <84D20D8353A4AB4F96ED08738919009A2BBBDE1C82@SCVANEX7.sierrasys.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201007/117 X-Sequence-Number: 20782 > > >The PostgreSQL driver appears to be causing some unexpected behaviour for the OpenNMS installer on Windows. > >In the following code snippet, the table row set returned includes TABLEs, SEQUENCEs, and INDEXes. Shouldn't getTables be filtering out and returning only tables and views? > > public void databaseSetUser() throws SQLException { > Connection adminConn = getAdminConnection(); > ResultSet rs = adminConn.getMetaData().getTables(null, "public", "%", null); > In your argument for getTables(catalog, schemaPattern, tableNamePattern, tableTypes) you have specified a null for the tableTypes. That I believe does not place any restrictions on the returned table, so VIEW and other types will be returned. types - A list of table types, which must be from the list of table types returned from getTableTypes(), to include; null returns all types. danap