Thread: index with no column

index with no column

From
"Didier Gasser-Morlay"
Date:
With this group's help (which is MUCH appreciated, thanks) I am slowly
starting to live with Postgres in a production environment.

I have setup an automated backup/restore between two machines, all is
fine. Bar on thing: after restoring mu database, I had a message about
several errors ignored (I did not keep a log of these errors), but I
am seing on several tables, some indexes declared but pgadmin3 fails
to show any columns. I had to manually drop the indexes and recreate
them

So my questions are

- How is this possible ? Should'nt the index be rejected during the
restore if there was a problem ?

- Is there a query I could write to check what are the indexes w/o
columns defined ?

Thanks in advance

Didier

Re: index with no column

From
Tom Lane
Date:
"Didier Gasser-Morlay" <didiergm@gmail.com> writes:
> I have setup an automated backup/restore between two machines, all is
> fine. Bar on thing: after restoring mu database, I had a message about
> several errors ignored (I did not keep a log of these errors), but I
> am seing on several tables, some indexes declared but pgadmin3 fails
> to show any columns. I had to manually drop the indexes and recreate
> them

This is really not enough information to guess what was wrong.
But I'm thinking what you saw was at least partly a pgadmin bug.
Postgres doesn't support zero-column indexes, so if pgadmin showed
them as being such, it was mistaken.

If you want to investigate more closely, please reproduce the problem
from scratch, and this time keep a log of what errors you got and what
statements they were in response to.  Then compare what pgadmin
and psql \d have to say about it.

            regards, tom lane