Re: Mystery function error - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Mystery function error
Date
Msg-id 200309272229.50601.josh@agliodbs.com
Whole thread Raw
In response to Mystery function error  ("Richard Sydney-Smith" <richard@ibisaustralia.com>)
Responses Re: Mystery function error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Richard,

> The goal is to have
>
> locate( stra, strb) = position(strb in stra)

Also, this will run faster if you do it as a SQL function:

CREATE FUNCTION locate ( text, text ) RETURNS INT AS '
SELECT POSITION($2, $1);
' LANGUAGE SQL IMMUTABLE STRICT;

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Mystery function error
Next
From: Tom Lane
Date:
Subject: Re: Mystery function error