Checkout the DocumentStore library: MartenDb
It's documentation makes it pretty clear what postgress can do concerning this and event sourcing