Re: Mystery function error

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Richard Sydney-Smith" <richard(at)ibisaustralia(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Mystery function error
Date: 2003-09-28 05:28:07
Message-ID: 200309272228.07762.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-09-28 05:29:50 Re: Mystery function error
Previous Message Joe Conway 2003-09-28 05:21:25 Re: Mystery function error