Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYUnr-0005J1-CA for pgsql-general@arkaria.postgresql.org; Thu, 07 Oct 2021 14:55:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mYUnq-00033V-3m for pgsql-general@arkaria.postgresql.org; Thu, 07 Oct 2021 14:55:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYUnp-00033N-Qy for pgsql-general@lists.postgresql.org; Thu, 07 Oct 2021 14:55:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYUnn-0003hI-0h for pgsql-general@lists.postgresql.org; Thu, 07 Oct 2021 14:55:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 197Et9Os055190; Thu, 7 Oct 2021 10:55:09 -0400 From: Tom Lane To: Adrian Klaver cc: Thomas Kellerer , "pgsql-general@lists.postgresql.org" Subject: Re: Misplaced double quotes in error message In-reply-to: References: Comments: In-reply-to Adrian Klaver message dated "Thu, 07 Oct 2021 06:39:02 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <55188.1633618509.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Oct 2021 10:55:09 -0400 Message-ID: <55189.1633618509@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > On 10/6/21 11:17 PM, Thomas Kellerer wrote: >> consider the following table, query and error message: >> 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 underst= and >> 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. Yeah. This is not as simple as it looks, because per our message style guidelines, double quotes are used to set off inserted text, independently of whether it is a SQL identifier or something else. (There is a style violation in this message: the occurrence of t.somecolumn in the primary message should've been quoted too.) In translated error messages, the English double quotes are replaced with whatever the common quoting marks are in that language. So for instance in French this becomes ASTUCE : Peut-=C3=AAtre que vous souhaitiez r=C3=A9f=C3=A9rencer la colon= ne =C2=AB t.someColumn =C2=BB. where it's at least clearer that the set-off marks are not meant to be copied into a SQL statement. In short, what we've got here is unfortunate confusion between the meaning of double quotes in ordinary English and their meaning in SQL. People complain about this topic every so often, but I've not yet seen a proposal that would improve matters. regards, tom lane