title: JSON - out of memory error
body: <pre><code>CREATE TABLE X AS
  SELECT json_array_elements(json_rmq -&gt; 'orders'::text) AS order
  FROM table_name
  WHERE blah;
  </code></pre>
  
  <p>I get out of memory error.</p>
  
  <p>Is there anything I can do to unpack the above?</p>
  
  <p>The JSON column is about ~5 MB and it has about 150,000 array elements in 'orders' above.
  I tried <code>work_mem</code> values up to 250MB and it did not help, the query takes about same time to fail. I guess this parameter does not help JSON processing.</p>