Re: pgsql and exception [message #178136 is a reply to message #178133] |
Mon, 14 May 2012 19:48 |
Luuk
Messages: 329 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 14-05-2012 20:46, Une BĂ©vue wrote:
> On 14/05/12 17:19, Shake wrote:
>> Links, You mean URL? have no limit. It don't need to be longs, but it
>> can. There is any requirement of use a "small" varchar(256) for this
>> field?
>>
>> IF there is no limitation or requirement, perhaps is better to put
>> enough space to avoid problems. varchar(1024) could no make a big
>> diference if you don't have a really enormous amount of data.
>
> Yes I mean url for link, a simple google maps URL gave me strlen($url) =
> 329
>
> I have to be more generous...
not too generous ;)
http://dev.mysql.com/doc/refman/5.5/en/char.html
"In contrast to CHAR, VARCHAR values are stored as a one-byte or
two-byte length prefix plus data. The length prefix indicates the number
of bytes in the value. A column uses one length byte if values require
no more than 255 bytes, two length bytes if values may require more than
255 bytes. "
Changing the length from 256 to 1024, or even 2048, should only make a
difference if you store a lot of those lengthy urls...
|
|
|