Re: RE: position(text,text) function

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Jeff Eckermann <jeckermann(at)verio(dot)net>, "'karl(at)tecc(dot)co(dot)uk'" <karl(at)tecc(dot)co(dot)uk>, pgsql-sql(at)postgresql(dot)org
Subject: Re: RE: position(text,text) function
Date: 2001-07-23 19:06:11
Message-ID: web-89937@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jeff, Karl,

Actually, he's confusing 3 functions. See postgresql.org --> user
lounge --> interactive docs --> functions and operators --> string
functions.

-Josh

> You are confusing the syntax of two similar functions:
> position ('substring' in 'string')
> strpos ('string', 'substring').
> I have a feeling that "position" actually calls "strpos", but I am
> guessing
> on that.
>
> > -----Original Message-----
> > From: karl(at)tecc(dot)co(dot)uk [SMTP:karl(at)tecc(dot)co(dot)uk]
> > Sent: Monday, July 23, 2001 9:27 AM
> > To: pgsql-sql(at)postgresql(dot)org
> > Subject: position(text,text) function
> >
> > 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(at)postgresql(dot)org
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-07-23 21:56:02 Re: Re: Get the tables names?
Previous Message Jeff Eckermann 2001-07-23 18:36:54 RE: position(text,text) function