The driver's sourcecode is available to you in the customer area (v3.5 -> extra's section).
It uses 3 stages:
- PostgreSqlDBDriver will return the names of elements, e.g. tables, views etc.
- PostgreSqlCatalogRetriever governs the retrieval of all meta-data of a catalog/db
- PostgreSqlSchemaRetriever will for every element you select in the 1st screen of the db refresher retrieve the meta-data, so fields for tables etc.
I think it's easiest to start with PostgreSqlDBDriver, because if those queries already return 0 rows, you won't be able to select any elements so no tables will be fetched.
To get all schemas: SELECT * FROM information_schema.schemata
To get all tables for a schema:
SELECT t.table_name, obj_description(c.oid, 'pg_class') as table_comment FROM information_schema.tables t INNER JOIN pg_class c ON t.table_name = c.relname INNER JOIN pg_namespace s ON t.table_schema = s.nspname AND s.oid = c.relnamespace WHERE t.table_schema = 'SCHEMA_NAME' AND t.table_type = 'BASE TABLE'
where you replace SCHEMA_NAME with the name of a schema in your catalog/DB.
Obtain fields for table:
SELECT c.*, col_description(t.oid, c.ordinal_position) as column_comment FROM INFORMATION_SCHEMA.COLUMNS c INNER JOIN pg_class t ON c.table_name = t.relname INNER JOIN pg_namespace s ON c.table_schema = s.nspname AND s.oid = t.relnamespace WHERE table_schema='SCHEMA_NAME' AND table_name = 'TABLE_NAME' ORDER BY ordinal_position asc
Here you again replace SCHEMA_NAME with the name of the schema, and TABLE_NAME with the name of the table.
But I agree with David, it's likely they store the meta-data differently.