Re: index on function confuses drop table cascade on child - Mailing list pgsql-bugs

From Tom Lane
Subject Re: index on function confuses drop table cascade on child
Date
Msg-id 8009.1288654520@sss.pgh.pa.us
Whole thread Raw
In response to index on function confuses drop table cascade on child  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: index on function confuses drop table cascade on child
List pgsql-bugs
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> create index t_sname on t (sname(t));

Huh, interesting.  The reason the DROP misbehaves is that the index
doesn't have any dependency at all on table "t".  Which appears to
be exposing the folly of this bit in find_expr_references_walker:

        /*
         * A whole-row Var references no specific columns, so adds no new
         * dependency.
         */
        if (var->varattno == InvalidAttrNumber)
            return false;

This is broken at least as far back as 8.1.  Surprising no one's noticed
before.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5739: postgresql will not start
Next
From: Tom Lane
Date:
Subject: Re: index on function confuses drop table cascade on child