Re: create table liek view - Mailing list pgsql-general

From Ragnar
Subject Re: create table liek view
Date
Msg-id 1186527470.5778.405.camel@localhost.localdomain
Whole thread Raw
In response to create table liek view  ("Filip Rembiałkowski" <plk.zuber@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Decibel!
Date:
Subject: Re: array_to_set functions
Next
From: Decibel!
Date:
Subject: Re: finding out vacuum completion %, and vacuum VS vacuum full