By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,903 Members | 1,081 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,903 IT Pros & Developers. It's quick & easy.

Error size varchar

P: n/a


Hi!!
I got error about a length field varchar. I have a table with a field type
varchar(20) but if I try to set to this field more than 20 characters I got
error.
I did a function to control the length of data and put it on trigger but
when it ocurrs I got the error anyway and the trigger not works.
This error is over than trigger execution??

This is the error

ERROR: value too long for type character varying(30)

*-------------------------------------------------------*
*-Edwin Quijada
*-Developer DataBase
*-JQ Microsistemas
*-809-747-2787
* " Si deseas lograr cosas excepcionales debes de hacer cosas fuera de lo
comun"
*-------------------------------------------------------*

__________________________________________________ _______________
Surf and talk on the phone at the same time with broadband Internet access.
Get high-speed for as low as $29.95/month (depending on the local service
providers in your area). https://broadband.msn.com
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Edwin Quijada" <li************@hotmail.com> writes:
I got error about a length field varchar. I have a table with a field type
varchar(20) but if I try to set to this field more than 20 characters I got
error.
I did a function to control the length of data and put it on trigger but
when it ocurrs I got the error anyway and the trigger not works.


The length constraint is checked before triggers are fired, I believe.
If you want silent truncation rather than an error, use a text column
(or unconstrained varchar) and put the truncation behavior into your
trigger.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.