Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group