Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In response to Alvaro Herrera <alvherre@xxxxxxxxxxxxxxxxx>:

> 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/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux