Re: BUG #4238: pg_class.relhasindex not updated by vacuum - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4238: pg_class.relhasindex not updated by vacuum
Date
Msg-id 12939.1213377161@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #4238: pg_class.relhasindex not updated by vacuum  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: BUG #4238: pg_class.relhasindex not updated by vacuum
List pgsql-bugs
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Lawrence Cohan wrote:
>> In that case the two separate pg_class relhasindex and relhaspkey would
>> make sense indeed - just a thought nothing else and we'll take it as is.

> What would be the point?  If you want to figure out whether a table has
> a primary key, you can query the catalogs.

Note that UNIQUE constraints are implemented by indexes too, so it's not
clear to me that special-casing the pkey would really respond to this
criticism anyway.

But the bottom line is that relhasindex is defined in terms of
possessing physical indexes, not whether those indexes arose from
constraint syntax or CREATE INDEX.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #4238: pg_class.relhasindex not updated by vacuum
Next
From: "Lawrence Cohan"
Date:
Subject: Re: BUG #4238: pg_class.relhasindex not updated by vacuum