title: iterate over all values of a pg_conn query in Ruby
body: <p>I have a ruby script where I need to retrieve all values from a database and do stuff with each one retrieved. Currently I am hard coding each retrieval, but this only works if there are 3 values coming back. How can I iterate over this? Below is my code:</p>
  
  <pre><code>  require 'pg'
    pg_conn = PGconn.connect(host = "main-pg-db-super.center.com", port = 6433, options = '', tty = '', 
                          dbname = "master_data", login = "user", password = "password")
  
    all_children = pg_conn.exec("SELECT id FROM pt.tests WHERE parent = '1';") # will return 3 results
    puts all_children[0]['id']
    puts all_children[1]['id']
    puts all_children[2]['id']
  </code></pre>