Bug in renaming view columns

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Bug in renaming view columns
Date: 2004-05-10 14:48:56
Message-ID: 409F9658.7040806@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

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.

test=# create view test as select 1 as a;
CREATE VIEW
test=# \d test
View "public.test"
Column | Type | Modifiers
--------+---------+-----------
a | integer |
View definition:
SELECT 1 AS a;

test=# create or replace view test as select 1 as b;
ERROR: cannot change name of view column "a"
test=# alter table test rename a to b;
ALTER TABLE
test=# \d test
View "public.test"
Column | Type | Modifiers
--------+---------+-----------
b | integer |
View definition:
SELECT 1 AS b;

Chris

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2004-05-10 14:58:13 Linux 2.6.6 changes
Previous Message Bruce Momjian 2004-05-10 14:21:53 Re: mingw configure failure detection