Skip to content

Unable to use PostgreSQL as an event store #406

@Steve-OH

Description

@Steve-OH

Describe the bug

When I use PostgreSQL as the event store in an Asp.NET Core application, any attempt to write an event, even a do-nothing, empty event, results in an InvalidCastException with the message: "Writing values of 'Eventuous.Sql.Base.NewPersistedEvent[]' is not supported for parameters having no NpgsqlDbType or DataTypeName. Try setting one of these values to the expected database type."

To Reproduce
Steps to reproduce the behavior:

See the code and instructions in the repository at https://github.com/Steve-OH/postgres-exception-test

Expected behavior

It should be possible to use PostgreSQL as an event store.

Desktop (please complete the following information):

  • OS: Windows 10 Pro 22H2
  • Browser: n/a
  • Versions:
    • Eventuous 0.15.1
    • Eventuous.Extensions.ApsNetCore 0.15.1
    • Eventuous.Extensions.DependencyInjection 0.15.1
    • Eventuous.Postgresql 0.15.1
    • Npgsql 8.0.7
    • System.Text.Json 8.0.5
    • PostgreSQL 17.0 (Debian 17.0-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit

Edit: Added PostgreSQL version info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions