Re: Making error message more user-friendly with spaces in a URI

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Yushi Ogiwara <btogiwarayuushi(at)oss(dot)nttdata(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Making error message more user-friendly with spaces in a URI
Date: 2024-11-18 19:59:18
Message-ID: ZzuclvmETvaKlnOH@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 6, 2024 at 01:09:12AM +0900, Fujii Masao wrote:
>
>
> On 2024/10/31 10:22, Yushi Ogiwara wrote:
> > 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.
>
> I agree the error message could be improved.
>
> The phrasing "Did you forget" feels a bit indirect to me.
> How about using something clearer and more direct instead?
>
> -----------
> psql: error: unexpected spaces found "a b", use percent-encoded spaces instead
> -----------

+1

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

When a patient asks the doctor, "Am I going to die?", he means
"Am I going to die soon?"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Wetmore, Matthew (CTR) 2024-11-18 20:06:24 Re: Statistics Import and Export
Previous Message Bruce Momjian 2024-11-18 19:56:52 Re: DOCS - pg_replication_slot . Fix the 'inactive_since' description