Re: Bug in renaming view columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in renaming view columns
Date: 2004-05-10 19:17:51
Message-ID: 18239.1084216671@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-05-10 19:20:56 Re: patch for different join result order on regression test for win32
Previous Message Bruce Momjian 2004-05-10 17:21:15 Re: [PATCHES] patch for different join result order on regression test