Jonathan Leffler wrote:
> 
> I thought that table_info was supposed to return the data in a usable
> format, so that you didn't need to do more than replace one of the items
> from table_info (or maybe the dot-separated concatenation of some
> sequence of non-empty items) into the FROM clause.  If table_info
> doesn't give you the data in a usable format, isn't that definition
> broken?

You assume that

 1) table_info is the only source for table names
 2) these table names are usable in SQL statements only
 3) these SQL statements are run on the same DBMS

This does not hold in general. Counter-examples:

 1) You process a non-SQL schema definition, e.g. EXPRESS,
    CDIF, CWMI, XML Schema, Xplain, ... or a proprietary DDL.

 2) You export your schema definition into one of the
    formats named in 1).
    Or, you simple display all tables in a schema viewer.

 3) In a typical (cross DBMS) replication scenario, you
    select table names from the source DBMS and run DDL
    or DML statements against the destination DBMS.

> What concerns me is 'what should a DBD module do if it is asked to do
> quote_identifier on an identifier that cannot be handled'

Sure, quote_identifier() cannot solve all portability problems.
If, for example, the length of a table name is greater than
SQL_MAX_TABLE_NAME_LEN, you can quote ad nauseam ...


Steffen

Reply via email to