Re: Misplaced double quotes in error message - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Misplaced double quotes in error message
Date
Msg-id cde592cd-7f86-aa7c-90d4-09584a77ae52@aklaver.com
Whole thread Raw
In response to Misplaced double quotes in error message  (Thomas Kellerer <shammat@gmx.net>)
Responses Re: Misplaced double quotes in error message
Re: Misplaced double quotes in error message
List pgsql-general
On 10/6/21 11:17 PM, Thomas Kellerer wrote:
> Hello,
> 
> consider the following table, query and error message:
> 
>      create table t
>      (
>        "someColumn" int
>      );
> 
>      select t.someColumn
>      from t;
> 
> 
>      ERROR: column t.somecolumn does not exist
>        Hint: Perhaps you meant to reference the column "t.someColumn".
> 
> 
> For someone proficient in SQL it's pretty clear what the error message means,
> but the quotes can be misleading for someone who doesn't really understand
> what's going on.

FYI, errors are generically double quoted:

ERROR:  invalid input syntax for type integer: "one"

This is not specific to identifier quoting.

> 
> I think if the error message quoted the column name the way it should actually
> be used, it would make things easier for someone not used to this, e.g.:
> 
>        Hint: Perhaps you meant to reference the column t."someColumn".
> 
> Because when the user takes the error message literally they might be tempted
> to use "t.someColumn" just to be confronted with the same error message again
> which then seems even more confusing.
> 
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Heikki Pernu
Date:
Subject: Re: AW: how to merge two postgresql server instances into one
Next
From: Sunil Thakur
Date:
Subject: Re: Misplaced double quotes in error message