?
Solved

postgres ERROR:  value too long for type character varying(256)

Posted on 2009-04-16
7
Medium Priority
?
4,833 Views
Last Modified: 2012-08-13
I found the following message within syslog.

< message >
postgres ERROR:  value too long for type character varying(256)


I am not developer but manage server.
Would you please tell me the meaning and the solution?
0
Comment
Question by:chunzi
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 750 total points
ID: 24156650
Here you are trying to insert a String that is longer as 256 Chars into a column, that has a maximum length of 256. When using JDBC this problem can occur when inserting unicode Strings into an UFT-8 database (I had similar problems using MySQL). Try extending the field or shortening your data.
0
 
LVL 22

Expert Comment

by:earth man2
ID: 24157118
You can correct these application errors using trigger functions, at some overhead to the update or insert process.
0
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 24157166
But these "cut off everything that is too long" triggers are dangerous, if the data being inserted is important.
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 22

Expert Comment

by:earth man2
ID: 24158007
You could save extra long fields in an "overflow" table using a trigger to catch large fields
0
 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 24163817
You tried to insert a string longer than 255 characters. Check your string or increase the field length
0
 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 24163821
(Sorry, didn't read earlier answers. But I belive he should simply enlarge his field)
0
 

Author Closing Comment

by:chunzi
ID: 31570925
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question