Search Postgresql Archives

Re: create table liek view

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

 



On þri, 2007-08-07 at 15:23 +0200, Filip Rembiałkowski wrote:
> filip@filip=# create view v as select 1::int;
> CREATE VIEW
> filip@filip=# select * from v;
>  int4
> ------
>     1
> (1 row)
> filip@filip=# create table t ( like v);
> ERROR:  inherited relation "v" is not a table
> 
> 
> 
> Why? Is there any logical reason for this? View is just a table with
> some rule ON SELECT...

i do not know about the reason this is not allowed, but you can:

create table t as select * from v limit 0;



gnari



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[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