postgresql – Unexpected behavior of ltrim in postgres

The 2nd parameter is a list of characters cut, not a chain.
The manual on ltrim (string text [, characters text]):

Delete the longest string containing only characters from characters
(a default space) from the beginning of chain.

So that:

select ltrim ('abc cab bca foo', 'abc');

… only leaves 'foo'.