position ( substring text IN string text ) → integerReturns first starting index of the specified
substring within string, or zero if it's not present.position('om' in 'Thomas') → 3Functions / 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
position ( substring text IN string text ) → integerReturns first starting index of the specified
substring within string, or zero if it's not present.position('om' in 'Thomas') → 3position ( substring bytea IN bytes bytea ) → integerReturns first starting index of the specified
substring within bytes, or zero if it's not present.position('\x5678'::bytea in '\x1234567890'::bytea) → 3position ( substring bit IN bits bit ) → integerReturns first starting index of the specified
substring within bits, or zero if it's not present.position(B'010' in B'000001101011') → 8
Definition snapshot: b7bd9cda · English manual source