Re: BUG #5797: Strange bug with hstore - Mailing list pgsql-bugs

From Maxim Boguk
Subject Re: BUG #5797: Strange bug with hstore
Date
Msg-id AANLkTi=usxGXtuuR46XkFaeUpQFLSE1UvxCdVtbVZrq8@mail.gmail.com
Whole thread Raw
In response to Re: BUG #5797: Strange bug with hstore  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #5797: Strange bug with hstore  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
On Tue, Dec 21, 2010 at 7:48 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Maxim Boguk" <Maxim.Boguk@gmail.com> writes:
>> Bad explain:
>> billing=3D# EXPLAIN SELECT * from domains where
>> name=3D'"name"=3D>"somedomain"'::text::hstore->'name';
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0QUERY PLAN
>> ------------------------------------------------------------------------=
----
>> ------------------------
>> =C2=A0Seq Scan on domains =C2=A0(cost=3D0.00..7775.91 rows=3D1 width=3D2=
30)
>> =C2=A0 =C2=A0Filter: ((name)::text =3D (('"name"=3D>"somedomain"'::text)=
::hstore ->
>> 'name'::text))
>> (index not used)
>
> The reason for this is that hstore fails to label its I/O functions as
> immutable (or even stable) in 8.4. =C2=A0This is fixed in 9.0.
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0regards, tom lane
>

Sorry for late responce and thank you for clarification.

My research of that problem leads me to conclusion that can be fixed
on 8.4.4 with:
 ALTER FUNCTION hstore_in(cstring) IMMUTABLE;
but is it really safe?
Or text->hstore conversion in 8.4 is really VOLATILE as labeled in
hstrore module?

Regards, Maxim

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: BUG #5781: unaccent() function should be marked IMMUTABLE
Next
From: Eric Schwarzenbach
Date:
Subject: IN clause on BYTEA column works against table directly but gives error against view