Re: Mystery function error - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Mystery function error
Date
Msg-id 200309272228.07762.josh@agliodbs.com
Whole thread Raw
In response to Mystery function error  ("Richard Sydney-Smith" <richard@ibisaustralia.com>)
List pgsql-sql
Richard,

>--------------------------- CREATE OR REPLACE FUNCTION public.locate(bpchar,
> bpchar)
>   RETURNS int4 AS
> '
>   -- search for the position of $2 in $1
>
>   declare
>     srcstr alias for $1;
>     searchstr alias for $2;
>
> begin
> return position(searchstr in srcstr);

You're missing "END;".

> '
>   LANGUAGE 'plpgsql' VOLATILE;

Also, the function is not VOLATILE.  It's IMMUTABLE, and STRICT as well.


-- 
Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-sql by date:

Previous
From: Joe Conway
Date:
Subject: Re: Mystery function error
Next
From: Josh Berkus
Date:
Subject: Re: Mystery function error