pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Rotteveel <mark@lawinegevaar.nl>
To: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Regarding inclusion of indexes as tables
Date: Sat, 09 May 2015 10:00:15 +0200
Message-ID: <554DBE8F.2030709@lawinegevaar.nl> (raw)
In-Reply-To: <554CE839.3040801@ttc-cmc.net>
References: <CAAuCDTi5_KRTUZabmdUVO9GESoPqkAc7atvCGNddExnzEcOwEQ@mail.gmail.com>
	<554CE839.3040801@ttc-cmc.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

On 8-5-2015 18:45, dmp wrote:

> 1. DatabaseMetaData.getTables()
>
> Each databases seems to decide what table types are available for
> this function call.
>
> PostgreSQL
>
> Table Types: FOREIGN TABLE
> Table Types: INDEX
> Table Types: MATERIALIZED VIEW
> Table Types: SEQUENCE
> Table Types: SYSTEM INDEX
> Table Types: SYSTEM TABLE
> Table Types: SYSTEM TOAST INDEX
> Table Types: SYSTEM TOAST TABLE
> Table Types: SYSTEM VIEW
> Table Types: TABLE
> Table Types: TEMPORARY INDEX
> Table Types: TEMPORARY SEQUENCE
> Table Types: TEMPORARY TABLE
> Table Types: TEMPORARY VIEW
> Table Types: TYPE
> Table Types: VIEW
>
> While, MariaDB
>
> Table Types: BASE TABLE
> Table Types: SYSTEM VIEW
> Table Types: VIEW
>
> If the database decides at its core to have index tables then
> they are going to be returned unless filtered via getTables().
>
> So this would seem warranted and not a bug.
>
> 2. DatabaseMetaData.getColumns()
>
> According to the Java API:
>
> Retrieves a description of table columns available in the specified
> catalog.
>
> So it retrieves all columns in a db specified for every table unfiltered
> by the arguments. If the table has indexes they will be retrieved.
>
> So again this would seem correct and not a bug.
>
> Perhaps a more specific description of what you are trying to accomplish
> could help to more fully answer the question of an alternative solution?

For background: I don't regularly use PostgreSQL so I don't know all its 
ins and outs. I develop Jaybird, the Firebird JDBC driver, and I 
recently joined this mailinglist to see and follow what users/developers 
of other JDBC drivers do and discuss (and the Firebird-java mailinglist 
is rather silent...).

With that out of the way: as an outside observer 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.

Mark
-- 
Mark Rotteveel


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (6+ messages)  latest in thread

Message-ID: <554DBE8F.2030709@lawinegevaar.nl>
Permalink:  ../554DBE8F.2030709@lawinegevaar.nl/
Also on:    postgresql.org/message-id/554DBE8F.2030709@lawinegevaar.nl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mark@lawinegevaar.nl
  Subject: Re: Regarding inclusion of indexes as tables
  In-Reply-To: <554DBE8F.2030709@lawinegevaar.nl>
  References: <CAAuCDTi5_KRTUZabmdUVO9GESoPqkAc7atvCGNddExnzEcOwEQ@mail.gmail.com> <554CE839.3040801@ttc-cmc.net> <554DBE8F.2030709@lawinegevaar.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox