Re: [GENERAL] Backslashitis

2012-06-14 Thread Raghavendra
> > With standard conforming strings on, you could use any of the following: > > update foo set a= E'{"blah here"}'; > update foo set a= '{"blah \\here"}'; > update foo set a= ARRAY[E'blah \\here']; > update foo set a= ARRAY['blah \here']; > > I tend to prefer the ARRAY[...] constructor syntax

Re: [GENERAL] Backslashitis

2012-06-14 Thread Dean Rasheed
On 14 June 2012 10:03, Raghavendra wrote: > > On Thu, Jun 14, 2012 at 2:19 PM, Thomas Kellerer wrote: >> >> haman...@t-online.de, 14.06.2012 10:17: >> >>> Hi, >>> >>> I have a column declared as array of text. I can get a single backslash >>> into one of the array elements by >>> update ... set m

Re: [GENERAL] Backslashitis

2012-06-14 Thread Raghavendra
On Thu, Jun 14, 2012 at 2:19 PM, Thomas Kellerer wrote: > haman...@t-online.de, 14.06.2012 10:17: > > Hi, >> >> I have a column declared as array of text. I can get a single backslash >> into one of the array elements by >> update ... set mycol[1] = E'blah \\here' >> If I try to update the whole

Re: [GENERAL] Backslashitis

2012-06-14 Thread Thomas Kellerer
haman...@t-online.de, 14.06.2012 10:17: Hi, I have a column declared as array of text. I can get a single backslash into one of the array elements by update ... set mycol[1] = E'blah \\here' If I try to update the whole array update ... set mycol = E'{"blah \\here"}' the backslash is missing. I

Re: [GENERAL] Backslashitis

2012-06-14 Thread Raghavendra
I think you need to double the quotes. Its mentioned in the PG documention http://www.postgresql.org/docs/9.1/static/arrays.html Eg:- postgres=# update array_test set name=E'{"meeting"}'; UPDATE 2 postgres=# select * from array_test ; name --- {"meet\\ing"} {"meet\\ing"} (2

[GENERAL] Backslashitis

2012-06-14 Thread hamann . w
Hi, I have a column declared as array of text. I can get a single backslash into one of the array elements by update ... set mycol[1] = E'blah \\here' If I try to update the whole array update ... set mycol = E'{"blah \\here"}' the backslash is missing. I can get two backslashes there. Is there a