Re: Backslashitis

From: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
To: hamann(dot)w(at)t-online(dot)de
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Backslashitis
Date: 2012-06-14 08:31:33
Message-ID: CA+h6AhjZb2Vdv9KqOFY327aUm=5gUXZeUgrAX0ih188wSG75HA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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'{"meet\\\\ing"}';
UPDATE 2
postgres=# select * from array_test ;
name
---------------
{"meet\\ing"}
{"meet\\ing"}
(2 rows)

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

On Thu, Jun 14, 2012 at 1:47 PM, <hamann(dot)w(at)t-online(dot)de> wrote:

> 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 good way to solve the problem, other than rewriting my update
> script to do array updates one element at a time?
>
> Regards
> Wolfgang Hamann
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pratik Chauhan 2012-06-14 08:43:49 Re: installation problems on OSX Lion
Previous Message hamann.w 2012-06-14 08:17:18 Backslashitis