Allow CREATE OR REPLACE VIEW to rename the columns

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Allow CREATE OR REPLACE VIEW to rename the columns
Date: 2019-10-31 02:27:12
Message-ID: CAHGQGwHoQMD3b-MqTLcp1MgdhCpOKU7QNRwjFooT4_d+ti5v6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Currently CREATE OR REPLACE VIEW command fails if the column names
are changed. For example,

=# CREATE VIEW test AS SELECT 0 AS a;
=# CREATE OR REPLACE VIEW test AS SELECT 0 AS x;
ERROR: cannot change name of view column "a" to "x"

I'd like to propose the attached patch that allows CREATE OR REPLACE VIEW
to rename the view columns. Thought?

Regards,

--
Fujii Masao

Attachment Content-Type Size
rename_view_column_v1.patch application/octet-stream 6.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikita Glukhov 2019-10-31 02:35:28 Re: [HACKERS] [PATCH] Generic type subscripting
Previous Message Michael Paquier 2019-10-31 02:11:03 Re: Problem with synchronous replication