Re: BUG #5797: Strange bug with hstore

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5797: Strange bug with hstore
Date: 2010-12-27 21:41:03
Message-ID: AANLkTimy3s8jS2mXQ388_HudTxNYNpr-dfOa9+UfyZ6n@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Dec 26, 2010 at 12:29 AM, Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com> wrote:
> 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?

I think your proposed change is safe.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2010-12-27 21:56:32 Re: BUG #5801: characters not encoded properly for column names
Previous Message Bruce Momjian 2010-12-27 21:14:19 Re: BUG #5784: CREATE INDEX USING GIN complains about array containing null values yet none exist