Postgresql Substring Function Example Equation