Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8888777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:06:38+00:00 2026-06-14T22:06:38+00:00

I have a Postgres schema which looks like: The problem is that whenever I

  • 0

I have a Postgres schema which looks like:

enter image description here

The problem is that whenever I save text longer than 500 characters in the description column I get the error:

value too long for type character varying(500)

In the documentation for Postgres it says type text can have unlimited characters.

I’m using postgresql-9.1.

This table has been generated using Django 1.4 and the field type in the model is TextField, if that helps explain the problem further.

Any ideas as why this is happening and what I can do to fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:06:38+00:00Added an answer on June 14, 2026 at 10:06 pm

    By specifying the column as VARCHAR(500) you’ve set an explicit 500 character limit. You might not have done this yourself explicitly, but Django has done it for you somewhere. Telling you where is hard when you haven’t shown your model, the full error text, or the query that produced the error.

    If you don’t want one, use an unqualified VARCHAR, or use the TEXT type.

    varchar and text are limited in length only by the system limits on column size – about 1GB – and by your memory. However, adding a length-qualifier to varchar sets a smaller limit manually. All of the following are largely equivalent:

    column_name VARCHAR(500)
    
    column_name VARCHAR CHECK (length(column_name) <= 500) 
    
    column_name TEXT CHECK (length(column_name) <= 500) 
    

    The only differences are in how database metadata is reported and which SQLSTATE is raised when the constraint is violated.

    The length constraint is not generally obeyed in prepared statement parameters, function calls, etc, as shown:

    regress=> \x
    Expanded display is on.
    regress=> PREPARE t2(varchar(500)) AS SELECT $1;
    PREPARE
    regress=> EXECUTE t2( repeat('x',601) );
    -[ RECORD 1 ]-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    ?column? | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    

    and in explicit casts it result in truncation:

    regress=> SELECT repeat('x',501)::varchar(1);
    -[ RECORD 1 ]
    repeat | x
    

    so I think you are using a VARCHAR(500) column, and you’re looking at the wrong table or wrong instance of the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a Postgres 8.4 database that contains a varchar(10000) column. I'd like
We have a legacy schema file which has the following column names, would like
is there a way to group tables into Postgres's schema like structure? We have
I have a postgres database that I want to know some quick stats. For
is is possible in postgres to have a trigger on CREATE TABLE that will
I have a Postgres table with more than 8 million rows. Given the following
I have a postgres table with a column (called id) which contains strings. In
I have a migration that runs an SQL script to create a new Postgres
I have a PostgreSql 9.04 database that contains a postgres implementation of the ASPNet
I have a number of tables that use the Postgres Partitioning feature. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.