Search Postgresql Archives

Re: quote string exactly as it is

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

 





On Wed, Dec 2, 2009 at 12:10 PM, dario.ber@xxxxxxxxx <dario.ber@xxxxxxxxx> wrote:
Hello,

How can I quote a string *exactly* as it is? I tried using
quote_literal() but it doesn't return what I need in some cases.

E.g.

If my
string is: ss\\\ss

And I do:

select quote_literal('ss\\\ss');

I get:


E'ss\\ss'  <-- My string now has E'' added and one backslash has been removed!
http://www.postgresql.org/docs/8.3/static/sql-syntax-lexical.html

That E tells postgres, that string is escaped.


--
GJ

[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