Re: Bug in renaming view columns - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug in renaming view columns
Date
Msg-id 18239.1084216671@sss.pgh.pa.us
Whole thread Raw
In response to Bug in renaming view columns  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: Bug in renaming view columns
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> Are we supposed to be able to rename view columns or not?  You can't if 
> you replace the view, but you can if you rename the column.

I think that's a definition disagreement, not a bug.

Replacing a view is not supposed to change the external appearance of
the view, which to my mind includes the column names.  So I think that
the above behavior is exactly correct.

Take it a little further: if we extend ALTER TABLE to be able to alter
view column types, would you expect CREATE OR REPLACE VIEW to stop
checking that the column types didn't change?  I'd argue that that's a
real bad idea.  If you want the view's output signature to change, you
should have to use a command that indicates that's your intent.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] patch for different join result order on regression test
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] patch for different join result order on regression test