Hi Evgenij, *I don't know what do you mean by system table and why you need to distinguish them from normal tables and views.*
I don't know the JDBC specification, but with all other driver: Hsqldb, Derby, smallSQL, all table and view in the INFORMATION_SCHEMA have SYSTEM TABLE as TABLE_TYPE. I write a JDBC driver <https://prrvchr.github.io/jdbcDriverOOo/> for LibreOffice/OpenOffice Base and Base use DataBaseMetaData.getTables() method to obtain the list of Table and View and uses the 4th argument to filter TABLE, VIEW and SYSTEM TABLE. But since you are not using SYSTEM TABLE as the TABLE_TYPE for the table and view contained in INFORMATION_SCHEMA, any filtering is impossible. Le jeudi 23 juin 2022 à 02:32:34 UTC+2, Evgenij Ryazanov a écrit : > Hello. > > JDBC doesn't have any actual requirements for returned table types, the > provided list is only an example. > H2 returns table types as required by the SQL Standard for > INFORMATION_SCHEMA.TABLES.TABLE_TYPE column. > > But each JDBC driver should return its own table types from > DatabaseMetaData.getTableTypes() and H2 does it correctly. > > I don't know what do you mean by system table and why you need to > distinguish them from normal tables and views. The INFORMATION_SCHEMA and > pg_catalog (it exists only when PostgreSQL compatibility mode was > enabled) normally have only very special virtual tables, but they aren't > expected to be found in other places. > > You can use non-standard DB_OBJECT_SQL function, it definitely returns > NULL for various special tables. > > SELECT TABLE_SCHEMA, TABLE_NAME, DB_OBJECT_SQL('TABLE', TABLE_SCHEMA, > TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES; > > https://h2database.com/html/functions.html#db_object_sql > > These is also non-standard INFORMATION_SCHEMA.TABLES.TABLE_CLASS column, > but you should understand that names of some implementations may be changed > at any moment, even it patch release, some implementations may appear only > under certain conditions and it is possible to add an own implementation of > a table with a custom table engine. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/54e487ef-504c-4d5f-89f4-bbcd38024f99n%40googlegroups.com.
