Skip to content

PostgresType Doesn't Express Precision/Scale #1917

Closed

Description

@StillLearnin

For instance, numeric(1000,2) is simply expressed as numeric

Activity

  1. roji commented on May 9, 2018

    @roji
    Member

    Although we do need to fix some things, PostgresType will not express precision/scale.

    PostgresType corresponds to an actual PostgreSQL type (a row in pg_type). The different facts (precision, scale, length) aren't part of the type, but in PostgreSQL are part of the "type modifier", which is an additional int encoding extra facet data about a type. The typmod is configured on a column and is also returned as part of every resultset's RowDescription, but is distinct from the actual type (and is interpreted based on the type). To summarize, varchar(2) and varchar(3) both have the same type (in the sense of the same type OID in pg_type, and therefore the same PostgresType instance), but they have different type modifiers.

    For #1919, the idea is to fix NpgsqlDataReader.GetDataTypeName() to look at both the type and the type modifier (which is is currently ignored by that method), producing the correct full type name.

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

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions