Re: Saving view turns SELECT * into field list

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Saving view turns SELECT * into field list
Дата
Msg-id 17168.1539633311@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Saving view turns SELECT * into field list  (Ben Uphoff <buphoff@villagemd.com>)
Список pgsql-general
Ben Uphoff <buphoff@villagemd.com> writes:
> Why, when I save a simple view like:
> SELECT * FROM a_table
> …does PostgreSQL turn the * into a field list like:
> SELECT field1, field2, field3, field4 FROM a_table
> ?

Because the SQL standard says we should.  There's explicit text in there
to the effect that adding columns to the underlying table does not add
columns to the view.  Which, I'm sure, is exactly what you wished would
happen ... but they say not to.

            regards, tom lane


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

Предыдущее
От: Ben Uphoff
Дата:
Сообщение: Saving view turns SELECT * into field list
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Saving view turns SELECT * into field list