pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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



view thread (10+ messages)  latest in thread

Message-ID: <200309272229.50601.josh@agliodbs.com>
Permalink:  ../200309272229.50601.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200309272229.50601.josh@agliodbs.com

 · 

reply

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