title: PostgreSQL: "index row requires 1460216 bytes, maximum size is 8191"
body: <p>I'm new to PostgreSQL and I'm trying to populate a table with the content of a list of dictionaries built in Python, which looks like:</p>
  
  <p><code>diclist = [{'accession':'value', 'species':'value', 'seq':'value', 'length': 'value'},
              {'accession':'value', 'species':'value', 'seq':'value', 'length': 'value'}, 
  ...]</code></p>
  
  <p>'seq' values are strings with sometimes > 300.000 characters...</p>
  
  <p>However, my data include genetic sequences which are pretty long so when I try to load these data into the table, PostgreSQL claims the following:</p>
  
  <blockquote>
    <p>index row requires 1460216 bytes, maximum size is 8191</p>
  </blockquote>
  
  <p>Is there a way to increase the row index maximum size?? Or is there a way to compress the space required by my data?</p>
  
  <p>I know BioPython and BioSQL are made to handle genetic sequences, but they don't exactly match what I need...</p>
  
  <p>This is the function I've built for the moment (<em>diclist</em> is the list of dictionaries):</p>
  
  <pre><code>def insert_biosequence(diclist):
  try:
  params = config()
  conn = psycopg2.connect(**params)
  cur = conn.cursor()
  cur.executemany("""INSERT INTO biosequence(accession, species, seq, length) VALUES (%(accession)s, %(species)s, %(seq)s, %(length)s)""", diclist)
  conn.commit()
  cur.close()
    except (Exception, psycopg2.DatabaseError) as error:
  print(error)
  finally:
  if conn is not None:
    conn.close()
  </code></pre>
  
  <p>My CREATE TABLE command is the following:</p>
  
  <pre><code>CREATE TABLE biosequence (
  accession TEXT,
  species TEXT,
  seq TEXT PRIMARY KEY,
  length INTEGER
  </code></pre>
  
  <p>);</p>
  
  <p>I'm not using any INDEX commands, I think it's done by default by PostgreSQL... should I?</p>