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 B1CA852812 for ; Thu, 23 Jun 2005 05:19:13 -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 78480-09 for ; Thu, 23 Jun 2005 08:19:04 +0000 (GMT) Received: from mail.zerosoft.ro (main.zerosoft.ro [85.186.32.196]) by svr1.postgresql.org (Postfix) with ESMTP id 17F3852973 for ; Thu, 23 Jun 2005 05:19:00 -0300 (ADT) Received: from 192.168.16.10 by mail.zerosoft.ro ([192.168.16.1] running VPOP3) with SMTP for ; Thu, 23 Jun 2005 11:18:45 +0300 Message-ID: <000d01c577cc$2c9c1f30$0a10a8c0@zerosoft.ro> Reply-To: "Raul Secan" From: "Raul Secan" To: Subject: varchar error Date: Thu, 23 Jun 2005 11:18:45 +0300 Organization: ZEROSOFT MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000A_01C577E5.51E02F70" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Server: VPOP3 V1.4.5 - Registered to: ZeroSoft X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.078 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, HTML_60_70, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200506/19 X-Sequence-Number: 3178 This is a multi-part message in MIME format. ------=_NextPart_000_000A_01C577E5.51E02F70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I just have this: CREATE TABLE test ( mytext varchar(5) ) WITHOUT OIDS; If I put a string with more than 5 chars in mytext, I receive an error, = regarding the wrong lenght of the string. 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. 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? Cheers, Raul. ------=_NextPart_000_000A_01C577E5.51E02F70 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
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.
------=_NextPart_000_000A_01C577E5.51E02F70--