↑↓ select ↵ open ⌫ change scope Open full search

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

Functions / String Functions And Operators

Removes the longest string containing only characters in characters (a space by default) from the start and end of string.

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

Signatures & examples

btrim ( string text [, characters text ] ) → text
Removes the longest string containing only characters in characters (a space by default) from the start and end of string.
btrim('xyxtrimyyx', 'xyz') → trim
btrim ( bytes bytea, bytesremoved bytea ) → bytea
Removes the longest string containing only bytes appearing in bytesremoved from the start and end of bytes.
btrim('\x1234567890'::bytea, '\x9012'::bytea) → \x345678
Version history 5
  1. 12 → 13 changed
  2. 7.4 → 8.0 changed
  3. 7.3 → 7.4 changed
  4. 7.2 → 7.3 changed
  5. 7.1 → 7.2 changed

Definition snapshot: b7bd9cda · English manual source