Postgresql Count Character In String Php