Implementation of postgres event store