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

Поиск
Список
Период
Сортировка
От Gurjeet Singh
Тема A view needs at least one column whereas a table doesn't...
Дата
Msg-id 65937bea0702130759g750436bbhb244bc9fd5ec343f@mail.gmail.com
обсуждение исходный текст
Ответы Re: A view needs at least one column whereas a table doesn't...  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
The first SQL command throws an error whereas the second one runs fine:

edb=# create schema s1 authorization u1
edb-# create table t1() create view v1 as select * from t1;
ERROR:  view must have at least one column
edb=#
edb=# create schema s1 authorization u1
edb-# create table t1( c1 int ) create view v1 as select * from t1;
CREATE SCHEMA
edb=#

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? (is inheritance the only reason?)

Can someone provide some explanation for this behaviour?

Best regards,


--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | yahoo }.com
17°29'34.37"N  78°30'59.76"E

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Possible outer join bug with coalesce in 8.2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: A view needs at least one column whereas a table doesn't...