title: PostgreSQL User Defined table type in memory
body: <p>If got several stored procedures (functions in PG) that need to pass around an intermediate result set between them (1K rows at most)</p>
  
  <p>I can do this in other DBMS's but would like to know how to accomplish this in native PostgreSQL.</p>
  
  <p>Specifically does PG support:  </p>
  
  <pre><code>CREATE TYPE MyTable AS TABLE(...)
  </code></pre>
  
  <p>Also can we do this completely in memory?</p>
  
  <p>I want to pass a "MyTable" between several procs as input and output.</p>
  
  <p>Or possibly could I build this result set and pass it around as a JSONB parameter?</p>
  
  <p>I need this to be blazingly fast, no matter how it's done.</p>