title: How to get data out of a postgres bytea column into a python variable using sqlalchemy?
body: <p>I am working with the script below.
  If I change the script so I avoid the bytea datatype, I can easily copy data from my postgres table into a python variable.</p>
  
  <p>But if the data is in a bytea postgres column, I encounter a strange object called memory which confuses me.</p>
  
  <p>Here is the script which I run against anaconda python 3.5.2:</p>
  
  <pre><code># bytea.py
  
  import sqlalchemy
  
  # I should create a conn
  db_s = 'postgres://dan:dan@127.0.0.1/dan'
  conn = sqlalchemy.create_engine(db_s).connect()
  
  sql_s = "drop table if exists dropme"
  conn.execute(sql_s)
  
  sql_s = "create table dropme(c1 bytea)"
  conn.execute(sql_s)
  
  sql_s = "insert into dropme(c1)values( cast('hello' AS bytea) );"
  conn.execute(sql_s)
  
  sql_s = "select c1 from dropme limit 1"
  result = conn.execute(sql_s)
  print(result)
  # &lt;sqlalchemy.engine.result.ResultProxy object at 0x7fcbccdade80&gt;
  
  for row in result:
      print(row['c1'])
  
  # &lt;memory at 0x7f4c125a6c48&gt;
  </code></pre>
  
  <p>How to get the data which is inside of memory at 0x7f4c125a6c48 ?</p>