Postgresql Substring Function Example Problems