Re: BUG #15474: Special character escape sequences need better documentation, or more easily found documentation

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: BUG #15474: Special character escape sequences need better documentation, or more easily found documentation
Дата
Msg-id 87wopy5aj2.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на BUG #15474: Special character escape sequences need betterdocumentation, or more easily found documentation  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #15474: Special character escape sequences need betterdocumentation, or more easily found documentation  (Mike Taylor <bubthegreat@gmail.com>)
Re: BUG #15474: Special character escape sequences need betterdocumentation, or more easily found documentation  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-bugs
>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:

 PG> A simple table elaborating on the escapes for each special
 PG> character would be incredibly helpful at determining how to
 PG> translate those escapes for cleaning strings prior to insertion so
 PG> those of us using postgresql can quickly write cleaning functions
 PG> for data.

If you're "writing cleaning functions" you're already making a serious
mistake, because you should be passing data values as parameters (which
do not require escapes) rather than interpolating into the query string.

If you actually do need to interpolate into the query string for some
reason (like doing COPY or other utility statement that doesn't support
parameters), then you should be using the quote/escape functions
provided by the driver for your client language (e.g. in libpq there is
PQescapeStringConn).

-- 
Andrew (irc:RhodiumToad)


В списке pgsql-bugs по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #15474: Special character escape sequences need betterdocumentation, or more easily found documentation
Следующее
От: Mike Taylor
Дата:
Сообщение: Re: BUG #15474: Special character escape sequences need betterdocumentation, or more easily found documentation