Skip site navigation (1) Skip section navigation (2)

Re: BUG #5797: Strange bug with hstore

From: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5797: Strange bug with hstore
Date: 2010-12-26 05:29:06
Message-ID: AANLkTi=usxGXtuuR46XkFaeUpQFLSE1UvxCdVtbVZrq8@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Tue, Dec 21, 2010 at 7:48 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Maxim Boguk" <Maxim(dot)Boguk(at)gmail(dot)com> writes:
>> Bad explain:
>> billing=# EXPLAIN SELECT * from domains where
>> name='"name"=>"somedomain"'::text::hstore->'name';
>>                                              QUERY PLAN
>> ----------------------------------------------------------------------------
>> ------------------------
>>  Seq Scan on domains  (cost=0.00..7775.91 rows=1 width=230)
>>    Filter: ((name)::text = (('"name"=>"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.  This is fixed in 9.0.
>
>                        regards, 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

In response to

Responses

pgsql-bugs by date

Next:From: Eric SchwarzenbachDate: 2010-12-27 19:39:57
Subject: IN clause on BYTEA column works against table directly but gives error against view
Previous:From: Robert HaasDate: 2010-12-25 05:08:31
Subject: Re: BUG #5781: unaccent() function should be marked IMMUTABLE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group