don't understand something about backslashes

Поиск
Список
Период
Сортировка
От Dennis Gearon
Тема don't understand something about backslashes
Дата
Msg-id 3E7A18CA.9050404@cvc.net
обсуждение исходный текст
Ответы Re: don't understand something about backslashes  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: don't understand something about backslashes  (Darren Ferguson <darren@thread.crystalballinc.com>)
Список pgsql-general
I have a varchar that is 64 wide. I prescape stuff like the '-'
character to prevent SQL injection.

Here is the EXACT field value that I inserted recently,for a test. It
comes to approx 100 chars.

'\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1\-1'::varchar,

I insert that and get:

    NO ERROR

When I look at the record in phpPgAdmin, the slashes don't show up in
the record.

So, do they make it to the record, anyone know? What do I have to do for
the PostgreSQL engine to prevent '--' character from ending a line in a
a string? Or in general, get the backslashes in the record?






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

Предыдущее
От: Darko Prenosil
Дата:
Сообщение: Re: Handling Blobs with libpq
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: log_timestamp and SIGHUP?