create table t1 (json json);
create index on t1 using btree((json::text));
-- Above works as expected
create extension ltree;
create table t2 (ltree ltree);
create index on t2 using btree((ltree::text));
psql:/tmp/t.sql:8: ERROR: functions in index expression must be marked
IMMUTABLE
What I'm trying to do is quickly grab the root category from an categories
ltree.
Doing something like
where root_categories.id = subtree(ltree, 0, 1)
and was trying to make some indexes to make this go faster.
Seems like casting ltree to text and the subtree function should be
immutable?