db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew McIntyre" <mcintyr...@gmail.com>
Subject Re: Show commands are not orthogonal
Date Tue, 17 Oct 2006 18:05:02 GMT
On 10/17/06, Oystein Grovlen - Sun Norway <Oystein.Grovlen@sun.com> wrote:
> I find it strange that while "SHOW INDEXES", "SHOW PROCEDURES", and
> "SHOW SYNONYMS" by default list all corresponding objects in the
> database, "SHOW TABLES" and "SHOW VIEWS" by default only list the
> corresponding objects in the current schema.  Would it not be better
> if all commands behaved the same way?  Are there reasons for not
> changing this?

Having looked at the ij code, but not having gone to look at the
corresponding metadata code or the JDBC spec, I can say that this is
the current behavior when calling DatabaseMetadata.getTables() with
null as the argument for the schema parameter and "TABLE" as the table
type. I don't see a reason why it couldn't be fixed, although the fix
may be to the metadata method, and not necessarily to ij. I suspect
that if the schema is null, Derby uses the current connection schema
to restrict the set of tables that is returned.

> I also find it a bit strange that "SHOW VIEWS" uses the heading
> "TABLE_NAME" and not "VIEW_NAME".

These are the names of the columns returned from the ResultSet
retrieved from DatabaseMetadata.getTables(), and I believe those
column names are mandated by the JDBC spec. And, ij displays them
faithfully. :-)

We could override the column names in a similar way that we set the
column widths but I don't think that is really worthwhile. Probably
better to just document that little idiosyncrasy.


View raw message