ERROR: cannot change name of view column

Поиск
Список
Период
Сортировка
От Réal A. Carbonneau
Тема ERROR: cannot change name of view column
Дата
Msg-id CAJ-S0v57o6Ltgij0zBRnHLK2ustVsM7XinJJF8geJpamq-ortA@mail.gmail.com
обсуждение исходный текст
Ответы Re: ERROR: cannot change name of view column  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Changing the name of any column in a view gives the error "ERROR: cannot change name of view column".  

The documentation is clear: "The new query must generate the same columns that were generated by the existing view query (that is, the same column names in the same order and with the same data types)" 

However, ALTER TABLE ... RENAME COLUMN will change the view column name (see Reference 2 above).

Thus, the original error message is not completely correct.  Ideally, the CREATE OR REPLACE VIEW would automatically apply the ALTER TABLE ... RENAME COLUMN (or underlying procedure) since it is available and fulfills the original DDL request, thus making the error message unnecessary.

Or at the very least, the error message could be changed to suggest using the ALTER TABLE ... RENAME COLUMN until the feature is included in the CREATE OR REPLACE VIEW.

PostgreSQL version 11.1

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Phil Hildebrand
Дата:
Сообщение: Re: BUG #15570: Vacuum analyze ERROR: MultiXactId XXXX has not beencreated yet -- apparent wraparound
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: cannot change name of view column