Re: Abnormal JSON query performance

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, reader 1001 <007reader(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Abnormal JSON query performance
Date: 2018-05-14 15:01:41
Message-ID: CAKFQuwa8m-gPNsDJHTc5nfeu5uEWvsrHx3neEOpoxARu+6CkxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, May 14, 2018 at 7:49 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> SELECT ... FROM ...some tables...,
> jsonb_to_record(jsonbcol) AS j(id int, name text, price numeric)
> WHERE ...
>
> which is something you can do today.
>

​Indeed you can - could you please point to the docs for that one?

SELECT *
FROM (VALUES ('{"id":1,"name":"Dave","country":"US"}'::json)) vals (v)
, json_to_record(v) j(name text, country text)

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-05-14 15:06:16 BUG #15196: bogus data in lock file "postmaster.pid"
Previous Message Tom Lane 2018-05-14 14:49:06 Re: Abnormal JSON query performance