Re: Backslashitis - Mailing list pgsql-general

From Raghavendra
Subject Re: Backslashitis
Date
Msg-id CA+h6AhjK6TpRwh17r19xKZGW7+cTe8+iikxQYSTp_7R_KRcQFg@mail.gmail.com
Whole thread Raw
In response to Re: Backslashitis  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-general
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 because it doesn't
require any additional escaping of individual elements.

http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-ESCAPE

http://www.postgresql.org/docs/current/static/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS

Regards,
Dean

Thanks

---
Regards,
Raghavendra
EnterpriseDB Corporation

pgsql-general by date:

Previous
From: "Evan D. Hoffman"
Date:
Subject: Re: pg_upgrade: "pg_ctl failed to start the new server"
Next
From: Andreas Kretschmer
Date:
Subject: Re: about seperate users in PostgreSQL