schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.62k stars 200 forks source link

Ignored system data types #258

Closed mroiter-larus closed 5 years ago

mroiter-larus commented 5 years ago

Issue

While crawling data from a Postgres database with columns having type oid, and more in general all system columns, it seems that they are excluded from crawling.

To reproduce the error just create a sample database with a table as follow:

create table aircraft ( name varchar(100) ) with oids;
insert into aircraft values ('Boeing 747');

and try to execute schema crawler. The oid column is not extracted. Is it correct? Is there a way to configure Schema Crawler to consider system columns?

Environment

Schema Crawler version: 14.16.01 Java version 1.8.0_66 MacOs Mojave 10.14.6 Postgres (Docker container) with the latest version (11.2) PostgreSQL JDBC Driver with version 42.0.0

sualeh commented 5 years ago

@mroiter-larus Mauro, the PostgreSQL JDBC driver does not provide this information, so SchemaCrawler cannot obtain it. Ultimately, SchemaCrawler only extracts the information and data that the JDBC drivers provide.

Are you interested in finding out if a table has an OID column? We can find a way to get that information accessible to SchemaCrawler.

mroiter-larus commented 5 years ago

@sualeh I know that to find out if a table has an OID column i can query the pg_class. Anyway if you can find a way to get this information accessible via SchemaCrawler APIs would be wonderful.

Thanks in advance

sualeh commented 5 years ago

It should be easy enough to get it into the table attributes. I will send you some sample code that you can use. The idea is to use SchemaCrawler Data Dictionary Extensions, in particular ADDITIONAL_TABLE_ATTRIBUTES.

sualeh commented 5 years ago

@mroiter-larus Mauro, I have made changes that will show a new "RELHASOIDS" attibute for tables. You will need to use the maximum info-level. This will be available in the next release of SchemaCrawler.

sualeh commented 5 years ago

Please use SchemaCrawler 16.1.2

mroiter-larus commented 5 years ago

@sualeh Thank you very much. I'll try to follow your instructions.