Re: BUG #5234: ALTER TABLE ... RENAME COLUMN change view definition incorrectly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: robertmhaas(at)gmail(dot)com (Robert Haas), Sergey Burladyan <eshkinkot(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5234: ALTER TABLE ... RENAME COLUMN change view definition incorrectly
Date: 2009-12-10 16:57:40
Message-ID: 24765.1260464260@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> There's another possible solution (albeit a somewhat nontrivial one)
> which came up when a bunch of us were talking about this one on IRC;
> which is to handle the problem in the view deparse: if a column used
> in a USING clause has been renamed, add an alias to the query that
> renames it back, e.g.
> select ... from table1 as table1(v,a) join ... using (v)

Hmm. Cute, but I wonder why we shouldn't just be throwing an error.
As I said last night, the only thing I see wrong with the current
behavior is that the error message isn't phrased in a way that makes
it obvious it's the user's fault.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2009-12-10 17:09:57 Re: BUG #5234: ALTER TABLE ... RENAME COLUMN change view definition incorrectly
Previous Message Tom Lane 2009-12-10 16:54:47 Re: BUG #5234: ALTER TABLE ... RENAME COLUMN change view definition incorrectly