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

2009-12-10 Thread Robert Haas
On Thu, Dec 10, 2009 at 1:46 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I'm not an expert on this area of the code, but can we just ignore isNatural and usingClause when deparsing? No.  These properties are *not* ignorable because doing so changes the

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

2009-12-10 Thread Andrew Gierth
Robert == Robert Haas robertmh...@gmail.com writes: On Thu, Dec 10, 2009 at 1:46 AM, Tom Lane t...@sss.pgh.pa.us wrote: My reading of the spec is that USING (and therefore NATURAL) is defined to join identically named columns.  Therefore, renaming one of the input columns as the OP

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

2009-12-10 Thread Robert Haas
On Thu, Dec 10, 2009 at 10:48 AM, Andrew Gierth and...@tao11.riddles.org.uk wrote: Robert == Robert Haas robertmh...@gmail.com writes:   On Thu, Dec 10, 2009 at 1:46 AM, Tom Lane t...@sss.pgh.pa.us wrote:     My reading of the spec is that USING (and therefore NATURAL) is   defined to join

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

2009-12-10 Thread Tom Lane
Andrew Gierth and...@tao11.riddles.org.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,

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

2009-12-10 Thread Robert Haas
On Thu, Dec 10, 2009 at 11:57 AM, Tom Lane t...@sss.pgh.pa.us wrote: Andrew Gierth and...@tao11.riddles.org.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

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

2009-12-10 Thread Robert Haas
On Thu, Dec 10, 2009 at 11:54 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Thu, Dec 10, 2009 at 1:46 AM, Tom Lane t...@sss.pgh.pa.us wrote: My reading of the spec is that USING (and therefore NATURAL) is defined to join identically named columns.  

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

2009-12-10 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Thu, Dec 10, 2009 at 11:54 AM, Tom Lane t...@sss.pgh.pa.us wrote: The problem with USING is that it is not merely a join condition but affects the set of columns emitted by the join.  It can't be converted to a simple ON without changing the

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

2009-12-10 Thread Robert Haas
On Thu, Dec 10, 2009 at 1:02 PM, Alvaro Herrera alvhe...@commandprompt.com wrote: Robert Haas escribió: On Thu, Dec 10, 2009 at 11:57 AM, Tom Lane t...@sss.pgh.pa.us wrote: 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

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

2009-12-10 Thread Robert Haas
On Thu, Dec 10, 2009 at 12:32 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Thu, Dec 10, 2009 at 11:54 AM, Tom Lane t...@sss.pgh.pa.us wrote: The problem with USING is that it is not merely a join condition but affects the set of columns emitted by the

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

2009-12-09 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I'm not an expert on this area of the code, but can we just ignore isNatural and usingClause when deparsing? No. These properties are *not* ignorable because doing so changes the set of returned columns --- you should get only one column out not two.

[BUGS] BUG #5234: ALTER TABLE ... RENAME COLUMN change view definition incorrectly

2009-12-06 Thread Sergey Burladyan
The following bug has been logged online: Bug reference: 5234 Logged by: Sergey Burladyan Email address: eshkin...@gmail.com PostgreSQL version: 8.3.8 Operating system: Debian GNU/Linux 5.0.3 (lenny) + testing Description:ALTER TABLE ... RENAME COLUMN change view