Escaping \

From: "Martijn van Dijk" <martijn(at)hardworks(dot)nl>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Escaping \
Date: 2001-03-29 08:05:48
Message-ID: 007a01c0b827$10d5b450$0301000a@collective
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello all,

I've a problem with escaping a \ in a string.

When I enter the query:

SELECT '''\\\''; I get the right result: '\'

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:

psql:tmp1:4: ERROR: Unterminated quoted string. I don't understand why,
when you leave the SELECT-statement out you get '''\\\'' and that is not
unterminated.

Please help

Greetings

Martijn van Dijk

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Patrick Coulombe 2001-03-29 08:13:29 3 options
Previous Message Maurizio Ortolan 2001-03-29 04:50:56 Error in the date field (with NULL value...).Thanks!