Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKWin-0006my-UL for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Dec 2016 20:45:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cKWin-0007sG-2A for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Dec 2016 20:45:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cKWhN-0006CN-MH for pgsql-hackers@postgresql.org; Fri, 23 Dec 2016 20:44:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cKWhK-00038r-KE for pgsql-hackers@postgresql.org; Fri, 23 Dec 2016 20:44:16 +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 uBNKiCFc020642 for ; Fri, 23 Dec 2016 15:44:12 -0500 From: Tom Lane To: pgsql-hackers@postgresql.org Subject: Re: Incautious handling of overlength identifiers In-reply-to: <17691.1482523168@sss.pgh.pa.us> References: <17691.1482523168@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 23 Dec 2016 14:59:28 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20640.1482525852.1@sss.pgh.pa.us> Date: Fri, 23 Dec 2016 15:44:12 -0500 Message-ID: <20641.1482525852@sss.pgh.pa.us> X-Pg-Spam-Score: -5.0 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org I wrote: > So what to do? We could run around and fix these individual cases > and call it good, but if we do, I will bet a very fine dinner that > more such errors will sneak in before long. Seems like we need a > coding convention that discourages just randomly treating a C string > as a valid value of type NAME. Not sure how to get there though. An alternative worth considering, especially for the back branches, is simply to remove the Assert in hashname(). That would give us the behavior that non-developers see anyway, which is that these functions always fail to match overlength names, whether or not the names would have matched after truncation. Trying to apply truncation more consistently could be left as an improvement project for later. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers