Skip to content

Add support for new Postgres 9.2 RANGE types #126

Closed

Description

@roji

Migrated from pgfoundry feature request #1011216

Right now, Npgsql will handle a RANGE type as a string, which is not ideal.

However, I'm not sure the best way to implement this as there's not really a native concept of a range type in .NET. It would probably be hacky to implement this as a two-element array.

Perhaps Npgsql can implement its own Range class which would contain an upper and lower value. This class would also need to support inclusive and exclusive bounds, as well as unbounded ranges.

A bonus feature would be to implement an implicit conversion between Range and String so that code can work with ranges exactly as you could in Postgres, for example:

Range foo = "[5,10]";

As well as operators to compare ranges with other instances.

Reference: http://www.postgresql.org/docs/devel/static/rangetypes.html

Activity

  1. added this to the milestone on Jan 2, 2015
  2. roji commented on Jan 2, 2015

    @roji
    MemberAuthor

    Implemented by @Emill (binary-only) but needs tests

  3. roji commented on Jan 4, 2015

    @roji
    MemberAuthor

    Just noticed that there's already a test. Should probably also test array support but all in all this seems good.

  4. modified the milestones: , 3.0-beta1 on Mar 30, 2015
  5. modified the milestones: 3.0-beta1, on Aug 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions