pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Attila Kevei <attila.kevei@mail.goodwill.hu>
Cc: Postgres SQL list <pgsql-sql@postgresql.org>
Subject: Re: select returns no line
Date: Tue, 23 Jan 2001 11:54:58 -0500
Message-ID: <6602.980268898@sss.pgh.pa.us> (raw)
In-Reply-To: <980253179.3a6d79fb29871@www.goodwill.hu>
References: <980253179.3a6d79fb29871@www.goodwill.hu>

Attila Kevei <attila.kevei@mail.goodwill.hu> writes:
> Our database has a SELECT problem using varchar columns in WHERE clause
> (but not in all rows!!!). 
> We can fix the whole table (or just the row) as shown below but later it
> seems wrong again (and after the fix the row isn't UPDATEd).

Very bizarre.  Is the bogus SELECT using an index?  (Check with EXPLAIN
if you're not sure.)  I am suspicious that it is using a corrupted
index.  Try dropping and rebuilding the index and see if the problem
persists.

If you have built Postgres with locale support, an easy way to get
corrupted indexes on text/char/varchar columns is to start the
postmaster with different locale environment variables at different
times.  Different locales mean different logical sort orders, and
a btree index that is out of order is corrupt by definition.  The
most common way of shooting yourself in the foot is to sometimes start
the postmaster from a boot script, and sometimes start it by hand from
a user login that has different locale environment than the boot script.
7.1 will have some defenses against this, but in older releases you
have to be careful.

			regards, tom lane



view thread (10+ messages)  latest in thread

Message-ID: <6602.980268898@sss.pgh.pa.us>
Permalink:  ../6602.980268898@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6602.980268898@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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, attila.kevei@mail.goodwill.hu
  Subject: Re: select returns no line
  In-Reply-To: <6602.980268898@sss.pgh.pa.us>
  References: <980253179.3a6d79fb29871@www.goodwill.hu> <6602.980268898@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