Обсуждение: Broken Tables?

Поиск
Список
Период
Сортировка

Broken Tables?

От
"james"
Дата:
Hi, I'm working on a disaster recovery.......
 
 
 
When I do a
psql> SELECT * from tablename;
 
I get the full table back, but when I do a
 
psql> SELECT * from tablename WHERE column_name ='variable';
 
it returns empty rows even though I know for a fact and have checked using the select * query that rows should exist and have the variable in the correct column!!!
 
I could do a select *, grab all the data then drop the table then create the same table again and feed in the data, but I wonder if there is a better way???
 
Cheers...
 
James

Re: Broken Tables?

От
Tom Lane
Дата:
"james" <spare1@cqm.co.uk> writes:
> I get the full table back, but when I do a
> psql> SELECT * from tablename WHERE column_name =3D'variable';
> it returns empty rows even though I know for a fact and have checked using =
> the select * query that rows should exist and have the variable in the corr=
> ect column!!!

Corrupted index maybe?  If there's an index on column_name, try dropping
and rebuilding it.

            regards, tom lane