Re: textpos() function

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Hitesh Patel <hitesh(at)presys(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: textpos() function
Date: 2000-05-10 11:01:30
Message-ID: 3919418A.39AE10D6@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hitesh Patel wrote:
>
> > If you really don't want to update your app's code just yet, you can
> > install a pg_proc entry that defines textpos() with a CREATE FUNCTION
> > command. But the long-term answer is to fix your code to conform with
> > the standard.
> >
> > regards, tom lane
>
> I changed my code to use position() instead of textpos(), the only
> problem is that I now get a parse error at the following line:
>
> i:= position(stringa, ',');
>
> The exact error message is:
>
> ERROR: parser: parse error at or near ","
>
> Trying to run a query like, 'select position(email, ',') from table'
> fails with the same parse error, however 'select strpos(email, ',') from
> table' runs fine...
>
> any hints?

This is from memory, so please verify with the docs, but I
believe the SQL92 standared is something like:

SELECT position(',' in stringa) ...

Hope that helps,

Mike Mascari

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marcin Inkielman 2000-05-10 12:47:39 row numbering
Previous Message Malcolm Beattie 2000-05-10 09:22:30 Re: [HACKERS] pgsql/php3/apache authentication