From: Josh Berkus <josh@agliodbs.com>
To: Richard Sydney-Smith <richard@ibisaustralia.com>
To: pgsql-sql@postgresql.org
Subject: Re: Mystery function error
Date: Sat, 27 Sep 2003 22:29:50 -0700
Message-ID: <200309272229.50601.josh@agliodbs.com> (raw)
In-Reply-To: <000c01c38572$73c03c50$251a32d2@athlon2000>
References: <000c01c38572$73c03c50$251a32d2@athlon2000>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, richard@ibisaustralia.com
Subject: Re: Mystery function error
In-Reply-To: <200309272229.50601.josh@agliodbs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox