Write events from RabbitMQ to PostgreSQL database