update to realtime data capture to use postgres