You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@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?
@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...
@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.
@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.
@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).
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.
Activity
Emill commentedon Aug 28, 2015
Since there should be no problem sending text, we could at least do that.
roji commentedon Aug 29, 2015
@Emill, isn't this already supported by setting NpgsqlDbType to Unknown and sending a string, like in the SendUnknown test we have?
schotime commentedon Feb 20, 2016
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.
roji commentedon Feb 23, 2016
@schotime yeah, that's exactly what this issue is about
roji commentedon Jan 8, 2017
Closing for lack of interest, will reopen if requested.
MienDev commentedon Mar 15, 2018
@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.
roji commentedon Mar 15, 2018
@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?
MienDev commentedon Mar 15, 2018
@roji What a pity. Seems hopeless in a short time. I'll try other ways, such as, JSONB as you say. Thank you again.
ramax495 commentedon Feb 14, 2019
Any changes on this issue ?
roji commentedon Feb 14, 2019
@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...
30 remaining items
shawnallen85 commentedon Jun 17, 2020
Simply enabling the ltree extension doesn't satisfy that then?
YohDeadfall commentedon Jun 17, 2020
ltreehad no binary protocol until @NinoFloris submitted it. See release notes for PostgreSQL 13.shawnallen85 commentedon Jun 17, 2020
Ahh, okay, thanks!!
roji commentedon Oct 7, 2020
@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.
YohDeadfall commentedon Oct 7, 2020
If @NinoFloris won't touch this I may take this on the weekend.
roji commentedon Oct 25, 2020
@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.
Add binary protocol support for label tree (ltree)
[-]Binary support for the ltree contrib type[/-][+]Support for the ltree contrib type[/+]Devoney commentedon Sep 8, 2021
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?)
roji commentedon Sep 8, 2021
@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).
roji commentedon Sep 8, 2021
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.