Re: Dropped index on table preventing rule creation - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Dropped index on table preventing rule creation
Date
Msg-id 15556.1316059095@sss.pgh.pa.us
Whole thread Raw
In response to Re: Dropped index on table preventing rule creation  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Dropped index on table preventing rule creation  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
Robert Haas <robertmhaas@gmail.com> writes:
> I spent some more time looking at this tonight.  I am wondering if
> perhaps we should just get rid of relhasindex.

-1, there is absolutely no reason to believe that's a good idea.

> ... I think we could fix Thom's complaint by changing
> DefineQueryRewrite() to call RelationGetIndexList() rather than
> blindly believing relhasindex, which would be maybe a five line
> code-change.  We'd probably also want to change
> SetRelationRuleStatus() to clear relhasindex, which would be one more
> line of code.

Yeah, that's about what it would take, but what I'm asking is why
bother.  The *only* case that we support here is turning a just-created,
not-fooled-with table into a view, and I don't feel a need to promise
that we will handle other cases (which are inevitably going to be poorly
tested).  See for example the adjacent relhassubclass test, which has
got exactly the same issue.

> One related thing that seems worth doing is ripping out relhaspkey,

Having a hard time getting excited about that either ...

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Eduardo Piombino"
Date:
Subject: BUG #6207: fali to get lock on parent table after two consecutive updates to the same row in child table
Next
From: Tom Lane
Date:
Subject: Re: BUG #6205: ERROR: temporary tables cannot specify a schema name