Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Date: Mon, 14 May 2012 21:48:23 +0200 From: Luuk User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.php Subject: Re: pgsql and exception References: <4fb0a891$0$1739$426a34cc@news.free.fr> <4fb0f971$0$21929$426a74cc@news.free.fr> <4fb11e73$0$21933$426a74cc@news.free.fr> <4fb152f8$0$702$426a74cc@news.free.fr> In-Reply-To: <4fb152f8$0$702$426a74cc@news.free.fr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: <654889-bnu.ln1@luuk.invalid.lan> Lines: 25 NNTP-Posting-Host: 2001:980:9089:1:746b:4fc4:3ec1:df66 X-Trace: 1337025002 news.xs4all.nl 6949 [2001:980:9089:1:746b:4fc4:3ec1:df66]:55864 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.php:6047 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...