Re: can't cast hstore to json - Mailing list pgsql-general

From Joe Van Dyk
Subject Re: can't cast hstore to json
Date
Msg-id CACfv+p+cb-SJtKgFQuUYd42bkHLTCweqm7Zc0JoscOeQRL920w@mail.gmail.com
Whole thread Raw
In response to can't cast hstore to json  (Joe Van Dyk <joe@tanga.com>)
List pgsql-general
On Thu, Mar 13, 2014 at 12:15 PM, Joe Van Dyk <joe@tanga.com> wrote:
I've got a postgresql 9.3.2 server, compiled from scratch. Getting this error:

# select hstore('a', 'b')::json;
ERROR:  cannot cast type hstore to json
LINE 1: select hstore('a', 'b')::json;
                               ^
# select array_to_json(array[hstore('a', 'b')]);
  array_to_json
------------------
 ["\"a\"=>\"b\""]
(1 row)

(I expected  [{"a": "b"}] )

I don't get this on other postgresql installations. Any ideas?

Joe

ALTER EXTENSION hstore UPDATE; fixed the problem. (thanks oicu!)

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: can't cast hstore to json
Next
From: Tom Lane
Date:
Subject: Re: puzzling perl DBI vs psql problem