title: Combining multiple rows in postgreSQL into one row?
body: <p>I'm new to postgreSQL.  My goal is to run a query that returns all the item_id's listed for each proposal_id, where each unique proposal_id is a separate row entry, and each item_id is a column in that row entry.  </p>
  
  <p>Table 1 data looks like this: </p>
  
  <pre><code>proposal_id    item_id  
  
  1              83054
  1              81048
  2              71384
  2              24282
  2              19847
  2              18482
  3              84720
  4              18081
  4              73018
  </code></pre>
  
  <p>Here's what I want it to look like: </p>
  
  <pre><code>proposal_id     item_id_1     item_id_2    item_id_3    item_id_4    item_id_n
  1                  83054      81048
  2                  71384      24282        19847        18482
  3                  84720
  4                  18081      73018
  </code></pre>
  
  <p>The challenge is that I can have the same proposal_id for anywhere between 1 and up to 11 or more entries.</p>
  
  <p>This is a simplified version for the purposes of asking this question.  Once I nail this, my plan is to then join additional data for each item_id and proposal_id from other tables in here.    </p>
  
  <p>Any help greatly appreciated. </p>
  
  <p>Thanks!</p>
  
  <p>EDITED: Fixed table aesthetics </p>