Re: varchar error - Mailing list pgsql-php

From Gnanavel Shanmugam
Subject Re: varchar error
Date
Msg-id 5A50EF07DAA.00000851s.gnanavel@inbox.com
Whole thread Raw
In response to varchar error  ("Raul Secan" <raul@zerosoft.ro>)
List pgsql-php
try with either Rule or Trigger.
 
with regards,
S.Gnanavel


-----Original Message-----
From: raul@zerosoft.ro
Sent: Thu, 23 Jun 2005 11:18:45 +0300
To: pgsql-php@postgresql.org
Subject: [PHP] varchar error

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: Anthony van den Berg
Date:
Subject: Re: varchar error
Next
From: Marco Colombo
Date:
Subject: Re: varchar error