<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">-----OriginalMessage-----<br /><b>From:</b> raul@zerosoft.ro<br /><b>Sent:</b> Thu, 23 Jun 2005
11:18:45+0300<br /><b>To:</b> pgsql-php@postgresql.org<br /><b>Subject:</b> [PHP] varchar error<br /><br /></div><div
class="oldBody"><div><div><fontcolor="#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><fontcolor="#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
isautomatically reduced to the number of char allowed by the column, even if I insert a longer
string.</font></div><div><fontcolor="#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
inCREATE 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>