Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.1K
Views
Django & Postgres - Index Row Size Exceeds btree version 4 maximum

I have defined the following in Django to store an SSL certificate in plain-text PEM format:

class Certificate(models.Model):
    pem = models.CharField(max_length=4096, unique=True, blank=False, null=False)

When populating the table column in Postgres, I'm seeing this error which says the size of the data is too large for the b-tree index:

django.db.utils.OperationalError: index row size 2720 exceeds btree version 4 maximum 2704 for index "app_certificate_pem_key"
DETAIL:  Index row references tuple (1,6) in relation "app_certificate".
HINT:  Values larger than 1/3 of a buffer page cannot be indexed.
Consider a function index of an MD5 hash of the value, or use full text indexing.

Is there a "Django" way to create a unique index based on a hash of my pem column?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It looks like your index width is exceeded. Try to drop the index for the pem field.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!