Re: index on function confuses drop table cascade on child

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: index on function confuses drop table cascade on child
Date: 2010-11-01 23:35:20
Message-ID: 8009.1288654520@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-11-02 00:42:48 Re: index on function confuses drop table cascade on child
Previous Message Kevin Grittner 2010-11-01 21:45:15 Re: BUG #5739: postgresql will not start