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 1h1FDu-0006C4-Uf for pgsql-general@arkaria.postgresql.org; Tue, 05 Mar 2019 18:55:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1FDs-0003hH-2d for pgsql-general@arkaria.postgresql.org; Tue, 05 Mar 2019 18:55:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1FDr-0003gB-Mg for pgsql-general@lists.postgresql.org; Tue, 05 Mar 2019 18:55:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1FDo-0002Vo-Du for pgsql-general@lists.postgresql.org; Tue, 05 Mar 2019 18:55:25 +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 x25ItIdb016684; Tue, 5 Mar 2019 13:55:18 -0500 From: Tom Lane To: Matthew Pounsett cc: Andreas Kretschmer , pgsql-general@lists.postgresql.org Subject: Re: [External] LIMIT not showing all results In-reply-to: References: <85CFAA9E-E10B-4B1E-8C79-7793CC92BA82@deccio.net> <2AA9443B-57B7-4088-8B8F-957703E206F0@deccio.net> <2871.1551804378@sss.pgh.pa.us> <22014.1551808473@sss.pgh.pa.us> Comments: In-reply-to Matthew Pounsett message dated "Tue, 05 Mar 2019 13:09:28 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16682.1551812118.1@sss.pgh.pa.us> Date: Tue, 05 Mar 2019 13:55:18 -0500 Message-ID: <16683.1551812118@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Matthew Pounsett writes: > On Tue, 5 Mar 2019 at 12:54, Tom Lane wrote: >> Given that (a) this was triggered by a server migration and (b) >> the leading column of the index looks like it's probably varchar, >> I'm suspicious that the new server has different collation behavior. > The migration in question was an rsync from a Debian 9 box > running 9.4.19-0+deb8u1 to a FreeBSD 11 box running 9.4.20. Yeah, that would fit the theory :-(. Debian would be using glibc and FreeBSD would not be. If you were using C collation in the database, you'd be all right because that's standardized, but I'll bet you were using something else. What does psql \l show for the "collate" setting of this database? (Or, if by chance you had an explicit COLLATE setting on the column in question, what's that?) In any case, you should be reindexing any indexes on textual columns that were not using "C" collation; none of them can be trusted. The system catalogs should be OK. regards, tom lane