Re: Saving view turns SELECT * into field list

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Saving view turns SELECT * into field list
Дата
Msg-id CAKFQuwZ4cPRoaGx7N2dKmvYysJ5tBey+_nvWF0rkokYp21Eupw@mail.gmail.com
обсуждение исходный текст
Ответ на Saving view turns SELECT * into field list  (Ben Uphoff <buphoff@villagemd.com>)
Список pgsql-general
On Monday, October 15, 2018, Ben Uphoff <buphoff@villagemd.com> wrote:


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



Yes, deeply nesting views is a maintenance concern.  It works this way so the view remains stable (there may be others, the reasoning no longer really matters...).  If you really want dynamic SQL you will need to use a function.

David J.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Saving view turns SELECT * into field list
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: FATAL: terminating connection because protocol synchronizationwas lost