Re: json query problem

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: "john(dot)tiger" <john(dot)tigernassau(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: json query problem
Date: 2014-01-02 21:38:47
Message-ID: 52C5DC67.7020906@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/02/2014 11:19 AM, john.tiger wrote:
> trying to select a row of json type returning the entire json record
>
> table users id, jsondata
> jsondata has {"username":"jdoe", ....}
>
> select json_to_row from users where jsondata->"username" = "jdoe";
> fails on operator -> unknown
>
> using debian testing with postgresql backport ppa
> psql: 9.3.2 server 9.2.6
>
> do I need a higher server version ? is there a 9.3 server available for
> debian ?
>

Yes, you need 9.3+ to get the -> operator.

FYI, a good way to determine this is to go to the section you want, in
this case:

http://www.postgresql.org/docs/9.2/interactive/functions-json.html

Then look at the top of page. There will be links to other versions of
the Postgres for which this documentation applies. By moving
backward/forward you can see when features appear or are changed.

>
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Grittner 2014-01-02 23:08:09 Re: Refresh Materialized View
Previous Message Joshua D. Burns 2014-01-02 21:08:38 Re: json query problem