ActiveRecordExtended icon indicating copy to clipboard operation
ActiveRecordExtended copied to clipboard

RFC: Interest in adding ltree support?

Open bf4 opened this issue 1 year ago • 0 comments

https://www.postgresql.org/docs/current/ltree.html

This module implements a data type ltree for representing labels of data stored in a hierarchical tree-like structure. Extensive facilities for searching through label trees are provided.

A label is a sequence of alphanumeric characters, underscores, and hyphens. Valid alphanumeric character ranges are dependent on the database locale. For example, in C locale, the characters A-Za-z0-9_- are allowed. Labels must be no more than 1000 characters long.

Examples: 42, Personal_Services

A label path is a sequence of zero or more labels separated by dots, for example L1.L2.L3, representing a path from the root of a hierarchical tree to a particular node. The length of a label path cannot exceed 65535 labels.

Example: Top.Countries.Europe.Russia

and see https://patshaughnessy.net/2017/12/13/saving-a-tree-in-postgres-using-ltree

perhaps adapt https://github.com/cfabianski/ltree_hierarchy

bf4 avatar Mar 26 '24 17:03 bf4