How to review Database schema? I am green been software engineer, my team lead give me a task in PostgreSQL database, I need to determine the relationship of the all 405 tables, but the problem is the database doesn't have any documentation, the foreign keys and primary keys naming are so different for example. 

In table a the primary key is userId and the foreign key is accountId and in other table foreign key is employeeId and supervisorId.

How to approach this kind of database without documentation? is there any API for PostgreSQL to show the table relation ships?

any tutorial link or document is acceptable,
All the information you need is in the catalog, have a look at the tables:

information_schema.table_constraints
information_schema.key_column_usage
information_schema.constraint_column_usage


However, if you want something more visual have a look at:

http://schemaspy.sourceforge.net/


It will reverse engineer your schema and produce html output