X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 8F9BD9DC827 for ; Wed, 28 Dec 2005 12:22:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 96198-05 for ; Wed, 28 Dec 2005 12:22:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id ED0059DC80F for ; Wed, 28 Dec 2005 12:22:06 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jBSGM66Z017657; Wed, 28 Dec 2005 11:22:06 -0500 (EST) To: Gary Stainburn cc: pgsql-admin@postgresql.org Subject: Re: restored database locale problem In-reply-to: <200512281607.30488.gary.stainburn@ringways.co.uk> References: <200512281453.01568.gary.stainburn@ringways.co.uk> <17461.1135785483@sss.pgh.pa.us> <200512281607.30488.gary.stainburn@ringways.co.uk> Comments: In-reply-to Gary Stainburn message dated "Wed, 28 Dec 2005 16:07:30 +0000" Date: Wed, 28 Dec 2005 11:22:06 -0500 Message-ID: <17656.1135786926@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.05 required=5 tests=[AWL=0.050] X-Spam-Score: 0.05 X-Spam-Level: X-Archive-Number: 200512/348 X-Sequence-Number: 20068 Gary Stainburn writes: > goole=# show lc_ctype; > lc_ctype > ------------- > en_US.UTF-8 > (1 row) > goole=# show server_encoding; > server_encoding > ----------------- > UNICODE > (1 row) Hm. Well, the error message implies that there's some data in the database that we think is valid but mbstowcs() doesn't agree. If this is a pre-8.1 release then you could be getting burnt by the bugs we previously had with more-than-two-byte UTF8 sequences. > This has arisen from reading back into an existing server config a pg_dump > that was taken from the same server. Do you see the error if you just EXPLAIN the problem query, without executing it? If so, the failure is probably happening because a bogus data value happens to show up in the pg_stats statistics for one of the columns used in the query. Since these entries come from a random sample, re-ANALYZE-ing the table will probably make the EXPLAIN error come and go. Which leaves you needing to grovel through the whole table to find the bad data :-( regards, tom lane