title: How to use a SQL for loop to insert rows into database?
body: <p>I'm using Postgres, and I have a large number of rows that need to be inserted into the database, that differ only in terms of an integer that is incremented.  Forgive what may be a silly question, but I'm not much of a database guru.  <b>Is it possible to directly enter a SQL query that will use a loop to programatically insert the rows?</b></p>
  
  <p>Example in pseudo-code of what I'm trying to do:</p>
  
  <pre><code>for i in 1..10000000 LOOP
    INSERT INTO articles VALUES(i)
  end loop;
  </code></pre>