Re: Please provide examples of rows from - Mailing list pgsql-docs

From Tom Lane
Subject Re: Please provide examples of rows from
Date
Msg-id 878265.1600625640@sss.pgh.pa.us
Whole thread Raw
In response to Re: Please provide examples of rows from  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Please provide examples of rows from  (Bruce Momjian <bruce@momjian.us>)
List pgsql-docs
I wrote:
> You're right that the only suitable core function is going to be
> json[b]_to_recordset, but I don't see why you can't extend the
> existing example for that.  Something like

Meh, I was too hasty and pushed "send" with a broken example.  Better

=# select * from rows from (json_to_recordset('[{"a":1,"b":"foo"},{"a":"2","b":"bar"}]') as (a int, b text),
generate_series(1,3))as x(p,q,s); 
 p |  q  | s
---+-----+---
 1 | foo | 1
 2 | bar | 2
   |     | 3
(3 rows)

            regards, tom lane



pgsql-docs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Please provide examples of rows from
Next
From: PG Doc comments form
Date:
Subject: Index Locking Order is important