text field constraint advice - Mailing list pgsql-general

From Dale Sykora
Subject text field constraint advice
Date
Msg-id 41F73845.6010606@czexan.net
Whole thread Raw
Responses Re: text field constraint advice
List pgsql-general
PostgreSQL users,
    I would like to use a text field in a table and limit the size to
reduce the chance of denial-of-service/buffer overflow/etc.  I assume I
can define table fields similar to the following
"field_name text check (len(field) < 160)" although my syntax is
probably wrong.  Is checking text length considered a good idea?  If so,
what would be a reasonable limit?  I was thinking about 10 *
average_field_char_length (if avg value is 16 char, set limit to 160
char).  Thanks in advance for your opinions.

Thanks,

Dale



pgsql-general by date:

Previous
From: Robby Russell
Date:
Subject: Re: Good PostgreSQL Based Shopping Cart Software ... ?
Next
From: Oleg Bartunov
Date:
Subject: Re: visualizing B-tree index coverage