Skip to content

Provider data types for prepared queries #361

Closed

Description

@Emill

When binding values for a prepared statement, framework value is used for the parameters instead of provider values. This means if a user explicitly sets a parameter to a provider-type, the value will be "downcasted" to framework-type. For example, using a parameter with a NpgsqlTimeTZ value will lose the time zone.

The value is fetched here: https://github.com/npgsql/Npgsql/blob/765bc445e84c15f8a8e08a67192b82337343145b/Npgsql/NpgsqlCommand.cs#L1519

For non-prepared statements, the provider value is fetched instead:
https://github.com/npgsql/Npgsql/blob/765bc445e84c15f8a8e08a67192b82337343145b/Npgsql/NpgsqlCommand.cs#L778

Activity

  1. Emill commented on Oct 24, 2014

    @Emill
    ContributorAuthor

    Fixed by #390.

  2. added theissue type on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions