title: Select into without creating a new table in PostgreSQL
body: <p>I have a number of queries like so whose results are combined at the very end so I can count the number of joins between the two different result sets and then use a union query to produce a full table of results. The problem here is that using select into creates a new table for each result instead of storing it in memory. When using PostgreSQL, how do I store each result in its own variable without creating a whole bunch of bogus tables in the database that I will have drop thereafter?</p>
  
  <pre><code>select distinct cust_num into t1 
  from all_visits_x_cust 
  where date &gt; '06/02/2015'
  and date &lt;= '07/02/2015' 
  and cust_num &gt; 9999;
  
  select distinct cust_num into t1_2 
  from cc_calls_x_cust 
  where date = '06/02/2015' 
  and cust_num &gt; 9999);
  
  select count(*) as post_call_visitors 
  into v1 
  from t1_2 join t1 
  on t1.cust_num = t1_2.cust_num);
  </code></pre>