Postgresql Count Character In String Python Functions With Arguments