Re: Found a bug - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Found a bug
Date
Msg-id 9781.1162911049@sss.pgh.pa.us
Whole thread Raw
In response to Found a bug  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
Responses Re: Found a bug  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
List pgsql-hackers
"Gurjeet Singh" <singh.gurjeet@gmail.com> writes:
>     Please refer the following session snippet. It seems that creating and
> dropping an index on a table, within a transaction, leaves the table marked
> as having an index.

This isn't a bug.  Refer to catalogs.sgml:

relhasindexTrue if this is a table and it has (or recently had) any indexes.This is set by CREATE INDEX, but not
clearedimmediately by DROPINDEX. VACUUM clears relhasindex if it finds the table has no indexes. 
 

The flag is only used as a hint that it's worth looking in pg_index to
see what rows there are for the table.

As for "tracking it down", read index_drop().
        regards, tom lane


pgsql-hackers by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Found a bug
Next
From: "Gurjeet Singh"
Date:
Subject: Re: Found a bug