Thread: 7.0.2-docs: textpos -> strpos

7.0.2-docs: textpos -> strpos

From
"Albert REINER"
Date:
Saluton,

in the 7.0.2-docs I find the function textpos:

,----
|    Table 5-5. String Functions
|   ...
|    textpos(text,text)      text      locate      specified      substring
|    position('high','ig')
`----

However, in psql it seems one has to use strpos:

,----
| litdb=> select textpos('a  b', '  ');
| ERROR:  Function 'textpos(unknown, unknown)' does not exist
|       Unable to identify a function that satisfies the given argument types
|       You may need to add explicit typecasts
| litdb=> select strpos('a  b', '  ');
|  strpos
| --------
|     2
| (1 row)
| 
| litdb=> select version();
|                 version
| --------------------------------------------------------------------
|  PostgreSQL 7.0.2 on i586-pc-linux-gnulibc1, compiled by gcc 2.95.1
| (1 row)
`----

textpos does not seem to exist:

,----
| litdb=> \df .*pos
|            List of functions
|  Result |    Function     |       Arguments
| --------+-----------------+------------------------
|  int4   | position        | text text
|  float8 | positionjoinsel | oid oid int2 oid int2
|  float8 | positionsel     | oid oid int2 - int4
|  int4   | strpos          | text text
| (4 rows)
`----

Maybe this should be fixed in the docs.

Albert.


-- 

--------------------------------------------------------------------------
Albert Reiner                                   <areiner@tph.tuwien.ac.at>
Deutsch       *       English       *       Esperanto       *       Latine
--------------------------------------------------------------------------


Re: 7.0.2-docs: textpos -> strpos

From
Peter Eisentraut
Date:
Albert REINER writes:

> in the 7.0.2-docs I find the function textpos:

> However, in psql it seems one has to use strpos:

textpos() was removed from the 7.1 documentation.  position() is the SQL
function, I think strpos() is from Oracle.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/