I have installed plpgsql procedural language ok,
I could not get any functions to work. 
I tried the most simple function as documented:
CREATE FUNCTION sptest3 (int4) RETURNS int4 AS
	'BEGIN
		RETURN $1+1;
	END;' LANGUAGE 'plpgsql';


When i call the function from sql
SELECT sptest3(4) AS x;
I get the error:

"NOTICE:  plpgsql: ERROR during compile of sptest3 near line 1
"RROR:  parse error at or near "

can anybody help?

Thu, 2 Nov 2000 13:46:08 +1100 
Pam Withnall <Pamw@zoom.com.au>
create function

What version are you using?  On a 7.0.2 freebsd machine,
I cut and paste the below function and query and had
no problems.

Stephan Szabo
sszabo@bigpanda.com

On Thu, 2 Nov 2000, Pam Withnall wrote:

> I have installed plpgsql procedural language ok,
> I could not get any functions to work. 
> I tried the most simple function as documented:
> CREATE FUNCTION sptest3 (int4) RETURNS int4 AS
> 	'BEGIN
> 		RETURN $1+1;
> 	END;' LANGUAGE 'plpgsql';
> 
> 
> When i call the function from sql
> SELECT sptest3(4) AS x;
> I get the error:
> 
> "NOTICE:  plpgsql: ERROR during compile of sptest3 near line 1
> "RROR:  parse error at or near "
> 
> can anybody help?
> 



Wed, 1 Nov 2000 18:53:25 -0800 (PST)
Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: create function
Pam Withnall <Pamw@zoom.com.au> writes:
> When i call the function from sql
> SELECT sptest3(4) AS x;
> I get the error:

> "NOTICE:  plpgsql: ERROR during compile of sptest3 near line 1
> "RROR:  parse error at or near "

The message looks just like that, eh?  I bet it's unhappy because your
function text contains DOS-style newlines (\r\n) not Unix-style (\n).

7.1 plpgsql will accept \r as whitespace, but current releases don't.
In the meantime, save your script in a not-so-Microsoft-oriented editor.

			regards, tom lane

Thu, 02 Nov 2000 03:50:34 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: create function 