Handling of \ in array data display

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Handling of \ in array data display
Date: 2006-08-18 21:39:35
Message-ID: 200608181439.36527.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2006-08-18 22:32:17 Re: Handling of \ in array data display
Previous Message Joel Stevenson 2006-08-18 16:02:24 Website issue