Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: 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 06:46:05
Message-ID: 18262.1260427565@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Robert Haas <robertmhaas(at)gmail(dot)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.

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 did *should* indeed *must* break the view.  The problem
is not how to make it work, it's how to give an error message that
doesn't look like an internal failure.

(This wasn't one of the SQL committee's better ideas IMO, but ours not
to reason why.)

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Heikki LinnakangasDate: 2009-12-10 08:07:14
Subject: Re: getting libpqd.lib and libpqd.dll for postgesql 8.4.1 on Vista with VS8 or cygwin g++
Previous:From: Robert HaasDate: 2009-12-10 02:59:28
Subject: Re: BUG #5234: ALTER TABLE ... RENAME COLUMN change view definition incorrectly

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group