Skip to content

COPY: handle DateTime kind mismatch with a clearer error (or normalize) #5

Description

@WailedParsley36

Binary COPY is strict about types and does no implicit cast, so writing a Kind=Utc DateTime to a timestamp without time zone column throws a low-level Npgsql converter error. The parameterized insert path hides this via driver inference + implicit cast.

Options to consider:

  • Detect the mismatch and throw a clear, actionable message naming the column.
  • Optionally normalize the DateTime.Kind to match the column's timestamp type.

At minimum this is documented on the Bulk COPY page; a friendlier runtime experience would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bulk-copyBinary COPY / bulk-insert pathdxDeveloper experience / error messages

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions