↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / String Functions And Operators

Returns first starting index of the specified substring within string, or zero if it's not present.

Reading PG 18current·documented in 27 of 27 versions, 7.1 to 20

Signatures & examples

strpos ( string text, substring text ) → integer
Returns first starting index of the specified substring within string, or zero if it's not present. (Same as position(substring in string), but note the reversed argument order.)
strpos('high', 'ig') → 2
Version history 3
  1. 12 → 13 changed
  2. 7.3 → 7.4 changed
  3. 7.2 → 7.3 changed

Definition snapshot: b7bd9cda · English manual source