quote string exactly as it is

From: "dario(dot)ber(at)libero(dot)it" <dario(dot)ber(at)libero(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: quote string exactly as it is
Date: 2009-12-02 12:10:13
Message-ID: 7596511.1443121259755813170.JavaMail.defaultUser@defaultHost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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!

What I want to do is to pass a string to a custom made function. Since the
string can contain various metacharcters I need some way to pass this string
exactly as it is.

(For those who might be interested, the strings I'm working
with are FASTQ quality scores)

I'm using Postgresql 8.3 on Windows XP

Thanks
a lot!

Dario

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-12-02 12:28:51 Re: quote string exactly as it is
Previous Message Tech 2010 2009-12-02 12:05:24 Re: vacuumdb: vacuuming of database "xy" failed: PANIC: corrupted item pointer: 19227