The string concatenation operator in SQL is ||, not +.
Also, substr's start-index argument counts from 1 not 0. Otherwiseyou've got the right idea...
regards, tom lane