Re: Inserting string with a " into an array using {} syntax ... possible? - Mailing list pgsql-general

From Bill Moran
Subject Re: Inserting string with a " into an array using {} syntax ... possible?
Date
Msg-id 20090313152000.2d93c475.wmoran@potentialtech.com
Whole thread Raw
In response to Re: Inserting string with a " into an array using {} syntax ... possible?  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Inserting string with a " into an array using {} syntax ... possible?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
In response to Alvaro Herrera <alvherre@commandprompt.com>:

> Bill Moran wrote:
>
> > bill=# insert into testarray (a) values (E'{"text \\"for you\\"","moretext"}');
> > INSERT 0 1
> > bill=# select * from testarray;
> >                a               | id
> > -------------------------------+----
> >  {"text \"for you\"",moretext} |  3
>
> Actually this one is good.  It gets the backslashes in the output because the "
> need to be escaped there too ('cause it's an array).  But if you output a
> single element, they are not there:

Bizarre, but it passes my other tests as well, so I'll have to accept
it as correct ... just seems wrong somehow.

Thanks!

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

pgsql-general by date:

Previous
From: Christophe
Date:
Subject: Re: Maximum transaction rate
Next
From:
Date:
Subject: recatalog existing databases after re-build from source