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 1esZRk-0004eZ-3l for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Mar 2018 19:37:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1esZRh-0000Sm-NY for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Mar 2018 19:37:21 +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.89) (envelope-from ) id 1esZRh-0000SX-8K for pgsql-hackers@lists.postgresql.org; Sun, 04 Mar 2018 19:37:21 +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 1esZRe-0002bn-Hi for pgsql-hackers@postgresql.org; Sun, 04 Mar 2018 19:37:19 +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 w24JbFA1025630; Sun, 4 Mar 2018 14:37:15 -0500 From: Tom Lane To: Tomas Vondra cc: PostgreSQL-development Subject: Re: [HACKERS] user-defined numeric data types triggering ERROR: unsupported type In-reply-to: <07b0dcd6-45f7-a2d3-99c6-115490b2cc98@2ndquadrant.com> References: <9389.1506003842@sss.pgh.pa.us> <4b444362-4240-49e0-3523-724e5932b060@2ndquadrant.com> <24767.1506180446@sss.pgh.pa.us> <14597.1520038563@sss.pgh.pa.us> <42f4e37e-f923-6ea9-4172-cdec5a8c2d25@2ndquadrant.com> <11916.1520127473@sss.pgh.pa.us> <82f29126-df5a-d4bc-f5b5-47233e29aaa6@2ndquadrant.com> <15879.1520182782@sss.pgh.pa.us> <07b0dcd6-45f7-a2d3-99c6-115490b2cc98@2ndquadrant.com> Comments: In-reply-to Tomas Vondra message dated "Sun, 04 Mar 2018 19:49:53 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25628.1520192235.1@sss.pgh.pa.us> Date: Sun, 04 Mar 2018 14:37:15 -0500 Message-ID: <25629.1520192235@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tomas Vondra writes: > FWIW I originally constructed the tests merely to verify that the fix > actually fixes the issue, but I think we should add some tests to make > sure it does not get broken in the future. It took quite a bit of time > until someone even hit the issue, so a breakage may easily get unnoticed > for a long time. Oh, well, that was another problem I had with it: those tests do basically nothing to ensure that we won't add another such problem in the future. If somebody added support for a new type FOO, and forgot to ensure that FOO-vs-not-FOO cases behaved sanely, these tests wouldn't catch it. (At least, not unless the somebody added a FOO-vs-not-FOO case to these tests, but it's hardly likely they'd do that if they hadn't considered the possibility.) I think actually having put in the coding patterns for what to do with unsupported cases is our best defense against similar oversights in future: probably people will copy those coding patterns. Maybe the bytea precedent proves that some people will fail to think about it no matter what, but I don't know what more we can do. regards, tom lane