Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Gurjeet Singh" <singh.gurjeet@xxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux