Re: quote string exactly as it is

From: Bill Todd <pg(at)dbginc(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-03 01:37:11
Message-ID: 4B171647.8090100@dbginc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

My solution was to set standard_conforming_strings = on in postgresql.conf.

Bill

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gary R. Schmidt 2009-12-03 01:58:32 Re: [Bacula-devel] Catastrophic changes to PostgreSQL 8.4
Previous Message Tatsuo Ishii 2009-12-03 00:36:40 Re: Large Objects and Replication question