Re: A view needs at least one column whereas a table doesn't...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A view needs at least one column whereas a table doesn't...
Дата
Msg-id 652.1171383129@sss.pgh.pa.us
обсуждение исходный текст
Ответ на A view needs at least one column whereas a table doesn't...  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
Список pgsql-general
"Gurjeet Singh" <singh.gurjeet@gmail.com> writes:
> I know the ERROR seems obvious, but then if we allow zero-column tables,
> then why not zero-column views?
> Or should the question be, why do we allow zero-column tables?

Neither one is legal per the SQL spec.  We allow zero-column tables
because otherwise there are unpleasant corner cases for ALTER TABLE DROP
COLUMN, ie, you couldn't drop the last remaining column before adding
another.  But since we don't have ALTER VIEW DROP COLUMN, there's no
comparable argument for violating the spec for views.

            regards, tom lane

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

Предыдущее
От: "Gurjeet Singh"
Дата:
Сообщение: A view needs at least one column whereas a table doesn't...
Следующее
От: RPK
Дата:
Сообщение: PGSQL 8.2.3 Installation problem