title: Insert python list into PostgreSQL database
body: <p>I'm working on a scraping project and I'm struggling with inserting data into database. </p>
  
  <p>My database has three columns: id, post and author
  Scraped data is stored in two lists. First one is list posts and second one is authors. Both are the same length always because there are no articles without content or articles without author. </p>
  
  <p>I've tried solution provided in <a href="https://stackoverflow.com/questions/31510945/how-to-insert-a-python-list-into-postgres-table">this</a> question but I got this error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "scrape.py", line 69, in &lt;module&gt;
  cur.execute("INSERT into posts(id, post, author) VALUES (%s, %s, %s)", authors)
  TypeError: not all arguments converted during string formatting
  </code></pre>
  
  <p>My lists look like this:</p>
  
  <pre><code>author = [n1, n2, n3 ... n45]
  posts = [n1, n2, n3 ... n45]
  </code></pre>
  
  <p>And I would like to insert them into database like this:</p>
  
  <pre><code>ID | Post | Author
  ---|------|--------
  1  | Text | Author
  2  | Text | Author
  </code></pre>
  
  <p>Later on I would need to extract stats from values in post column. To be exact word and number of how many times they appear but I guess it qualifies for another question.</p>