pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dorin Grunberg <dorin@visgen.com>
To: karl@tecc.co.uk
To: pgsql-sql@postgresql.org
Subject: Re: position(text,text) function
Date: Mon, 23 Jul 2001 13:58:52 -0400
Message-ID: <4.3.2.7.2.20010723135813.00b50630@pophost> (raw)
In-Reply-To: <slrn9loctm.qsr.karl@azrael.tecc.co.uk>

The correct way would be:

select position('el' in 'Hello');

Dorin

At 02:27 PM 7/23/01 +0000, Karl Orbell wrote:
>I'm having trouble using the position function, it's a simple built-in 
>function.
>
>It returns the index of a substring within a main string.
>
>But, I just can't get it to work, it always gives this silly parser error.
>I've tried it in a variety of ways with variables instead of constants 
>casting
>to text and using it in other contexts, (ie. in functions, not just in a
>select).  What am I doing wrong?  Is this not the correct syntax for a two
>argument function?
>
>test=# select position('hello','el');
>ERROR:  parser: parse error at or near ","
>
>
>Karl Orbell.
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

view thread (6+ messages)  latest in thread

Message-ID: <4.3.2.7.2.20010723135813.00b50630@pophost>
Permalink:  ../4.3.2.7.2.20010723135813.00b50630@pophost/
Also on:    postgresql.org/message-id/4.3.2.7.2.20010723135813.00b50630@pophost

 · 

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: dorin@visgen.com, karl@tecc.co.uk
  Subject: Re: position(text,text) function
  In-Reply-To: <4.3.2.7.2.20010723135813.00b50630@pophost>

* 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