I am including the PostgreSQL JDBC driver (BSD-2) in my project in binary form (which I got from their website). I copied the license text in my repo, however I found the github repo for the driver and they give attribute to other code. Do I have to copy those licenses and give attribute to them too?
Yes, you have to fulfil the licenses of all the software that you distribute, including transitive dependencies. So if you distribute the pg-jdbc binaries, you also have to comply with all the licenses for all the software in those binaries.
However, it is common in the Java world to include all licenses within the JAR. As long as this license information is correct, this vastly simplifies keeping track of which licenses cover parts of the software. You can likely extract these licenses programmatically.
However, different licenses have very different requirements. Some licenses not only require that a copy of the license is preserved with the software, but also that the license is made accessible to users of the software. Hiding the license in a JAR isn't really accessible to end users. Therefore, it could make sense to show these licenses in a manual for your software, or in an interactive help screen of your software. What is appropriate depends a lot on what your software is doing.