Subject: | table_info TABLE_SCHEM incorrect, TABLE_TYPE and interface incomplete |
Issue (DBD-InterBase-0.48):
1) [Incorrectness] Interbase/Firebird does not support schema in the DBI
sense of the term, yet $dbh->table_info() non-NULL for TABLE_SCHEM.
2) [Incompleteness] $dbh->table_info() accepts no parameters, so that
one cannot search for tables of a specific type or name pattern, nor
list all supported TABLE_TYPE.
Expectation:
1) (Schema) TABLE_SCHEM should always be NULL -- a DBI "schema" is a
namespace prefix which can discriminate tables of the same name.
DBD-InterBase incorrectly returns rdb$relations.rdb$owner_name here,
which is perhaps appropriate in the Oracle world but not here. You
cannot have a table "SYSDBA"."TBL" and a table "A_USER"."TBL" in the
same database file.
rdb$owner_name is useful, however, and could be returned as an
additional column (suggested field name: IB_OWNER_NAME).
2) (Incompleteness) All versions of IB/FB that I'm aware of support
object types 'TABLE', 'VIEW' and 'SYSTEM TABLE' (rdb$% or mon$% tables).
FB2.1 and later IB (7+ ?) additionally support 'GLOBAL TEMPORARY' types.
'SYSTEM VIEW', which is not defined in the DBI but is supported in at
least DBD::Pg, is clearly possible given the rdb$relations table's
structure, but is perhaps nowhere implemented.
Moreover, one cannot use this function to search for specific catalogs
and schema (neither of which are supported by IB/FB),
tables/views/system tables and enumerate types.
Background:
table_info() is an awkward, complicated function whose implementation
across DBD drivers is rather inconsistent.