<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><META http-equiv=Content-Type content="text/html; charset=utf-8"><META content="IBISIT WebMail" name=GENERATOR></HEAD><BODY>
<div>try with either Rule or Trigger.<br>
</div><div>with regards,<br>S.Gnanavel</div><br><br><blockquote style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px; margin-right: 0px;"><div class="msgHeaders">-----Original Message-----<br><b>From:</b> raul(at)zerosoft(dot)ro<br><b>Sent:</b> Thu, 23 Jun 2005 11:18:45 +0300<br><b>To:</b> pgsql-php(at)postgresql(dot)org<br><b>Subject:</b> [PHP] varchar error<br><br></div><div class="oldBody"><div>
<div><font color="#800000" face="Verdana" size="2">Hello, I just have
this:</font></div>
<div><font color="#800000" face="Verdana" size="2"></font> </div>
<div><font color="#800000" face="Verdana" size="2">CREATE TABLE test
(<br> mytext varchar(5)<br>) WITHOUT OIDS;</font></div>
<div><font color="#800000" face="Verdana" size="2"></font> </div>
<div><font color="#800000" face="Verdana" size="2">If I put a string with more than 5
chars in mytext, I receive an error, regarding the wrong lenght of the
string.</font></div>
<div><font color="#800000" face="Verdana" size="2"></font> </div>
<div><font color="#800000" face="Verdana" size="2">In MySQL I know that the string is
automatically reduced to the number of char allowed by the column, even if I
insert a longer string.</font></div>
<div><font color="#800000" face="Verdana" size="2"></font> </div>
<div><font color="#800000" face="Verdana" size="2">I don't want to do this from PHP,
and I was wandering how this can be done in PostreSQL? Maybe in CREATE
TABLE definition?</font></div>
<div><font color="#800000" face="Verdana" size="2"></font> </div>
<div><font color="#800000" face="Verdana" size="2">Cheers,
Raul.</font></div></div></div></blockquote>
</BODY></HTML>