Re: quote string exactly as it is

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: "dario(dot)ber(at)libero(dot)it" <dario(dot)ber(at)libero(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: quote string exactly as it is
Date: 2009-12-02 12:28:51
Message-ID: 2f4958ff0912020428g1130a314wa598a4dc97f828de@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 2, 2009 at 12:10 PM, dario(dot)ber(at)libero(dot)it <dario(dot)ber(at)libero(dot)it>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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A.Bhattacharya 2009-12-02 12:46:24 Auto Vacuum Daemon
Previous Message dario.ber@libero.it 2009-12-02 12:10:13 quote string exactly as it is