Handling of \ in array data display

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Handling of \ in array data display
Дата
Msg-id 200608181439.36527.josh@agliodbs.com
обсуждение исходный текст
Ответы Re: Handling of \ in array data display  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-bugs
Issue: \ is escaped oddly when displaying the contents of array fields.
Severity: annoyance
Affects: 8.1.3, 8.1.4, 8.0.3, possibly others.
Demonstration of bug:

When saving \ escaped values into text array fields, the \ is escaped when
displaying the contents of the array, leading to an appearance that the
correct data was not saved:

scratch=# create table test_arr ( tarr text[] );
CREATE TABLE
scratch=# insert into test_arr values ( array['x\y','x\\y','x y'] );
INSERT 5695623 1
scratch=# select * from test_arr;
       tarr
-------------------
 {xy,"x\\y","x y"}
(1 row)

scratch=# select tarr[1] from test_arr;
 tarr
------
 xy
(1 row)

scratch=# select tarr[2] from test_arr;
 tarr
------
 x\y
(1 row)

--
--Josh

Josh Berkus
PostgreSQL @ Sun
San Francisco

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

Предыдущее
От: Joel Stevenson
Дата:
Сообщение: Website issue
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Handling of \ in array data display