Re: varchar error

From: Anthony van den Berg <anthony(at)kaartjeposten(dot)nl>
To: Raul Secan <raul(at)zerosoft(dot)ro>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: varchar error
Date: 2005-06-23 08:40:51
Message-ID: 42BA7593.2030803@kaartjeposten.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

you might try a trigger!

Raul Secan wrote:

> 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.

--

Kaartjeposten.nl
Molukkenstraat 80 / 7512 XT Enschede
* info(at)kaartjeposten(dot)nl / msn. kaartjeposten(at)hotmail(dot)com
i. www.kaartjeposten.nl / t. 06 - 28 13 88 57
Nu ook voor uw verjaardagkalenders

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Gnanavel Shanmugam 2005-06-23 08:53:09 Re: varchar error
Previous Message Volkan YAZICI 2005-06-23 08:33:47 Re: varchar error