Details
-
New Feature
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Function definition
int4 locate(string text, substr text, [, pos])
Description
Returns the position of the first occurance of substr in str after position pos
- The result is one-based index.
- If string or substr is null, the result should be null.
- pos is one-based index.
- pos cannot be a negative integer.
- If 0 is given to pos, the function considers that pos is 1.
- If there is no pos, the function considers that pos is 1.
- If there is no matched substring, the result should be 0.
Example
SELECT locate('foobarbar', 'bar',5); -> 7