Re: What is wrong?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Wei Weng <wweng(at)kencast(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: What is wrong?
Date: 2001-09-29 06:19:21
Message-ID: Pine.BSF.4.21.0109282317330.29157-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On 28 Sep 2001, Wei Weng wrote:

> Hi there. I wrote a simple postgresql sql function as follows:
>
> create function test() returns integer as '
> begin
> fixed_path := translate (''/text'', ''\\'', ''/'');
> raise notice ''fixed_path:'', fixed_path;
> return 1;
> end
> ' language 'plpgsql';
>
> And when I ran it as
>
> pgsql>select test();
>
> I got:
>
> NOTICE: plpgsql: ERROR during compile of test near line 8
> ERROR: unterminated string starting on line 10
>
> What is wrong? (something fishy about translate function?) Could anyone
> enlighten me on this?

I think you need to use four backslashes to do the quoting for the
backslash. Plus you're going to need to declare that variable.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Devrim GUNDUZ 2001-09-29 10:23:58 Entering data in serial column
Previous Message Wei Weng 2001-09-28 19:45:48 What is wrong?