Skip site navigation (1) Skip section navigation (2)

Re: varchar error

From: Gnanavel Shanmugam <s(dot)gnanavel(at)inbox(dot)com>
To: Raul Secan <raul(at)zerosoft(dot)ro>, pgsql-php(at)postgresql(dot)org
Subject: Re: varchar error
Date: 2005-06-23 08:53:09
Message-ID: 5A50EF07DAA.00000851s.gnanavel@inbox.com (view raw or flat)
Thread:
Lists: pgsql-php
<!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>
&nbsp;</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>&nbsp;</div>
<div><font color="#800000" face="Verdana" size="2">CREATE TABLE test 
(<br>&nbsp;&nbsp;&nbsp; mytext varchar(5)<br>) WITHOUT OIDS;</font></div>
<div><font color="#800000" face="Verdana" size="2"></font>&nbsp;</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>&nbsp;</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>&nbsp;</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&nbsp;be done in PostreSQL? Maybe in CREATE 
TABLE definition?</font></div>
<div><font color="#800000" face="Verdana" size="2"></font>&nbsp;</div>
<div><font color="#800000" face="Verdana" size="2">Cheers, 
Raul.</font></div></div></div></blockquote>
</BODY></HTML>

Attachment: unknown_filename
Description: text/html (1.9 KB)

In response to

pgsql-php by date

Next:From: Marco ColomboDate: 2005-06-23 11:29:07
Subject: Re: varchar error
Previous:From: Anthony van den BergDate: 2005-06-23 08:40:51
Subject: Re: varchar error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group