Sending states to an external DB (not influx)

I am currently sending certain sensor data to influxdb. I also want to send certain sensor data to an external postgres db. I don’t want to move everything to the other database. I like to have the configuration local and a days worth of data locally. I don’t need any help with postgres. I really just want to know how to tell HA to send the state data there in addition to what it is already doing.

here is what I was talking about with influx that works great (some info edited):

influxdb:
  host: 192.168....
  port: 8086
  database: homeassistant
  username: doodah
  password:  doodah
  max_retries: 3
  default_measurement: state
  include:
    entities:
        - sensor.basement_temperature

I am not sure if this enables you to run anything other than a query, https://www.home-assistant.io/integrations/sql/

Thanks for your reply, I think this looks like it gets data and stores it in the home assistant database. But you have given me something to look into.