pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Brian McCane <bmccane@mccons.net>
Cc: Marc Spitzer <marc@oscar.eng.cv.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: delete/vacuum not freeing disk space
Date: Thu, 18 Oct 2001 15:08:08 -0400
Message-ID: <25204.1003432088@sss.pgh.pa.us> (raw)
In-Reply-To: <20011017151813.S8925-100000@fw.mccons.net>
References: <20011017151813.S8925-100000@fw.mccons.net>

Brian McCane <bmccane@mccons.net> 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



view thread (8+ messages)  latest in thread

Message-ID: <25204.1003432088@sss.pgh.pa.us>
Permalink:  ../25204.1003432088@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25204.1003432088@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bmccane@mccons.net, marc@oscar.eng.cv.net
  Subject: Re: delete/vacuum not freeing disk space
  In-Reply-To: <25204.1003432088@sss.pgh.pa.us>
  References: <20011017151813.S8925-100000@fw.mccons.net> <25204.1003432088@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox