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 1kfk2O-0006Zu-W7 for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Nov 2020 13:31:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kfk2M-0005Ii-Go for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Nov 2020 13:31:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfk2M-0005Ia-6O for pgsql-bugs@lists.postgresql.org; Thu, 19 Nov 2020 13:31:46 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfk2F-0004Ay-TK for pgsql-bugs@lists.postgresql.org; Thu, 19 Nov 2020 13:31:45 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 81DFF369; Thu, 19 Nov 2020 08:31:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 19 Nov 2020 08:31:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=tWCSvLnv6non731VIyolmaJUux2Ua6D9PaKE0MnHWdw=; b=Ad0gjizD Ju76anLygh/6g3qJ7gixZj2Xl2MrPGPiqa2hWtbs9ddr0MJfP/mLWSgYmxvxAotl TgYhxSFTzyUH0KmFUuKAmcGhobWMvcsMhy2dk+S9U+vCWwfrgtWng94fGA/VMBJ7 BpyGBzlS6Tc61BAcO4bsmJFM/OZyMOKJ1QBJdfuXZ924Bg/H0LOsBu+HwJo7FZ9w Ksh/hGQiqyNauILDpi15L9tKmy0yccexTd3D6jLUerghk/OuBtJqv5vg9O1ytk46 e/0aE8NhJ9NCNTz2WU4yO+3lpRl17Pc3WVFv5jpOWrY76ThaBE7jBWxqQWZBDpDu MtW9gpElrC9/iw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudefjedgheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtugfgjggfsehtke ertddtredunecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeeufffhjeeiue euffegvddukeegledtveeivdeiueefieeivefgteehueefteehvdenucfkphepudeltddr leehrddukedrjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.18.79]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C9513064AB6; Thu, 19 Nov 2020 08:31:37 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 784032A18D4; Thu, 19 Nov 2020 10:31:35 -0300 (-03) Date: Thu, 19 Nov 2020 10:31:35 -0300 From: Alvaro Herrera To: nozdrum@gmx.de, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16726: Invalid input syntax is not a useful error message Message-ID: <20201119133135.GA31339@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <16726-96431209e6e5f536@postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Nov-18, PG Bug reporting form wrote: > I also tried curly braces ( as suggested by your awful documentation ), but > this just leads to > `syntax error at or near "{"` Actually, curly braces work just fine: =# create table users (some_uuid_field uuid); CREATE TABLE =# insert into users values ('{dec3d6c4-c32e-45c6-0000-1eae3df44fbf}'); INSERT 0 1 (I fixed the broken UUID value, obviously.) The problem with that, I suspect, is that you *replaced* the single-quote delimiters with braces, rather than *add* the braces inside the quoted literal. That's what gives the error message you suggest: =# insert into users values ({dec3d6c4-c32e-45c6-0000-1eae3df44fbf}); ERROR: syntax error at or near "{" LÍNEA 1: insert into users values ({dec3d6c4-c32e-45c6-0000-1eae3df44... ^ > What I want: > b) That your error messages FOR ONCE are not useless and tell me the > expected syntax, you are wasting millions of hours of developer time and > human life, because you can not be asked to make useful error messages. I think you're suggesting something like this: insert into users values ('{dec3d6c4-c32e-45c6-000-1eae3df44fbf}'); ERROR: invalid input syntax for type uuid: "{dec3d6c4-c32e-45c6-000-1eae3df44fbf}" LÍNEA 1: insert into users values ('{dec3d6c4-c32e-45c6-000-1eae3df44... ^ HINT: Valid UUID values are of the form 'FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF'. This is not impossible, but I think it'd be overkill, and it fails to convey that there are other possible formats (if we tried to list them all, it'd be pretty cumbersome). Would this be really all that valuable? However, before embarking on such an implementation, you would certainly owe this group an apology for your rudeness and an admission that we do spend a lot of time producing pretty decent error messages most of the time.