| От | Tom Lane |
|---|---|
| Тема | Re: Backslash problems with 8.1.4 |
| Дата | |
| Msg-id | 4485.1149702410@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Backslash problems with 8.1.4 (Matthew Schumacher <matt.s@aptalaska.net>) |
| Список | pgsql-general |
Matthew Schumacher <matt.s@aptalaska.net> writes:
> Thanks for the reply Tom, however I don't think you understand my issue.
> I'm not using addslashes and I am using the SQL standard way to
> escape a single quote. The problem is that I want to put a literal \'
> inside the database. So if \ is no longer an escape character, and ''
> is the SQL way to pass a literal ' then you would think that \'' would
> put a literal \' into the database, however postgres rejects this and
> spits out an error.
Oh, you're mistaken about \ ... it's still an escape character, as of 8.1.
(Beginning in 8.2 there will be a way to make it not an escape.) So
what you need for that is \\'' inside your literal string.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера