Re: hstore: null value is treated as empty string by avals function

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: Alexey Bashtanov <bashtanov(at)nasvete(dot)ru>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: hstore: null value is treated as empty string by avals function
Date: 2010-10-11 11:54:33
Message-ID: AANLkTimUQRuPWGm7eg4KS3Nv8ZfcVvrJ+UL4DoZS+wG4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Sep 27, 2010 at 4:34 AM, Itagaki Takahiro
<itagaki(dot)takahiro(at)gmail(dot)com> wrote:
> On Mon, Sep 27, 2010 at 2:36 PM, Alexey Bashtanov <bashtanov(at)nasvete(dot)ru> wrote:
>> hstore: null value is treated as empty string by avals function
>>
>> # select avals('gfds'=>null) = array[null], avals('gfds'=>null) =
>> array[''], version();
>>  ?column? | ?column? |
>>    version
>> ----------+----------+------------------------------------------------------------------------------------------------------------------
>>  f        | t        | PostgreSQL 8.4.4 on x86_64-redhat-linux-gnu,
>> compiled by GCC gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-bit
>> (1 row)
>>
>> got f,t
>> expected t,f
>> hope the problem is clear
>
> I found 9.0 and 9.1dev returns t,f as expected.
> Is it an incompatibility between 8.4 and 9.0?

Yeah, seems to be. As far as I can see, the 8.4 behavior is flat-out wrong.

rhaas=# select avals(hstore('gfds', null::text));
avals
-------
{""}
(1 row)

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Evgeniy 2010-10-11 15:50:36 BUG #5703: Streaming replication: FATAL: bad buffer id: 0
Previous Message Netskin | Corin Langosch 2010-10-11 09:05:55 Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition