Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9IJ8XP21191 for ; Thu, 18 Oct 2001 15:08:34 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id f9IJ88c25207; Thu, 18 Oct 2001 15:08:08 -0400 (EDT) To: Brian McCane cc: Marc Spitzer , pgsql-admin@postgresql.org Subject: Re: delete/vacuum not freeing disk space In-reply-to: <20011017151813.S8925-100000@fw.mccons.net> References: <20011017151813.S8925-100000@fw.mccons.net> Comments: In-reply-to Brian McCane message dated "Wed, 17 Oct 2001 15:33:48 -0500" Date: Thu, 18 Oct 2001 15:08:08 -0400 Message-ID: <25204.1003432088@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200110/185 X-Sequence-Number: 2429 Brian McCane writes: > An interesting point was that the duplicated key was actually in the > table, but the existing unique index was happy as a clam. Hmm. What datatype is the key, and what PG version are you running? The only known cause of such problems at the moment is that if you have LOCALE support compiled in, then the correct sort ordering of textual datatypes depends on locale. Change the locale, and presto your index is out of order --- and therefore corrupt. (The btree algorithms do not cope at all well with out-of-order index data. Failing to find entries that are there would be a very common result.) Prior to 7.1 you could easily shoot yourself in the foot this way by starting the postmaster with different locale environment variables at different times. As of 7.1, we save the locale seen at initdb time and adopt that at every postmaster startup, so in theory this class of problems is gone in 7.1. If you've got an example that doesn't fit into this case then I'd like to know about it, especially if you still have the broken index available for examination ... regards, tom lane