create a schema object by querying the metadata tables of postgresql