| От | Sam Mason |
|---|---|
| Тема | Re: Error inserting data to bytea column in 8.4 |
| Дата | |
| Msg-id | 20090821164630.GF5407@samason.me.uk обсуждение исходный текст |
| Ответ на | Error inserting data to bytea column in 8.4 ("Andrus Moor" <kobruleht2@hot.ee>) |
| Список | pgsql-general |
On Fri, Aug 21, 2009 at 06:54:51PM +0300, Andrus Moor wrote: > create temp table test ( test bytea ); > insert into test values(E'\274') > > Causes error Yup, you want another backslash in there, something like: insert into test values(E'\\274'); The first backslash is expanded out during parsing the SQL into a literal and the second during parsing of the literal into a bytea value. You've got the following transformation going on: SQL -> Literal -> Bytea value The character values at each stage go like this: SQL : 5c 5c 32 37 34 Literal : 5c 32 37 34 (because the '\\' has been unescaped to a '\') Bytea : bc > In 8.2 this script runs OK. Maybe it's in SQL_ASCII encoding? NUL characters wouldn't work in your 8.2 database if that's the case. -- Sam http://samason.me.uk/
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера