X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BFD0D52838 for ; Thu, 23 Jun 2005 05:53:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86645-03 for ; Thu, 23 Jun 2005 08:53:15 +0000 (GMT) Received: from WM12.inbox.com (wm12.inbox.com [208.50.6.12]) by svr1.postgresql.org (Postfix) with SMTP id 8FF66528BB for ; Thu, 23 Jun 2005 05:53:13 -0300 (ADT) Received: from inbox.com (127.0.0.1:25) by inbox.com with [InBox.Com ESMTP Server] id <506230001266.WM12> for from ; Thu, 23 Jun 2005 12:53:10 AM -0800 Mime-Version: 1.0 Date: Thu, 23 Jun 2005 00:53:09 -0800 Message-ID: <5A50EF07DAA.00000851s.gnanavel@inbox.com> From: Gnanavel Shanmugam Subject: Re: varchar error To: Raul Secan , pgsql-php@postgresql.org In-Reply-To: <000d01c577cc$2c9c1f30$0a10a8c0@zerosoft.ro> X-Mailer: IBISIT WebMail Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.612 tagged_above=0 required=5 tests=AWL, HTML_60_70, HTML_MESSAGE, MIME_HTML_ONLY X-Spam-Level: X-Archive-Number: 200506/22 X-Sequence-Number: 3181 <=21DOCTYPE HTML PUBLIC =22-//W3C//DTD HTML 4.0 = Transitional//EN=22>
try with either Rule or Trigger.
 
with regards,
S.Gnanavel


-----Original Message-----
From: = raul=40zerosoft.ro
Sent: Thu, 23 Jun 2005 11:18:45 = +0300
To: pgsql-php=40postgresql.org
Subject: = =5BPHP=5D varchar error

Hello, I just have=20 this:
 
CREATE TABLE test=20 (
    mytext varchar(5)
) WITHOUT OIDS;
 
If = I put a string with more than 5=20 chars in mytext, I receive an error, regarding the wrong lenght of the=20 string.
 
In = MySQL I know that the string is=20 automatically reduced to the number of char allowed by the column, even if = I=20 insert a longer string.
 
I = don't want to do this from PHP,=20 and I was wandering how this can be done in PostreSQL? Maybe in = CREATE=20 TABLE definition?
 
Cheers,=20 Raul.
=