Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yr6T7-0004cO-Ix for pgsql-jdbc@arkaria.postgresql.org; Sat, 09 May 2015 15:15:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yr6T7-0002A7-3r for pgsql-jdbc@arkaria.postgresql.org; Sat, 09 May 2015 15:15:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yr6T6-00029t-Ef for pgsql-jdbc@postgresql.org; Sat, 09 May 2015 15:15:08 +0000 Received: from nm18-vm3.bullet.mail.ne1.yahoo.com ([98.138.91.148]) by magus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Yr6T2-00017t-RD for pgsql-jdbc@postgresql.org; Sat, 09 May 2015 15:15:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1431184502; bh=qpJtg5xdsvgvBt9YSsZUpBhKfsZ9Of2FEJZhmfIv6+E=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=TorYBL/H0L37gj6PEnAJ86tHaltUqWwDQgBLWEnD3yOqgmuOAck4jxEUKRklR+PX+Qc+C9OjYNugZjCNUnBK3ru2sMVIlxGXJWMdfzJPi9cxXBe+V7xgorgOXNvdfwDNZxS2NvUKU7yaE7ODx9Z/Y8enzxU++W+gAoNDhypyw7qvsprMBNMiHVfiZwJ8JHu/am2UcJPjEDLbvrj8giUxtf3NFzuCPrqKKLU6FYpO/IkUfXXxFMnJUJ+ytAfvQUKFptcfzr4TLe1biJQHYyG/8eJUEg60DoM6/KzSKoRe6hfNkg115mR1ky3pJ2W66LDDQyveJO7VybYvYVpaHH5qiA== Received: from [98.138.100.103] by nm18.bullet.mail.ne1.yahoo.com with NNFMP; 09 May 2015 15:15:02 -0000 Received: from [98.138.89.172] by tm102.bullet.mail.ne1.yahoo.com with NNFMP; 09 May 2015 15:15:02 -0000 Received: from [127.0.0.1] by omp1028.mail.ne1.yahoo.com with NNFMP; 09 May 2015 15:15:02 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 401413.15680.bm@omp1028.mail.ne1.yahoo.com X-YMail-OSG: _tiOScQVM1lPYRjX0l8kQbbrvO13mtobTmXFyZJ4411HkDlVvkYe1.DERfr3wzs MudpJN0iR0C1fYotX7RMo4kuPhcwMSgILBO.Y_NQAInYaOdAVDZnEQ_ntP2lKlVbxRbS3OvcJFaf SZlBTXn5BmpOz9rTHwOZAzeNnskqc5ZWuHiqBeVARPilSDcvUNUU38NxeOFNrVQt6RMl8O6omQ12 OhoQfgcB4PJq1_fH9pkU.VD_UBwmZ2AeDZovSMg93Sqtr0ZLhlQREx7UpaSFB5s1nNXzyEfRCSxr lkC.E6P5PantjjHtO.disVsJNOLbqRGKAJTQGVNNNrikIz1TRqAyH_TyfT0OIGH76lsG2fKcC1ap SCdWYM3JDxIOcE1KX65XiaALqtnpDJvwjYEpTbG36d9fL0qWpF9m43MS_X6mx5USf3u9f5gF8pf_ Dh18iRwI1xmtN1R0xQuVOFD5BmmDDrEcSGvmAPPY.iKLv2DYfaQovjra84378JLbSzU_37FoFH9H 0VYF188JlQRh5GfFWFfTrl1PoAqHzX20ePWyANGM.jBxyZ3A0YLbtC0yh Received: by 98.138.101.168; Sat, 09 May 2015 15:15:01 +0000 Date: Sat, 9 May 2015 15:15:01 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: Mark Rotteveel , PostgreSQL JDBC Message-ID: <1613283179.3261220.1431184501200.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <554DBE8F.2030709@lawinegevaar.nl> References: <554DBE8F.2030709@lawinegevaar.nl> Subject: Re: Regarding inclusion of indexes as tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 1691 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Mark Rotteveel wrote: > [...] having getTables and getColumns return index information > sounds a bit curious: that is what getIndexInfo is for. > Is an index in PostgreSQL selectable (as if it is a table) or can > the index itself be referenced as a column (eg select index from > table)? If not, I'd suggest that the information should not be > part of getTables nor of getColumns. It's somewhat understandable how the driver developers got to this point, since in the server indexes are considered *relations*, as are tables, views, materialized views, system catalogs, foreign tables, etc. On the other hand, unlike other relations they cannot generally be referenced in SELECT queries or DML statements. A query can sometimes return data directly from the columns in an index, but it is the job of the optimizer to recognize when a query referencing a table can be optimized in this way. If I were designing this in a green field, I would probably limit return of indexes to the getIndexInfo() method and filter them out of scans of relations returned by the getTables() method. That said, doing so now could break working code for existing users, and the getTables() method does allow you to specify which table types you want returned; so I (and probably most of the pg community) would be reluctant to support filtering them out by default at this point. We tend to be reluctant to make changes that break working code for existing users, and want to make a lot of noise about any such change so that people have a chance to fix it before putting it into production. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc