Malte - as an aside, neither PG's ltrim nor TCL's [string trimleft] are meant to be used the way you are here... they remove from the left of one argument the longest substring made up entirely of characters from the other... so ltrim(name,'_acnorst') will have exacly the same output as ltrim(name,'csr_contact_')... as long as whatever comes after 'csr_contact_' doesn't have any of those letters in it it will work as expected, but it may well lead to strange errors if you start using something like csr_contact_supervisor (which would just return 'upervisor')...