Postgresql Substring Before Character Name