Re: [GENERAL] varchar lengths

2010-09-21 Thread Massa, Harald Armin
Arjen, > You do need to be wary of malicious users who put a first name of a >few hundred megabytes. yes, but if that "my first name is a video" hits the database, it is allready to late, isn't it? If it is open to the public, input should be sanitized WAY earlier; and for an internal applicatio

Re: [GENERAL] varchar lengths

2010-09-21 Thread Arjen Nienhuis
On Tue, Sep 21, 2010 at 1:23 PM, Massa, Harald Armin wrote: > I recommend to use TEXT as type for that kind of columns. > 99 out of 100 theories about "this value will never be longer then xx > characters" fail in the long run. > > And "text", limited only by PostgreSQLs limits, performs as good

Re: [GENERAL] varchar lengths

2010-09-21 Thread Marcus Engene
On 9/21/10 1:29 , Terry Lee Tucker wrote: On Tuesday, September 21, 2010 07:23:45 Massa, Harald Armin wrote: I recommend to use TEXT as type for that kind of columns. 99 out of 100 theories about "this value will never be longer then xx characters" fail in the long run. And "text", limited

Re: [GENERAL] varchar lengths

2010-09-21 Thread Terry Lee Tucker
On Tuesday, September 21, 2010 07:23:45 Massa, Harald Armin wrote: > I recommend to use TEXT as type for that kind of columns. > 99 out of 100 theories about "this value will never be longer then xx > characters" fail in the long run. > > And "text", limited only by PostgreSQLs limits, performs as

Re: [GENERAL] varchar lengths

2010-09-21 Thread Massa, Harald Armin
I recommend to use TEXT as type for that kind of columns. 99 out of 100 theories about "this value will never be longer then xx characters" fail in the long run. And "text", limited only by PostgreSQLs limits, performs as good or better then varchar(length_limit) The time of "we only can allow n c

Re: [GENERAL] varchar lengths

2010-09-21 Thread Richard Huxton
On 21/09/10 10:40, Marcus Engene wrote: Hi list, In Oracle I can... create table a ( b varchar2(10 chars) ); ...and then, regardless of character encoding and how much space an ascii character vs a ö takes, 10 characters will fit there. Is there anything I've misunderstood? How does the rest

[GENERAL] varchar lengths

2010-09-21 Thread Marcus Engene
Hi list, In Oracle I can... create table a ( b varchar2(10 chars) ); ...and then, regardless of character encoding and how much space an ascii character vs a ö takes, 10 characters will fit there. If I do say a web-thing in php I have to do horrors like... if (10 < mb_strlen ($b, '8bit')) {