Re: Casting hstore to json

From: Pawel Veselov <pawel(dot)veselov(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Casting hstore to json
Date: 2015-01-16 08:43:58
Message-ID: CAMnJ+BeTksofEKe+f=XzpMbcrYHnDC+8K1pvyrUXREbmcvv62Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian,

On Thu, Jan 15, 2015 at 9:09 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 01/15/2015 07:59 PM, Pawel Veselov wrote:
>
>> Hi.
>>
>> I'm trying to cast hstore to json, but I don't seem to be getting a json
>> object from hstore key/value pairs.
>>
>>
[skipped]

> db=> SELECT to_json('"a"=>1, "b"=>2'::hstore);
>> to_json
>> ------------------------------
>> "\"a\"=>\"1\", \"b\"=>\"2\""
>>
>
> Works here:
>
> business_app=> select version();
> version
> ------------------------------------------------------------
> -----------------------------------------------------------------
> PostgreSQL 9.3.5 on i686-pc-linux-gnu, compiled by gcc (SUSE Linux) 4.8.1
> 20130909 [gcc-4_8-branch revision 202388], 32-bit
> (1 row)
>
>
> business_app=> SELECT to_json('"a"=>1, "b"=>2'::hstore);
> to_json
> ----------------------
> {"a": "1", "b": "2"}
> (1 row)
>
>
> Did you upgrade from a previous version of Postgres?

Yes! From 9.1.14. 'alter extension hstore update' did the trick, thank you
:)

[skipped]

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Enrico Bianchi 2015-01-16 08:58:16 Re: Out of Memory
Previous Message Rémi Cura 2015-01-16 08:40:24 Re: Indexing large table of coordinates with GiST