Re: Escaping \ - Mailing list pgsql-sql

From Tom Lane
Subject Re: Escaping \
Date
Msg-id 22461.985881947@sss.pgh.pa.us
Whole thread Raw
In response to Escaping \  ("Martijn van Dijk" <martijn@hardworks.nl>)
List pgsql-sql
"Martijn van Dijk" <martijn@hardworks.nl> writes:
> But when I try this in a Function:

> CREATE FUNCTION sp_tmp() RETURNS varchar(10)
> AS '
>         SELECT ''\\\' AS RESULT'
> LANGUAGE 'sql';

> I get the following Parse-erros:

You need an extra level of quoting because the function body is itself
a string literal.  You might find the quoting discussion in
http://www.postgresql.org/devel-corner/docs/postgres/plpgsql-porting.html
helpful.
        regards, tom lane


pgsql-sql by date:

Previous
From: clayton cottingham
Date:
Subject: Re: Calling Java from psql (was Re: requesting help)
Next
From: Phuong Ma
Date:
Subject: inconsistent functionality with LIKE operator