Documentation is essential for developers, as well as business owners, to understand the full picture. Documentation for the database schema, objects, and code should be maintained. ER and class diagrams are very useful in understanding the full picture. There are tons of programs that support UML and ER diagrams. You can generate ER and UML diagrams by using graph-editing tools, such as yEd, or an online tool, such as draw.io. Also, there are many commercial UML modeling tools that support reverse-engineering code.
Code documentation provides an insight into complex SQL statements. PostgreSQL uses -- and /**/ for single-line and multiline comments, respectively. The single-line comment, --, works on the rest of the line after the comment marker. Therefore, it can be used on the same line as the actual statement. Finally, PostgreSQL allows the developer to store the database object description via the COMMENT ON command.