ltree::text not immutable?

From: Joe Van Dyk <joe(at)tanga(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: ltree::text not immutable?
Date: 2014-10-23 18:59:12
Message-ID: CACfv+pL2oX08SSZSoaHpyC=UbfTFmPt4UmVEKJTH7y=2QMRCBw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

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?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-10-23 19:05:41 Re: BUG #11771: wrong behaviour of planner when pushing conditions
Previous Message Tom Lane 2014-10-23 16:28:16 Re: BUG #11770: Segfault on spell.c when there are more than one characters as suffix flag

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-10-23 19:21:56 Re: [Windows,PATCH] Use faster, higher precision timer API
Previous Message Dag-Erling Smørgrav 2014-10-23 18:56:49 Re: [PATCH] add ssl_protocols configuration option