Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1en5Jh-0007pg-KT for pgsql-general@arkaria.postgresql.org; Sat, 17 Feb 2018 16:26:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1en5Je-0003Xv-Ti for pgsql-general@arkaria.postgresql.org; Sat, 17 Feb 2018 16:26:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1en5Je-0003Xh-J3 for pgsql-general@lists.postgresql.org; Sat, 17 Feb 2018 16:26:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1en5JW-0001Ym-Tx for pgsql-general@postgresql.org; Sat, 17 Feb 2018 16:26:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1HGQC7B020106; Sat, 17 Feb 2018 11:26:12 -0500 From: Tom Lane To: Ken Tanzer cc: "David G. Johnston" , PG-General Mailing List Subject: Re: Any hope for more specific error message for "value too long..."? In-reply-to: References: <5614.1518831408@sss.pgh.pa.us> Comments: In-reply-to Ken Tanzer message dated "Sat, 17 Feb 2018 01:00:46 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20104.1518884772.1@sss.pgh.pa.us> Date: Sat, 17 Feb 2018 11:26:12 -0500 Message-ID: <20105.1518884772@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ken Tanzer writes: >>> I dug in the archives and came across a crude POC hack here: >>> https://www.postgresql.org/message-id/21693.1478376334@sss.pgh.pa.us >> For that matter, it's not totally >> clear what would constitute an improvement --- what do you wish it would >> show you, exactly? > It looks like that patch is about showing which value or where in the > statement the error is being caused. At least for my case, it would be > helpful to know which field is causing the error. And just guessing, but > maybe simpler? No; read the rest of that thread. It would actually be nigh impossible to do it that way in the current system, except for a small subset of cases. Furthermore, if we did do it like that, what about similar errors in non-INSERT commands? The error cursor approach at least has the advantage of being pretty generically applicable. In principle we could make it work for any error arising during expression evaluation. regards, tom lane