title: Insert a single variable into a table in PostgreSQL using python
body: <p>I am trying to insert a single value into a Postgres table with two columns. The first column is an auto-increasing primary key while the second column should be a variable. I have done some research and found the following resources <a href="https://stackoverflow.com/questions/18053500/typeerror-not-all-arguments-converted-during-string-formatting-python">TypeError: not all arguments converted during string formatting python</a>, <a href="https://stackoverflow.com/questions/7718585/how-to-set-auto-increment-primary-key-in-postgresql,and">How to set auto increment primary key in PostgreSQL?</a> this <a href="https://stackoverflow.com/questions/12771209/psycopg2-string-formatting-with-variable-names-for-type-creation">Psycopg2 string formatting with variable names for type creation</a>. </p>
  
  <pre><code>import psycopg2
  
  try:
      conn = psycopg2.connect("dbname=postgres user=postgres password=actuarial")
      print("database created successfully.")
  except psycopg2.OperationalError as ex:
      print("Connection failed: {0}".format(ex))
  cur = conn.cursor()
  
  def create_client_table():
      cur.execute("CREATE TABLE ClientTable (ClientID SERIAL PRIMARY KEY, Name varchar);")
      print('student table created successfully')
  
  create_client_table()
  
  def client_add():
      name = input("Enter the names of the student:")
      cur.execute("INSERT INTO CleintTable VALUES (%s)", (name));
      cur.execute("SELECT * FROM StudentTable")
      rows = cur.fetchall()
      print(rows)
  client_add()
  
  conn.close()
  </code></pre>
  
  <p>Upon running the code above I get the following error. Kindly help me identify where I am going wrong.</p>
  
  <pre><code>cur.execute("INSERT INTO CleintTable VALUES (%s)", (name));
  
  TypeError: not all arguments converted during string formatting
  </code></pre>