pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
What is wrong?
2+ messages / 2 participants
[nested] [flat]

* What is wrong?
@ 2001-09-28 19:45 Wei Weng <wweng@kencast.com>
  2001-09-29 06:19 ` Re: What is wrong? Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Wei Weng @ 2001-09-28 19:45 UTC (permalink / raw)
  To: pgsql-sql

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?

Thank you very much!

Wei




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: What is wrong?
  2001-09-28 19:45 What is wrong? Wei Weng <wweng@kencast.com>
@ 2001-09-29 06:19 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Stephan Szabo @ 2001-09-29 06:19 UTC (permalink / raw)
  To: Wei Weng <wweng@kencast.com>; +Cc: 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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-09-29 06:19 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-09-28 19:45 What is wrong? Wei Weng <wweng@kencast.com>
2001-09-29 06:19 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox