Re: text column constraint, newbie question

Поиск
Список
Период
Сортировка
Искать
От
Ivan Sergio Borgonovo
Тема
Re: text column constraint, newbie question
Дата
Msg-id
20090324000050.160e292f@dawn.webthatworks.it
Ответ на
Список
Дерево обсуждения
Re: text column constraint, newbie question RebeccaJ <rebeccaj@gmail.com>
Re: text column constraint, newbie question Ivan Sergio Borgonovo <mail@webthatworks.it>
Re: text column constraint, newbie question Craig Ringer <craig@postnewspapers.com.au>
Re: text column constraint, newbie question "Daniel Verite" <daniel@manitou-mail.org>
Re: text column constraint, newbie question Stephen Cook <sclists@gmail.com>
Re: text column constraint, newbie question "Daniel Verite" <daniel@manitou-mail.org>
Re: text column constraint, newbie question Alban Hertroys <dalroi@solfertje.student.utwente.nl>
Re: text column constraint, newbie question Scott Marlowe <scott.marlowe@gmail.com>
On Mon, 23 Mar 2009 14:11:28 -0700 (PDT)
RebeccaJ  wrote:

> now. Before, I was planning to have CHECK constraints in all of my
> text or char fields, to keep out all semicolons, single quotes, and
> anything else that looked dangerous. Now I'm thinking that I'll be
> using htmlentities(), pg_escape_string() and pg_query_params() as

check, htmlentities, pg_escape_string and pg_query_params really
don't belong to the same family of "functions" and serve very
different purposes.

simplifying it very much:
- check are used to control the quality of data that get stored in
  the db
- htmlentities is about formatting for web output
- pg_escape_string is to prepare input for sql and avoiding sql
  injection
- pg_query_params is a relative of pg_escape_string but somehow used
  differently

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it

В списке pgsql-general по дате отправления
От: Madison Kelly
Дата:
От: Tom Lane
Дата:
FAQ