Re: Inserting string with a " into an array using {} syntax ... possible?

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Inserting string with a " into an array using {} syntax ... possible?
Date: 2009-03-13 19:20:00
Message-ID: 20090313152000.2d93c475.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In response to Alvaro Herrera <alvherre(at)commandprompt(dot)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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message gnuoytr 2009-03-13 19:28:57 recatalog existing databases after re-build from source
Previous Message Christophe 2009-03-13 19:09:20 Re: Maximum transaction rate