You can easily create a JCR repository that uses that PostgreSQL database for persistent storage. Basically, you'll want the basic "modeshape-jcr" library (and its dependencies) and the "modeshape-connector-store-jpa" library (and its dependencies). It's simple if you're using Maven, but a bit more involved if you're using and managing JARs. Configuring a repository to use ModeShape with JPA storage is pretty simple, as seen by this example configuration file (just use PostgreSQL connection parameters).
The code you write to use ModeShape will depend on whether your application is a web app or a stand-alone app that embeds ModeShape. Take a look at this section for using ModeShape within web applications, and this example project for how to use it within standalone apps.