Skip site navigation (1) Skip section navigation (2)

varchar error

From: "Raul Secan" <raul(at)zerosoft(dot)ro>
To: <pgsql-php(at)postgresql(dot)org>
Subject: varchar error
Date: 2005-06-23 08:18:45
Message-ID: 000d01c577cc$2c9c1f30$ (view raw, whole thread or download thread mbox)
Lists: pgsql-php
Hello, I just have this:

    mytext varchar(5)

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

Next:From: Volkan YAZICIDate: 2005-06-23 08:33:47
Subject: Re: varchar error
Previous:From: Simon HewittDate: 2005-06-20 15:21:40
Subject: FW: pg_put_line() Frustration

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group