Activating Postgres Integration

I’m having a hard time getting any data from the Postgres integration to show up. I followed the setup instructions here, then I modified my chirpstack-application-server.toml file by adding the following lines:

  # PostgreSQL database integration.
  [application_server.integration.postgresql]
  # PostgreSQL dsn (e.g.: postgres://user:password@hostname/database?sslmode=disable).
  dsn="postgres://user:chirpstack_as_events:<mypassword>@localhost/chirpstack_as_events?sslmode=disable"

  # This sets the max. number of open connections that are allowed in the
  # PostgreSQL connection pool (0 = unlimited).
  max_open_connections=0

  # Max idle connections.
  #
  # This sets the max. number of idle connections in the PostgreSQL connection
  # pool (0 = no idle connections are retained).
  max_idle_connections=2

Is there something else I’m missing that is necessary to activate the integration?

It looks like you have an errant user: near the beginning of your URI.

Good catch. I fixed that, but after restarting the application server I’m still not seeing any data being stored. Anything else I should check?

Ah, I hadn’t changed enabled=["mqtt"] to enabled=["mqtt","postgresql"]. Maybe that, along with the [application_server.integration.postgresql] segment posted above could be added to the documentation here: https://www.chirpstack.io/application-server/integrations/postgresql/

While it is buried in the config file itself, it would be helpful to call that out in the docs page specifically related to Postgres integration activation so a newcomer like me doesn’t have to go looking in multiple places.

Please open an Issue or PR at https://github.com/brocaar/chirpstack-docs

1 Like

Just submitted a PR. Thanks for the suggestion!