pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Guyren Howe <guyren@gmail.com>
Cc: Pg Docs <pgsql-docs@lists.postgresql.org>
Subject: Re: Please provide examples of rows from
Date: Sun, 20 Sep 2020 14:14:00 -0400
Message-ID: <878265.1600625640@sss.pgh.pa.us> (raw)
In-Reply-To: <835988.1600613834@sss.pgh.pa.us>
References: <158638264419.662.2482095087061084020@wrigleys.postgresql.org>
	<20200904014618.GB13932@momjian.us>
	<CAKFQuwbBDr22KJRyJQRECO_XU6cyouwz3ocn0Tv4JgG4Gm5hMQ@mail.gmail.com>
	<20200920003910.GA22746@momjian.us>
	<798909.1600562993@sss.pgh.pa.us>
	<20200920013846.GC22746@momjian.us>
	<835988.1600613834@sss.pgh.pa.us>

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





view thread (16+ messages)  latest in thread

Message-ID: <878265.1600625640@sss.pgh.pa.us>
Permalink:  ../878265.1600625640@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/878265.1600625640@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, david.g.johnston@gmail.com, guyren@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: Please provide examples of rows from
  In-Reply-To: <878265.1600625640@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox