title: How to use to_jsonb as row_to_jsonb? Where the details about "how much"?
body: <p>I was testing some queries at pg9.4 in &quot;JSON mode&quot;, and now I am checking if pg9.5 will bring all same JSONB functionality... But there are no <code>row_to_jsonb()</code> function (!). (why it is not  <a href="https://en.wikipedia.org/wiki/Orthogonal_instruction_set" rel="nofollow noreferrer">orthogonal instruction set</a> in the basic parameters?)</p>
  <p><a href="http://www.postgresql.org/docs/9.5/static/functions-json.html#FUNCTIONS-JSON-CREATION-TABLE" rel="nofollow noreferrer">The guide</a>  only says <em>&quot;the to_jsonb function supplies much the same functionality&quot;</em>. <strong>Where we can check &quot;how much&quot;?</strong>   There are other <em>specific JSONB guide</em> about this details?</p>
  <hr />
  <p><strong>((Year 2022 update and pg upgrade))</strong></p>
  <p>The phrase <em>&quot;supplies much the same functionality&quot;</em> was removed on the version 13. The <a href="https://www.postgresql.org/docs/current/functions-json.html" rel="nofollow noreferrer">current Guide</a> does not use the phrase neither the word &quot;much&quot;.</p>
  <p>Now <code>row_to_json</code> <strong>is an alias for <code>to_json</code></strong>  except when the optional boolean parameter is <code>true</code> — the result will be the inclusion of line feeds like in <code>jsonb_pretty()</code>.</p>
  <p>Now the functions  <code>to_jsonb</code> and <code>to_json</code> are orthogonal (!), and  typical use is the same:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT t.a, t.b, to_jsonb(r) json_info
              -- or to_json(r)
  FROM t, LATERAL (SELECT t.c,t.d,t.f) r;
  
  -- or SELECT to_jsonb(r) FROM (SELECT c,d,f FROM t) r;
  </code></pre>