Re: Backslashitis - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Backslashitis
Date
Msg-id jrc8j6$5vv$1@dough.gmane.org
Whole thread Raw
In response to Backslashitis  (hamann.w@t-online.de)
Responses Re: Backslashitis
List pgsql-general
hamann.w@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 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?
>

Setting

     standard_conforming_strings = true

should do the trick.

http://www.postgresql.org/docs/current/static/runtime-config-compatible.html#GUC-STANDARD-CONFORMING-STRINGS

In that case you don't need any escaping inside the string literals.

Regards
Thomas




pgsql-general by date:

Previous
From: Raghavendra
Date:
Subject: Re: Backslashitis
Next
From: Raghavendra
Date:
Subject: Re: Backslashitis