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:29:50
Message-ID: 200309272229.50601.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Doris Bernloehr 2003-09-28 12:43:09 SQL Syntax problem
Previous Message Josh Berkus 2003-09-28 05:28:07 Re: Mystery function error