title: postgresql: select returning ARRAY
body: <p>I have a table as:  </p>
  
  <pre><code>CREATE TABLE tbl_temp (id serial, friend_id int, name varchar(32));  
  </code></pre>
  
  <p>I wish I could run the following SQL:</p>
  
  <pre><code>PREPARE x AS SELECT {$1,friend_id} FROM tbl_temp WHERE id = ANY($2);  
  EXECUTE x(33, ARRAY[1,2,3,4])
  </code></pre>
  
  <p>I basically looking for a statement that will return me an array of two ints first of which will be user input and second will be from table column like <code>friend_id</code>.</p>
  
  <p>Is it really possible in PostgreSQL?</p>
  
  <p>The results from SELECT ($1, friend_id) FROM tbl_temp;</p>
  
  <pre><code>EXECUTE x(44);
    row     
  --------  
   (44,1)  
   (44,2)  
   (44,3)  
  (3 rows)
  </code></pre>
  
  <p>If I use <code>PQgetvalue(PGres, 0, 0)</code> how will the result look like: <code>{44,45}</code> or like <code>(44,45)</code>?</p>