title: Set a value to a variable based on the results of a query (in PL/pgSQL style)
body: <p>What I need to do is set a value to a variable using the <code>EXECUTING</code> query.</p>
  
  <p>In pure SQL style, I could do something like the following:</p>
  
  <pre><code>// here declaring function and etc...
  DECLARE cnt INTEGER;
  
  EXECUTE 'SELECT COUNT(*) FROM t' INTO cnt;
  </code></pre>
  
  <p>How to achieve the same functionality in the form of a PL/pgSQL function? What is the correct syntax for the following pseudo-code? (The following is obviously the wrong syntax)</p>
  
  <pre><code>cnt :=  EXECUTE ( 'SELECT COUNT(*) FROM t' )   ;
  </code></pre>