Skip to content

Support for the ltree contrib type #699

Closed

Description

@roji

Originally requested in #696.

The PostgreSQL contrib module ltree contains the ltree type for representing labels of data stored in a hierarchical tree-like structure.

Unfortunately the module doesn't provide binary in/out functions, so these have to be added first and merged in PostgreSQL. Then, an Npgsql type handler can be created.

Activity

  1. Emill commented on Aug 28, 2015

    @Emill
    Contributor

    Since there should be no problem sending text, we could at least do that.

  2. roji commented on Aug 29, 2015

    @roji
    MemberAuthor

    @Emill, isn't this already supported by setting NpgsqlDbType to Unknown and sending a string, like in the SendUnknown test we have?

  3. schotime commented on Feb 20, 2016

    @schotime

    You can't select an ltree column either without the binary error. Had to cast to text in the sql to get the value to return.

  4. roji commented on Feb 23, 2016

    @roji
    MemberAuthor

    @schotime yeah, that's exactly what this issue is about

  5. roji commented on Jan 8, 2017

    @roji
    MemberAuthor

    Closing for lack of interest, will reopen if requested.

  6. MienDev commented on Mar 15, 2018

    @MienDev

    @roji Would there be any update on support for the ltree contrib type ? thank u.
    I'm using ef core, however ltree is not supported.

  7. roji commented on Mar 15, 2018

    @roji
    MemberAuthor

    @MienDev nothing positive to say, unfortunately - ltree is still lacking binary I/O support on the PostgreSQL side. It's still possible to use it in Npgsql via text, but this is not currently possible in EF Core.

    JSONB has been around for a long time and should provide very similar possibilities for tree representation and searching (in fact it's probably considerably better by now), have you given it a try?

  8. MienDev commented on Mar 15, 2018

    @MienDev

    @roji What a pity. Seems hopeless in a short time. I'll try other ways, such as, JSONB as you say. Thank you again.

  9. ramax495 commented on Feb 14, 2019

    @ramax495

    Any changes on this issue ?

  10. roji commented on Feb 14, 2019

    @roji
    MemberAuthor

    @ramax495 unfortunately not... This issue depends on binary support being added on the PostgreSQL side (so it's not only an Npgsql issue), and with PostgreSQL JSONB nowadays interest seems to be low...

  11. 30 remaining items

  12. shawnallen85 commented on Jun 17, 2020

    @shawnallen85

    Simply enabling the ltree extension doesn't satisfy that then?

  13. YohDeadfall commented on Jun 17, 2020

    @YohDeadfall
    Contributor

    ltree had no binary protocol until @NinoFloris submitted it. See release notes for PostgreSQL 13.

  14. shawnallen85 commented on Jun 17, 2020

    @shawnallen85

    Ahh, okay, thanks!!

  15. roji commented on Oct 7, 2020

    @roji
    MemberAuthor

    @NinoFloris just a reminder that this still needs you, and 5.0 is approaching fast :) If you don't think you'll get around to it, let me know and I'll see about completing it.

  16. YohDeadfall commented on Oct 7, 2020

    @YohDeadfall
    Contributor

    If @NinoFloris won't touch this I may take this on the weekend.

  17. roji commented on Oct 25, 2020

    @roji
    MemberAuthor

    @YohDeadfall we're getting close to the 5.0 release - are you or @NinoFloris intending to do this? It would certainly be a shame to have done the work on the PG side (thanks @NinoFloris) but not add support on our side. Please let me know.

  18. added a commit that references this issue on Nov 10, 2020
    ed2f47d
  19. changed the title [-]Binary support for the ltree contrib type[/-] [+]Support for the ltree contrib type[/+] on Nov 25, 2020
  20. Devoney commented on Sep 8, 2021

    @Devoney

    We are using npgsql extensively and we would very much like the support for LTree in EF Core. In the tagged [5.0.7] version (https://github.com/npgsql/efcore.pg/blob/v5.0.7/src/EFCore.PG/Types/LTree.cs) LTree is not found. I have seen LTree in the main branch though.
    There we have also found a PR that adds the implementation.
    Looking at the preview packages, it seems to me that there will be no new nuget package > 5.0.7, is that correct? The project(s) we are working on will stay .NET 5.0 for a while, and therefore, we would like the LTree support in .NET 5.0.

    Would you be willing to accept a PR where LTree is added on top of 5.0.7, and release a newer version for it? (5.0.8?)

  21. roji commented on Sep 8, 2021

    @roji
    MemberAuthor

    @Devoney support for LTree in the EF Core provider is tracked by npgsql/efcore.pg#1592 - this repo is for the lower-level ADO.NET driver. This isn't something that would be appropriate to backport to a 5.0 patch release, as it's a new feature rather than a bug fix; but have you given the EF Core 6.0.0 preview packages a try? They're very stable, 6.0.0-rc.1 should be out very soon, and the final release isn't too far off (in November).

  22. roji commented on Sep 8, 2021

    @roji
    MemberAuthor

    Another important point is that 5.0.0 is not a long-term support release, so it will be out of support anyway in May 2022 (see this page). That makes it even less worthwhile to backport features to it, and hopefully you guys can get a head start on moving to 6.0.0 via the previews.

    Note that if you do try out EF Core 6, you'll need to use .NET Core 6 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions