• A request arrives to the app server.

  • The app server passes it to the application.

  • Application interacts with the database via libpq to implement the request.

  • More likely:
    • Application is written in Java.
    • Use JDBC to connect to the database.