It would be great to document jsonb_populate_record better, especially the rowtype. May be it is obvious to an experienced user, but for a less experienced it isn't clear how it should be defined. Only after Tom's email, I realized that it can be done without creating a table.
My use case may be a bit more complex:
1. My JSON doc is large - few hundred keys and it is not practical to define rowtype for the entire doc. Plus not all docs have all keys in each record. I'd like to specify only a relatively small number of keys (by their path) for jsonb_populate_record instead of the entire json field.
2. My docs have hierarchical structure, but the output should be flattened base on the structure defined in #1.
Can those problems be addressed within the current implementation?
-------- Original message --------
From: "David G. Johnston" <david.g.johnston@gmail.com>
Date: 5/14/18 9:09 AM (GMT-08:00)
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Merlin Moncure <mmoncure@gmail.com>, reader 1001 <007reader@gmail.com>, Pavel Stehule <pavel.stehule@gmail.com>, pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: Abnormal JSON query performance