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