varchar error - Mailing list pgsql-php

From Raul Secan
Subject varchar error
Date
Msg-id 000d01c577cc$2c9c1f30$0a10a8c0@zerosoft.ro
Whole thread Raw
Responses Re: varchar error  (Volkan YAZICI <volkan.yazici@gmail.com>)
Re: varchar error  (Anthony van den Berg <anthony@kaartjeposten.nl>)
Re: varchar error  (Gnanavel Shanmugam <s.gnanavel@inbox.com>)
Re: varchar error  (Marco Colombo <pgsql@esiway.net>)
Re: varchar error  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-php
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.

pgsql-php by date:

Previous
From: "Simon Hewitt"
Date:
Subject: FW: pg_put_line() Frustration
Next
From: Volkan YAZICI
Date:
Subject: Re: varchar error