title: How to use psycopg2 to retrieve a certain key's value from a postgres table which has key-value pairs
body: <p>New to python, trying to use psycopg2 to read Postgres </p>
  
  <p>I am reading from a database table called deployment and trying to handle a Value from a table with three fields id, Key and Value</p>
  
  <pre><code>import psycopg2
  conn = psycopg2.connect(host="localhost",database=database, user=user, password=password)
  cur = conn.cursor()
  cur.execute("SELECT \"Value\" FROM deployment WHERE (\"Key\" = 'DUMPLOCATION')")
  records = cur.fetchall()
  print(json.dumps(records))
  [["newdrive"]]
  </code></pre>
  
  <p>I want this to be just "newdrive" so that I can do a string comparison in the next line to check if its "newdrive" or not</p>
  
  <p>I tried json.loads on the json.dumps output, didn't work</p>
  
  <pre><code>&gt;&gt;&gt; a=json.loads(json.dumps(records))
  &gt;&gt;&gt; print(a)
  [['newdrive']]
  
  I also tried to print just the records without json.dump
  &gt;&gt;&gt; print(records)
  [('newdrive',)]
  </code></pre>