Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iV6Rd-0003do-Gn for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Nov 2019 04:09:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iV6Rc-0001TC-1i for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Nov 2019 04:09:20 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iV6Rb-0001T5-QO for pgsql-bugs@lists.postgresql.org; Thu, 14 Nov 2019 04:09:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iV6RZ-00067O-7Z for pgsql-bugs@lists.postgresql.org; Thu, 14 Nov 2019 04:09: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 xAE49Cka021561; Wed, 13 Nov 2019 23:09:12 -0500 From: Tom Lane To: Michael Paquier cc: Manuel Rigger , PostgreSQL mailing lists , Peter Eisentraut Subject: Re: Unexpected "cache lookup failed for collation 0" failure In-reply-to: <20191114040342.GC1910@paquier.xyz> References: <19497.1573663852@sss.pgh.pa.us> <2906.1573678571@sss.pgh.pa.us> <20191114040342.GC1910@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Thu, 14 Nov 2019 13:03:42 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21559.1573704552.1@sss.pgh.pa.us> Date: Wed, 13 Nov 2019 23:09:12 -0500 Message-ID: <21560.1573704552@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Wed, Nov 13, 2019 at 03:56:11PM -0500, Tom Lane wrote: >> Looks like a simple oversight --- when bpcharne() was made >> collation-sensitive, it should have grown a check_collation_set() >> call, but somehow that got left out. Fixed. > Wouldn't it be better to add a test case for that? Didn't see the point particularly; we're not any more likely to break this function than any other collation-dependent function. The real question IMO is whether Peter missed any *other* places. I dug through varlena.c and varchar.c and confirmed that every call of PG_GET_COLLATION leads to a collation-is-not-zero test (after this fix), but I didn't try to search the whole backend. regards, tom lane