Making error message more user-friendly with spaces in a URI
Yushi Ogiwara <btogiwarayuushi@oss.nttdata.com>
From: Yushi Ogiwara <btogiwarayuushi@oss.nttdata.com>
To: Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2024-10-31T01:22:11Z
Lists: pgsql-hackers
Attachments
- user_friendly_error.diff (text/x-diff) patch
Hi, I made a patch to make the error message more user-friendly when using a URI to connect a database with psql. Current Error Message: $ psql "postgres://localhost:5432/postgres?application_name=a b" psql: error: trailing data found: "a b" Currently, if spaces exist in the URI, psql displays this generic error message. New Error Message (with patch): psql: error: found unexpected spaces: “a b“. Did you forget to percent-encode spaces? This revised message is clearer and more concise, guiding users to check for encoding issues. Regards, Yushi Ogiwara
Commits
-
libpq: Improve error message when parsing URI parameters and keywords
- a3699daea202 18.0 landed